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

[bunyan] Use message field as message #75

Merged
merged 2 commits into from
Sep 1, 2023
Merged

Conversation

curusarn
Copy link
Contributor

@curusarn curusarn commented Sep 1, 2023

Logging without message as a separate argument was completely ignored before - e.g. this would produce no log in Live tail:

logger.info({ msg: "Message", moreContext: "more info" })

This PR:

  • allows logs without message argument
  • uses 'message' field if message argument is missing

Known issue:
Bunyan completely ignores 'msg' field passed inside the context object. I.e. you are not supposed to log like this: logger.({ msg: "Message" })
Some issues about that here:
trentm/node-bunyan#515 (comment)
trentm/node-bunyan#517

@curusarn curusarn changed the title [bunyan] Read message field [bunyan] Use message field as message Sep 1, 2023
Copy link
Contributor

@PetrHeinz PetrHeinz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🙌 Nice fix, just 2 tiny comments below

packages/bunyan/src/bunyan.ts Outdated Show resolved Hide resolved
packages/bunyan/src/bunyan.ts Show resolved Hide resolved
@curusarn curusarn merged commit bb7e9e4 into master Sep 1, 2023
3 checks passed
@curusarn curusarn deleted the sl/read_message_field branch September 1, 2023 15:13
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

Successfully merging this pull request may close these issues.

None yet

2 participants