WIP: Rework logging #48
Loading…
Reference in a new issue
No description provided.
Delete branch "Levitating/Cytoplasm:log"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is a draft PR.
I would like to redesign the logging output somewhat.
I want to be able to log to stdout, syslog and a file at the same time if the user desires to.
This code still needs to be tested with a related patch to Telodendria.
In the future for Telodendria I think it would be best if setting a logfile and use of stdout can be configured over command args.
This is the most unix way and should play well with most inits.
Of course that's not necessary.
Let me know what you think
Aside from some few notes, I think this looks good enough.
@ -26,6 +26,7 @@
#include <Memory.h>
#include <Util.h>
#include <cstdarg>
I think you meant stdarg.h, as those kind of includes are C++isms.
It was most likely automatically added by my IDE by accident.
@ -222,42 +223,14 @@ LogConfigUnindent(LogConfig * config)
}
void
I'd probably consider making LogPrint static here, as it's not even part of the public includes.
Yes it should be static!
I think this is a good idea.
My initial design didn't do this because that seems pretty redundant (some init systems will redirect stdout to the syslog automatically, IIRC). That being said, it doesn't hurt to have the option.
That's not a bad idea. I agree that it is more unix-y to do it this way. We already have the option to override the log level with the verbose flag, so this wouldn't be a far step from that.
Actually OpenRC expects a ("well-behaved") daemon to be able to background itself (with a -d daemon flag), set its own PID and use the syslog.
https://github.com/OpenRC/openrc/blob/master/service-script-guide.md#dont-write-your-own-startstop-functions
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.