-
Notifications
You must be signed in to change notification settings - Fork 3
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
Logger
overhaul
#98
Merged
Merged
Logger
overhaul
#98
Conversation
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
RasmusSkytte
force-pushed
the
feat/Logger_updates
branch
from
February 1, 2024 11:42
1575bca
to
c23c196
Compare
RasmusSkytte
force-pushed
the
feat/Logger_updates
branch
from
February 1, 2024 14:14
c23c196
to
506bf5e
Compare
RasmusSkytte
force-pushed
the
feat/Logger_updates
branch
from
February 5, 2024 12:53
c8045aa
to
e44cf3c
Compare
6 tasks
5 tasks
RasmusSkytte
force-pushed
the
feat/Logger_updates
branch
from
February 7, 2024 14:20
6be7e70
to
4d04589
Compare
LasseEngboChr
requested changes
Feb 9, 2024
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.
Only a few suggestions
4 tasks
RasmusSkytte
force-pushed
the
feat/Logger_updates
branch
from
February 12, 2024 12:02
76ca312
to
a05d6ea
Compare
5 tasks
This was referenced Feb 13, 2024
Merged
This was referenced Feb 16, 2024
Merged
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.
One line in documentation should be deleted.
LasseEngboChr
approved these changes
Feb 20, 2024
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.
Intent
This PR introduces an overhaul for the
Logger
to make it simpler to use in different cases.Approach
The
Logger
was re-factoredThe
LoggerNull
class was added, which matches the structure ofLogger
but does not write logs to console, file or DB.Fields that were previously public are now made private with corresponding active bindings to show their values.
The
db_tablestring
argument was replaced withdb_table
and made more flexible:i.e. it now takes id-like objects instead of only a character string.
The
ts
argument was renamed totimestamp
to matchupdate_snapshot()
$log_info()
,$log_warn()
and$log_error()
were adjusted.$log_info()
is now return invisibly to simplify$log_warn()
and$log_error()
.$log_info()
is printed withmessage()
instead ofcat()
to allow the suppression of output (CRAN best practices).A custom logging format for timestamps can be passed to the
$log_*()
functions via the argumenttimestamp_format
or the option "SCDB.log_timestamp_format" (fixes FEATURE: Custom logger format #65).The tests for
Logger
were made specific (ie. the single large test was broken into several tests).In addition extra checks are made during testing to ensure "info", "warnings" and "errors" work as intended for different combinations of logging to file and logging to console.
checkmate
assertions improved whenlog_conn = NULL
return
statements gets their own line in accordance with coding standard.Known issues
This PR also contains the code being merged inMove functions to separate files #95Delete intermediate tables after use #89Once merged, this PR will be rebased and opened.Checklist
NEWS.md