-
Notifications
You must be signed in to change notification settings - Fork 392
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 logging and pretty printing of log file to background manager. #501
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d6a682e
Add logging with rotation and pretty printer.
buddhisthead 2ea062d
Change default logging level to on, not debug
buddhisthead aefe367
Use lager's date/time pretty printer which also supports both local a…
buddhisthead 1a759c6
Dropped the default logfile size to 100K.
buddhisthead File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the intended use of this, and will it io:format all 5mb worth of logs, or just the latest one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of now, it's the only way to dump the logs in a human readable way. I'd like to add more in the future, but I don't think we can jam it into 2.0 at this point. Yes, it will dump all of the logs. I could easily add an entry point that will only print N entries, but I'm trying to keep this dirt simple. Since the iterator walks over chunks, it won't io:format anything bigger than a single entry from the list at a time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's not so easy to add the print(N) thing. It would be easy to print the first N, but not the last N without doing a massive list creation and reversal in memory. Boo. While it's possible to index to the end of the log minus some amount, that seems complicated for a PR that's last minute. We can always print_log() | tail -N. It's only 5 MB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still unsure about the wisdom of pushing 5mb through erlang's IO subsystem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair. I'm running a test now to generate the full 5 MB of logs and then I'll pretty print it. Since it's an iterator, it should do fine, but we'll see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it was hard generating that much data, so I turned down the file size to 100K and it prints the log with no effort at all. That gives 500K worth of log data.
So, hopefully 1a759c6 addresses your concerns.