Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow for no timestamp being appended #64

Merged
merged 1 commit into from
Aug 19, 2020
Merged

Allow for no timestamp being appended #64

merged 1 commit into from
Aug 19, 2020

Conversation

ClintEsteMadera
Copy link
Contributor

The documentation states that false is a valid value for the dateFormat global config param. That usually suggests that passing false means "do not add this field" but in this case, the code said otherwise, it meant: "use ISO".

Since most loggers nowadays (including console.log!) already add a timestamp to the log line, there has to be a way to opt-out of this field, to avoid repetition.

Example:

Before:

2020-08-11T21:25:35.736Z	90142447-1486-1b56-34e1-68e1b1439670	INFO	[Response] 2020-08-11T21:25:35+0000 https://example.com/api/meters/123 GET

After:

2020-08-11T21:25:35.736Z	90142447-1486-1b56-34e1-68e1b1439670	INFO	[Response] https://example.com/api/meters/123 GET

The documentation states that `false` is a valid value for the `dateFormat` global config param. That usually suggests that passing `false` means "do not add this field" but in this case, the code said otherwise, it meant: "use ISO".

Since most loggers nowadays (including `console.log`!) already add a timestamp to the log line, there has to be a way to opt-out of this field, to avoid repetition.

Example:

**Before:**
```
2020-08-11T21:25:35.736Z	90142447-1486-1b56-34e1-68e1b1439670	INFO	[Response] 2020-08-11T21:25:35+0000 https://example.com/api/meters/123 GET
```

**After:**
```
2020-08-11T21:25:35.736Z	90142447-1486-1b56-34e1-68e1b1439670	INFO	[Response] https://example.com/api/meters/123 GET
```
@hg-pyun hg-pyun self-requested a review August 19, 2020 10:26
@hg-pyun hg-pyun self-assigned this Aug 19, 2020
@hg-pyun hg-pyun added the enhancement New feature or request label Aug 19, 2020
Copy link
Owner

@hg-pyun hg-pyun left a comment

Choose a reason for hiding this comment

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

Good idea. LGTM

@hg-pyun hg-pyun merged commit 0449e8b into hg-pyun:master Aug 19, 2020
@hg-pyun hg-pyun mentioned this pull request Aug 19, 2020
5 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants