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

Add arguments to docs #1565

Closed
leonaves opened this issue Jan 9, 2019 · 7 comments
Closed

Add arguments to docs #1565

leonaves opened this issue Jan 9, 2019 · 7 comments
Labels
Docs Applies to Winston's documentation FAQ Frequently Asked Questions

Comments

@leonaves
Copy link

leonaves commented Jan 9, 2019

The documentation, while being very detailed, doesn't seem to actually mention what arguments a logger accepts. String? Object? Either? What about multiple parameters? What's the expected output when you send different parameters?

@kibertoad
Copy link
Contributor

kibertoad commented Jan 9, 2019

First of all, if you check documentation, e. g. the Creating your own Logger section, you would see that both string and object are supported. There are also plenty of examples in /examples section of the repo.
Second, if you believe that more explicit document would be helpful, PR is most welcome.

@leonaves
Copy link
Author

leonaves commented Jan 9, 2019

I apologise, I'll try to be more civil; I've just been poring over these docs and am a little frustrated to find that an apparently widely used and popular library like this doesn't seem to actually specify how its used in its own docs. It seems this has caused issues in the past: #1427. In fact I was specifically looking for information on whether multiple parameters were supported due to some of the examples.

I would love to send a PR to add this information to the documentation, however I do not know what arguments the logger accepts myself, and so I cannot help to add this.

@leonaves
Copy link
Author

leonaves commented Jan 9, 2019

I've edited the original comment to remove some of my clear frustration.

@kibertoad
Copy link
Contributor

kibertoad commented Jan 9, 2019

Thank you!
Plenty of stuff is supported, TBH, which is why documenting is tricky. Going through https://github.com/winstonjs/winston/tree/master/examples would be your best bet; and note that #1562 affects how errors are handled quite a bit.

@leonaves
Copy link
Author

leonaves commented Jan 9, 2019

Problem with the examples is they don't show the output:

https://github.com/winstonjs/winston/blob/master/examples/custom-pretty-print.js#L17

Like here, how will this be logged?

@kibertoad
Copy link
Contributor

I guess the only way to know is to try different combinations in IDE and document that.
And you are right, most likely one of the best ways to document would be to go through examples and augment them with what actually gets logged.

@indexzero
Copy link
Member

Thanks for the feedback. Variable-arity is challenging to document without being overly verbose – hence why we've gone with examples. An assumption of a user was that they would actually run the examples (i.e. a hands-on approach).

Trying to consolidate the most common incantations into ./examples/quick-start.js. A PR to add the output to each of those statements would be welcome.

@indexzero indexzero added Docs Applies to Winston's documentation FAQ Frequently Asked Questions labels Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Applies to Winston's documentation FAQ Frequently Asked Questions
Projects
None yet
Development

No branches or pull requests

3 participants