Open gynt opened 1 year ago
Should this be an extension of the general logging API, both for Lua and Machine Code?
Do you already have an idea how to get the information which module logged and which dll?
I assume the later could be more complicated. At least, the ways I found that could find out the calling dll via code looked like debugging APIs and I am not sure how efficient they are. While a bit more efficient, I do not know if getting the dll the first time and then only checking for the calling address would be truly the better way.
Maybe the logging could be initialized before a handle is received, or the log function could be extened to always require the needed information (in the end, at least module and dll name would always be const strings)?
The main idea behind this is that browsing through a log file to look for what module X said is quite inconvenient, but maybe I am complaining about something which is quite normal.
Let's strip the version info from the log folder and do something like:
log(whoAmI, logLevel, msg)
with whoAmI being the extension name you are. These names are supposed to be unique. If you are a dll, maybe: module-name-dll
?
Hm, a module could in theory load multiple dlls. Maybe offer three versions?:
log(logLevel, msg)
log(whoAmI, logLevel, msg)
log(whoAmI, whichDll, logLevel, msg)
I think that would be mostly for the machine code part. Isn't the log for the lua part already modified to include the module?
yes the lua log function already knows which module is calling it :), but I think I did that for print
and not log
haha...
but if logs need to go into different files, the ucp.dll already needs to receive the information which module it is from.
I am putting this as low priority.
ucp/log/aicloader-0.0.1
for example