-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Bad log spacing depending on the FORMAT and COLORS options used #4630
Open
1 task done
Labels
Comments
somethingSTRANGE
changed the title
Bad log spacing depending on the FORMAT and COLOR options used
Bad log spacing depending on the FORMAT and COLORS options used
May 6, 2024
somethingSTRANGE
added a commit
to somethingSTRANGE/verdaccio
that referenced
this issue
May 7, 2024
fixes: verdaccio#4630 inserted a space between the timestamp and the message when logging timestamped messages.
somethingSTRANGE
added a commit
to somethingSTRANGE/verdaccio
that referenced
this issue
May 7, 2024
fixes: verdaccio#4630 removed padding of an unnecessary space (at the start or end of the log string, depending on whether colors are enabled).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your Environment
Describe the bug
There are two minor issues with log spacing, depending on the
format
andcolors
options chosen.There's an extra single space character preceding the first ANSI color sequence at the beginning of the string (before "info" or "warn" in the following examples). This is most obvious with
format: pretty
,colors: true
. There's also an extra space character at the end of each line whencolors: false
. I didn't notice this until I examined the code.There's a missing space character after the timestamp and before the actual log message. This is obvious with
format: pretty-timestamped
,colors: false
.As a result of these two issues, the above two option combinations produce logs with either extra unnecessary characters or characters that are mashed together making the log more difficult to read. However, if you were to only look at the
format: pretty-timestamped
,colors: true
combination, things would appear to be correct, but that hides the underlying issues.Here are the four relevant combinations for comparison:
format: pretty
,colors: false
:Note the extra space at the end of each line.
format: pretty
,colors: true
:Note the space at the start of each line.
format: pretty-timestamped
,colors: false
:Note the missing space before "info" and "warn", but there is an extra space at the end of each line.
format: pretty-timestamped
,colors: true
:To Reproduce
Configure Verdaccio logging with (
format: pretty
,colors: true
) or (format: pretty-timestamped
,colors: false
) to see the issues.Expected behavior
If (1) the space was removed from the beginning of the first ANSI sequence when
colors: true
is enabled, and (2) an extra space was added to the end of the timestamp whenformat: pretty-timestamped
is enabled, both issues would be fixed, and you'd still have the same formatting you currently have withformat: pretty-timestamped
,colors: true
.format: pretty
,colors: true
should have no space at the start of each line:format: pretty-timestamped
,colors: false
should have a space after the timestamp, but not at the end of the line:Environment information
Contribute to Verdaccio
The text was updated successfully, but these errors were encountered: