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

Expose stream.write as option #279

Closed
agnjunio opened this issue Feb 17, 2023 · 2 comments
Closed

Expose stream.write as option #279

agnjunio opened this issue Feb 17, 2023 · 2 comments

Comments

@agnjunio
Copy link

agnjunio commented Feb 17, 2023

I love what Morgan does, but I only have the need to customize this line:

stream.write(line + '\n')

I want to be able to pass custom req.properties as metadata to my logger, so in my use-case I would need morgan to call:

stream.write(line, ...customStuffThatDependsOnUpdatedRes)

Is there a way I can do that?

@agnjunio
Copy link
Author

Noticed that this is addressed by #272

@dougwilson
Copy link
Contributor

Hi @agnjunio there isn't, but .write method cannot accept just random extra parameters, it seems. This is the method signature: https://nodejs.org/api/stream.html#writablewritechunk-encoding-callback

writable.write(chunk[, encoding][, callback])

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

2 participants