Skip to content

docs: add FileOutput date-based example #56 - #118

Open
AzazelSensei wants to merge 2 commits into
SourceHorizon:mainfrom
AzazelSensei:docs-file-output-56
Open

docs: add FileOutput date-based example #56#118
AzazelSensei wants to merge 2 commits into
SourceHorizon:mainfrom
AzazelSensei:docs-file-output-56

Conversation

@AzazelSensei

Copy link
Copy Markdown

Adds a README example for FileOutput with a date in the file name (log-2024-2-1.txt / log-2024-2-2.txt).

Closes #56

Show writing logs to log-YYYY-M-D.txt in the README.
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment on lines +185 to +186
`FileOutput` writes logs to a file. Use the current date in the file name to get one
file per day (`log-2024-2-1.txt`, `log-2024-2-2.txt`, ...):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am wondering if we should clarify that this is not necessarily true if the program keeps running for longer than a day?
(Probably not really applicable in the case of Flutter, but we are focused on Dart)

That said, perhaps the code example already makes this clear enough?

What do you think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yeah, FileOutput will not roll at midnight. The path is fixed when the Logger is created. I made that explicit after the example.

ISO 8601 date in the file name. Note that the path is fixed at Logger creation.
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

Successfully merging this pull request may close these issues.

Is it possible to provide an example of logging out to a file in the documentation

2 participants