-
Notifications
You must be signed in to change notification settings - Fork 1
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
Pawel plesniak/logger inheritance #322
Draft
PawelPlesniak
wants to merge
25
commits into
develop
Choose a base branch
from
PawelPlesniak/LoggerInheritance
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
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
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.
Upgrading the
logging
inheritance, in preparation for theERS
upgrade.Requirements
drunc
, with associated parent loggersdrunc.process_manager
etc. (pseudo as the true root logger is created bylogging.getlogger()
, but in the scope ofdrunc
this will be the new root logger)process_manager
and thecontroller
s, but not any of the shells.logger
s, removeprint_traceback
.controller
RichHandler
as it is not neededlogging.getLogger
as this can cause problems if thelogging
root logger is initializeders
console.print
in place as data that we are not interested in keeping in the log files, i.e. for the shell only.Summary of changes made
setup_root_logger
that creates thedrunc
loggerget_logger
that changes the logging name todrunc.<log_name>
. This will treatdrunc
as the pseudo-root logger. This will easily be extended forers
when it is ready.drunc
is the root loggerprocess_manager
,controller
, andutils
with the appropriate handlersRichHandler
or aStreamHandler
logging.basicConfig
default loggers removed, this will force us to be stricter with the choice of handlers. This addresses the issue of nocontroller
RichHandlers
.console
printing has been left as this is information that will remain in the termina output at all times without information being commited to any logs.self.logger
andself._log
toself.log
.nfs*
andinfo.*.json
to.gitignore
. We don't want these files in the repo anywaylogging.ERROR
when spawning theunified_shell
to ensure that there is always adrunc
logger before any logging is set. The level is overridden insetup_root_logger
if the level islogging.ERROR
Notes
process_manager
logger
instantiated with theunified_shell
, this is needed as theprocess_manager_driver
does not see the logger created by theprocess-manager
itself (I suspect this is because it is run in a separatemp.process
and does not register with the primary process)Still requires
Validating the parent logger selection, checking if more are needed. Still reviewing the
FSM
sepcific ones.Add additional parent
Batch unit test
Discussion
We can define exception handling to go through the loggers, as per here, do we want this? It would mean that we can see the errors in both the console and the logs every time. The logs displayed in the console with RichHandler are rich formatted and the ones in the logs are regularly formatted.
There is now markup in the logs, e.g. in the
process_manager
log withdrunc.process_manager.driver: Booting session [green]local-2x3-config[/green]
. The relevant log entries are color coded so they are easier to read with theRichHandler
, should this be kept or reverted? It's not clear how to do this to affect only one of the handlers.