-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add logger #179
feat: Add logger #179
Conversation
By default all logs will go to a file, which will be in the `<user home directory>/.config/sesh` and the file will be named `<year-month-day>.log` If running in other than the default mode, logs will be also be displayed in screen
Made some decisions to implement this, it will be good to have your input about those:
|
I'll review this and plan on merging it later this week, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add one or two examples (maybe a debug and an error) somewhere in the codebase that shows how this gets used?
I just want to make sure I understand how this gets used and how it impacts testing, thanks.
I've added a couple of examples on how I would log the the error and debug inside the |
I'm on macOS and I was unable to generate a log file in the tmp directory. I could only see the logs in the terminal. I tried all the logs levels, am I missing something? |
The cd $TMPDIR/sesh
tail <date>.log You will find the log file there |
This PR will close issue #140
Adds structured logger to the application
Usage
Define your logs by priority: Debug, Info, Warn and Error by adding the following to the code
To set the debug level when running:
Just need to change the debug text for info or error. The default log level is warn.