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

console.log format ? #44

Closed
hayd opened this issue Jan 25, 2020 · 1 comment
Closed

console.log format ? #44

hayd opened this issue Jan 25, 2020 · 1 comment
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@hayd
Copy link
Contributor

hayd commented Jan 25, 2020

In node console.log(XXX) is prefixed with:

2020-01-17T04:36:04.408Z 330af918-dcb6-448d-945a-60e6c9c0a63d INFO XXX

should this be the case in deno-lambda?

Note:

  • The id is the request id (which is useful to have as you can look up all the log events from a given request)... which were printed via console (not direct to stdout).
  • The time stamp is superfluous since it's included in the event metadata.
  • It's INFO when it's console.log which seems strange. Why is that?
  • Other platforms (python) don't do this.

My opinion is the timestamp is unnecessary and noisy:

`${REQUEST_ID}\tINFO\tXXX`

is better...

@hayd hayd added help wanted Extra attention is needed question Further information is requested labels Jan 25, 2020
@hayd
Copy link
Contributor Author

hayd commented Jan 27, 2020

One solution is to have a DENO_CONSOLELOG_PREFIX env variable that defaults to ?? but could be set to ${new Date().toISOString()}\t${requestId}\t${level}\t if you wanted to match node.

Also partial to python's Logger:

[INFO]\t330af918-dcb6-448d-945a-60e6c9c0a63d\t2020-01-17T04:36:04.408Z\nXXX

Gone with:

Screen Shot 2020-01-29 at 20 40 36

expanded:

Screen Shot 2020-01-29 at 20 40 18

@hayd hayd mentioned this issue Jan 28, 2020
@hayd hayd closed this as completed Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant