Skip to content

Error "Invalid file identifier"  #14

@apw10

Description

@apw10

Hello,

I use Matlab 2017b at Windows 7 and I used the logger in the following way

[~, tmp_name] = fileparts(tempname);
General.LogFileName = fullfile(General.OUTDIR,['AnalyzeLog_' tmp_name '.log']);
fprintf(2,[regexprep(General.LogFileName,'\','\\\') '\n']);
Lg =  logging.getLogger('mylogger', 'path', General.LogFileName);
Lg.setLogLevel(logging.logging.ALL);
Lg.setCommandWindowLevel(logging.logging.ALL);

At a certain time point of the function I get the following error message.

Error using fprintf
Invalid file identifier.  Use fopen to generate a valid file identifier.

Error in logging/writeLog (line 173)
        fprintf(self.logfid, logline);

Error in logging/info (line 104)
      self.writeLog(self.INFO, caller_name, message);

Error in dataComb (line 5)

during a simply task
Lg.info(['color ' int2str(kcolor) '_' curr_col]);

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions