Closed jamesjrl closed 5 years ago
Ok,
change of use of close to now request void pointer, left me stumped for some time. My main error was to concentrate on "fixing" this, when the error was declaring the pointer inside the switch, which throws incompatible type errors no matter what method attempted.
//Define the Log path here
char logpath[] = "K:/logfile.log"; //Never put this inside the switch, seriously.
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
//Code to run when the DLL is loaded
/*Initialising threaded log file*/
loguru::add_file(logpath, loguru::Append, loguru::Verbosity_INFO);
LOG_F(INFO, "thread loaded");
case DLL_THREAD_ATTACH:
// Code to run when a thread is created during the DLL's lifetime
case DLL_THREAD_DETACH:
// Code to run when a thread ends normally.
case DLL_PROCESS_DETACH:
//Code to run when the DLL is unloaded.
loguru::file_close(logpath);
break;
}
return TRUE;
}
Simple really, issue closed. Some mention of closing the file in the docs might be useful for fellow noobs and code tinkerers.
I was using loguru successfully a few years ago, copmiling for windows using visual studio. I come back to it re-using my old code recently but download the new loguru2.0 and find file_close throws an error I don't understand, and thus far failed to fix.
and I get the compile error
I am slightly out of my depth delaing with this pointer and have failed with multiple tries. While I continue to try to undestand i'd like to check i'm not wasting my time with a deprecated usage as i find nothing in the new documentation regarding file_close