Skip to content

[Feature]: Introduce log level inheritance from parent #23

Description

@emmuhamm

Description

Context

Its been tested that if we set:

  • logger demo level debug
  • logger demo.levels level warning

and run demo.levels.warning("hello, world"), it will only print the warning from the demo.levels logger. This means we have a path into setting different log levels for each child and parent.

Desired change

get_daq_logger at the moment initialises new loggers with the log level INFO by default, if nothing was set. This means every instance of child loggers need to define what log level they want to have. It would be nice if we can have it so that the default action is for the child loggers to inheret the log level of the parent.

Potential impact radius

Small/Isolated

Reason for change

No response

Suggested implementations

Might be straightforward to do this. Can leverage log_level.NOTSET and write some logic in get_daq_logger and elsewhere to check for this and not set any predefined levels

Testing suggestions

Can be checked in pytest, in the test that checks the loggers. See if inheritance works

Anything else?

TODO for @emmuhamm:

  • Set appropriate project tracking

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions