Skip to content
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

Improve logging v2 #120

Merged
merged 3 commits into from
Aug 23, 2023

Conversation

oshoma
Copy link
Collaborator

@oshoma oshoma commented Aug 23, 2023

This PR replaces #119.

Instructions:

  cd apps/slackbot
  pip install -r requirements.txt
  python bolt_app.py

Why switch loggers?

  1. Loguru's colorized log output is easier to read than Python's standard logger output.
  2. Loguru formats objects using modern Python string formatting, instead of the older %s formatting available in the standard logger. Because of this, it's able to log more of our objects, instead of raising exceptions or just emitting blank lines like the standard logger does.
  3. Loguru also supports JSON serialization, which can be useful in production if we want a structured log format instead of strings.

Read more here: https://loguru.readthedocs.io/en/stable/

oshoma added 3 commits August 23, 2023 17:29
Instructions:
```
  cd apps/slackbot
  pip install -r requirements.txt
  python bolt_app.py
```

Why switch loggers?

1. Loguru output is easier to read than Python's standard logger output.

2. Loguru formats objects using modern Python string formatting, instead
of the older `%s` formatting available in the standard logger. Because
of this, it's able to log more of our objects, instead of raising
exceptions or just emitting blank lines like the standard logger does.

3. Loguru also supports JSON serialization, which can be useful in
production if we want a structured log format instead of strings.

Read more here: https://loguru.readthedocs.io/en/stable/
Copy link
Collaborator

@20001LastOrder 20001LastOrder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@20001LastOrder 20001LastOrder merged commit e1ad730 into Aggregate-Intellect:main Aug 23, 2023
@oshoma oshoma deleted the improve-logging-v2 branch August 24, 2023 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants