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

Logger formating issue #666

Closed
b00f opened this issue Aug 24, 2023 · 0 comments · Fixed by #693
Closed

Logger formating issue #666

b00f opened this issue Aug 24, 2023 · 0 comments · Fixed by #693
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers Log

Comments

@b00f
Copy link
Collaborator

b00f commented Aug 24, 2023

There are two issues with formatting in the logger:

1- It appears we don't format the global logs. For example:

9:03PM DBG last info _state="{#0 ⌘ 000000000000 🕣 13.03.50}" committers=[0,1,2,3] state_root=9CFF11C4B393
{"level":"info","validator address":"pc1pjj2lrfsh7uewzpcn87xf4v7hy0leftgvar3p6m","reward address":"pc1pjj2lrfsh7uewzpcn87xf4v7hy0leftgvar3p6m","time":"2023-08-24T21:03:47+08:00","message":"consensus instance created"}

The first line is well formatted, but the second line, which is a global log, is not.

2- We should detect if the terminal doesn't support line editing, we don't format the logs. Example:

�[90m9:09PM�[0m �[33mDBG�[0m last info �[36m_state=�[0m"{#0 ⌘ 000000000000 🕣 13.09.10}" �[36mcommitters=�[0m[0,1,2,3] �[36mstate_root=�[0mD9E83BB17BF5

We should determine if the terminal supports line editing. If not, we shouldn't format the logs. To detect line editing support, we can use terminalSupported

We might consider moving this function to the util package.

@b00f b00f added bug Something isn't working enhancement New feature or request good first issue Good for newcomers Log labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers Log
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant