Added timestamp option to logger.#1984
Open
mikkeldamsgaard wants to merge 1 commit intotoitlang:masterfrom
Open
Added timestamp option to logger.#1984mikkeldamsgaard wants to merge 1 commit intotoitlang:masterfrom
mikkeldamsgaard wants to merge 1 commit intotoitlang:masterfrom
Conversation
floitsch
approved these changes
Dec 4, 2023
Member
floitsch
left a comment
There was a problem hiding this comment.
LGTM!
I will ask Kasper or Erik to also have a look.
| --name/string?=null | ||
| --level/int?=null | ||
| --tags/Map?=null | ||
| --timestamp/bool?=null: |
Member
There was a problem hiding this comment.
I think this should be called timestamped.
I think I would change every instance of timestamp with timestamped.
| Adds selected attributes to a copy of this logger. | ||
|
|
||
| If $name is provided, the $name is added to the copy. | ||
| If $level is provied, the $level is added to the copy. |
Member
There was a problem hiding this comment.
Suggested change
| If $level is provied, the $level is added to the copy. | |
| If $level is provided, the $level is added to the copy. |
| buffer ::= buffer_ | ||
|
|
||
| if timestamp: | ||
| buffer.write "$(Time.monotonic-us / 1000)" |
Member
There was a problem hiding this comment.
The digits should be padded. Space is probably enough, but 0 would work too.
Not sure what the correct digit-amount is.
| /** | ||
| Creates a copy where timestamps are enabled. | ||
| */ | ||
| with-timestamp -> Logger: |
Member
There was a problem hiding this comment.
I could be convinced that with-timestamps is better than with-timestamped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.