<commit_before>function mdaqLog(filepath)
    mdaq_ip = mdaq_get_ip();
    if mdaq_system_ping() then
        try
            [filename, mlog] = getURL(mdaq_ip + "/log/mlink-server.log", TMPDIR + filesep());
        catch

        end
    else
        mprintf("ERROR: Unable to connect to MicroDAQ device!\n");
        return;
    end

    sci = ver();
    [version, opts] = getversion();

    if argn(2) == 0 then
        // print
        mprintf('Log generated on: %s\n',date());
        mprintf('Toolbox ver: %s\n\n',mdaq_version());
        mprintf('---- MLink log:\n%s\n\n', mlog);
        mprintf('---- Scilab environment info:\n');
        mprintf('Scilab architecture: %s\n', opts(2));
        for i=1:size(sci, 'r') 
            mprintf('%s %s\n', sci(i, 1), sci(i, 2));
        end
    else
        // save to file
        fd = mopen(filepath,'wt');
        mfprintf(fd,'Log generated on: %s\n',date());
        mfprintf(fd,'Toolbox ver: %s\n\n',mdaq_version());
        mfprintf(fd,'---- MLink log:\n%s\n\n', mlog);
        mfprintf(fd,'---- Scilab environment info:\n');
        mfprintf(fd,'Scilab architecture: %s\n', opts(2));
        for i=1:size(sci, 'r') 
            mfprintf(fd,'%s %s\n', sci(i, 1), sci(i, 2));
        end
        
        mclose(fd);
    end
endfunction<commit_msg>Fix mdaq_log to work with Scilab 6.<commit_after>function mdaqLog(filepath)
    mdaq_ip = mdaq_get_ip();
    if mdaq_system_ping() then
        try
            [filename, mlog] = getURL(mdaq_ip + "/log/mlink-server.log", TMPDIR + filesep());
        catch

        end
    else
        mprintf("ERROR: Unable to connect to MicroDAQ device!\n");
        return;
    end

    sci = ver();
    [version, opts] = getversion();

    if argn(2) == 0 then
        // print
        mprintf('Log generated on: %s\n',date());
        mprintf('Toolbox ver: %s\n\n',mdaq_version());
        mprintf('---- MLink log:\n%s\n\n', mlog);
        mprintf('---- Scilab environment info:\n');
        mprintf('Scilab architecture: %s\n', opts(2));
        for i=1:6
            mprintf('%s %s\n', sci(i, 1), sci(i, 2));
        end
    else
        // save to file
        fd = mopen(filepath,'wt');
        mfprintf(fd,'Log generated on: %s\n',date());
        mfprintf(fd,'Toolbox ver: %s\n\n',mdaq_version());
        mfprintf(fd,'---- MLink log:\n%s\n\n', mlog);
        mfprintf(fd,'---- Scilab environment info:\n');
        mfprintf(fd,'Scilab architecture: %s\n', opts(2));
        for i=1:6
            mfprintf(fd,'%s %s\n', sci(i, 1), sci(i, 2));
        end
        
        mclose(fd);
    end
endfunction
{'fraction_non_alphanumeric': 0.18024596464258263, 'fraction_numerical': 0.008839354342813221, 'mean_word_length': 2.048009367681499, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1976395', 'n_tokens_mistral': 960, 'n_tokens_neox': 926, 'n_words': 209}