MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / OpenLogFile

Function OpenLogFile

jni/stasm/print.cpp:21–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19// file (as well as to stdout). This inits the global variable logfile_g.
20
21void OpenLogFile( // also inits the global variable logfile_g
22 const char* path) // in: log file path, default is "stasm.log"
23{
24 if (!logfile_g)
25 {
26 if (print_g)
27 printf("Generating %s\n", path);
28 logfile_g = fopen(path, "wb");
29 if (!logfile_g)
30 Err("Cannot open \"%s\"", path);
31 // check that we can write to the log file
32 if (fputs("log file\n", logfile_g) < 0)
33 Err("Cannot write to \"%s\"", path);
34 rewind(logfile_g); // rewind so above test msg is not in the log file
35 }
36}
37
38// Like printf but only prints if print_g flag is set.
39// Also prints to the log file if it is open (regardless of print_g).

Callers 1

stasm_init_extFunction · 0.85

Calls 1

ErrFunction · 0.85

Tested by

no test coverage detected