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

feat: console logger #23

Open
wants to merge 2 commits into
base: feat/destructured-constructor
Choose a base branch
from

Conversation

pwmcintyre
Copy link
Owner

@pwmcintyre pwmcintyre commented May 26, 2023

This proposal adds a ConsoleLogger and updates the StandardLogger to use the environment variable LOG_FORMAT=TEXT to activate it.

Rational

When running a system locally / interactively, it's nice to see the log-level colorized.

Example

image

@pwmcintyre pwmcintyre changed the title Feat/console feat: console logger May 26, 2023
@pwmcintyre
Copy link
Owner Author

alternative

just use shell replacers? 🤷

alias color='(
sed ''/\"level\":\"DEBUG\"/s//$(printf "\033[36m\"level\":\"DEBUG\"\033[0m")/'' \
| sed ''/\"level\":\"INFO\"/s//$(printf "\033[32m\"level\":\"INFO\"\033[0m")/'' \
| sed ''/\"level\":\"WARN\"/s//$(printf "\033[33m\"level\":\"WARN\"\033[0m")/'' \
| sed ''/\"level\":\"ERROR\"/s//$(printf "\033[31m\"level\":\"ERROR\"\033[0m")/''
)'

image

@pwmcintyre pwmcintyre changed the base branch from master to feat/destructured-constructor May 26, 2023 11:03
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.

1 participant