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

Leading space for empty format #10

Open
favoyang opened this issue May 13, 2020 · 0 comments
Open

Leading space for empty format #10

favoyang opened this issue May 13, 2020 · 0 comments

Comments

@favoyang
Copy link

Hi @kutuluk,

Thanks for creating this useful lib. I want to give warn and error a prefix.

prefix.apply(log, {
    format(level, name, timestamp) {
      if (level == "error" || level == "warn") {
        return `[${level}]`;
      }
      return "";
    }
  });

result:

[WARN] a warning text
 an info text
[ERROR] an error text

Notice that the info level line has a leading space. how to remove it?

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