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

Broken on MacOS: it doesn't substitute \e #8

Open
marcellodesales opened this issue Feb 8, 2021 · 1 comment
Open

Broken on MacOS: it doesn't substitute \e #8

marcellodesales opened this issue Feb 8, 2021 · 1 comment

Comments

@marcellodesales
Copy link

  • Running the example it prints the following:
$ bash example.sh
\e[41;37m[2021-02-08             15:40:33.N             ][FATAL ][main:18 ] fatal level\e[0m
\e[1;31m[2021-02-08             15:40:33.N             ][ERROR ][main:19 ] error level\e[0m
\e[1;33m[2021-02-08             15:40:33.N             ][WARN  ][main:20 ] warning level\e[0m
\e[1;32m[2021-02-08             15:40:33.N             ][NOTICE][main:21 ] notice level\e[0m
\e[37m[2021-02-08             15:40:33.N             ][INFO  ][main:22 ] info level\e[0m
\e[1;34m[2021-02-08             15:40:33.N             ][DEBUG ][main:23 ] debug level\e[0m
\e[94m[2021-02-08             15:40:33.N             ][TRACE ][main:24 ] trace level\e[0m
@marcellodesales marcellodesales changed the title Broken on MacOS Broken on MacOS: it doesn't substitute \e Feb 8, 2021
@marcellodesales
Copy link
Author

marcellodesales commented Feb 8, 2021

Solution

$ bash logger.sh
[2021-02-08             15:56:43.N             ][FATAL ][main:18 ] fatal level
[2021-02-08             15:56:43.N             ][ERROR ][main:19 ] error level
[2021-02-08             15:56:43.N             ][WARN  ][main:20 ] warning level
[2021-02-08             15:56:43.N             ][NOTICE][main:21 ] notice level
[2021-02-08             15:56:43.N             ][INFO  ][main:22 ] info level
[2021-02-08             15:56:43.N             ][DEBUG ][main:23 ] debug level
[2021-02-08             15:56:43.N             ][TRACE ][main:24 ] trace level

Screen Shot 2021-02-08 at 4 00 05 PM

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

No branches or pull requests

1 participant