Skip to content

Not logging errors properly #19

Description

@gulfpearl

There is a bug in the error logging in @mwni/log. When calling log.error(), the error message appears blank in the console, even though log.info() outputs messages correctly.

the issue comes from how the output function spreads the contents array rather than joining it into a single string.

In the output.js std function, I made the following change to make it work for me:

  • func(${prefix}${date} ${level} [\x1b[${colors[color]}${name}\x1b[0m], ...contents)
  • func(${prefix}${date} ${level} [\x1b[${colors[color]}${name}\x1b[0m] ${contents.join(' ')})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions