-
Notifications
You must be signed in to change notification settings - Fork 114
Log: move global logger storage to logger object + enable log-to-file in daemon mode #533
Comments
One idea I had along these lines was to create a base logging class, like you suggest, and inherit+instantiate in each module namespace. So each nampespace's macro wouldn't need to change when calling it, and would get initialized with that module's logger. How I'm thinking of it so far: In
Then in
Would take a similar approach for client, app, and util. Does this design make sense, and/or follow your suggestions? Also, thought about giving each class it's own logger, but that seemed to get out of control quickly (already over 64 classes that use logging). |
Yes, don't do that.
I'm not sure what you mean because I don't think that's the right language for what you're trying to describe. Can you rephrase? |
Yeah, I guess that was a bit confusing... I meant to remove the global logger, and setup a logger inside each namespace. So, each namespace would have its own logger macro that uses a logger class specific to that namespace. Each logger class could inherit from a base logger class defined in the core (or other) namespace. What I meant by not needing to change the call, is that |
I don't see the need to have 3 loggers according to namespace since they all can pull from the core library. Why do you want to do this? |
It was just the middle-ground between logger-for-every-class and global logger. Really, I don't have strong opinions on 3 loggers, just throwing out halfway-plausible ideas. Instead, are you saying core would expose its logger through an API to client and util (whatever needs it)? |
How else do you propose to initialize with the appropriate class name? Mind you, this logger object can also include an exception object - which would also be appropriately initialized every time the logger class is inherited. |
No proposals :) This sounds good to me.
Very cool, I didn't realize that. This definitely seems like the way to go. So, each class that needs logging would inherit the core logger class, which includes a version of what |
Yes, that's one approach. |
When you improve --daemon logging: It would be nice to append to the days log file instead of overwriting it on kovri start. Just an idea. |
How about appending a timestamp to the filename for start-of-logging? That way you don't have to sift through a day's worth of log to see when you last started the router. |
NOTICE: THIS ISSUE HAS BEEN MOVED TO GitLab. Please continue the discussion there. See #1013 for details. |
By submitting this issue, I confirm the following:
Place an X inside the bracket to confirm
As noted in c8870c0
While we here (unrelated), we should add tags and a global exception handler (if this is needed sooner then we should open a new feature request).
The text was updated successfully, but these errors were encountered: