Skip to content

Logger: Set debug without editing code #3

@JBarmentlo

Description

@JBarmentlo

Maybe this will be harder than it seems but some behaviour like:
For a logger called ingestorlogger, DEBUG_ingestorlogger is set in os env then it will be debug level.
OR if logger.log() is called from a file called blabla.py if DEBUG_blabla.py is set in env then all logger calls fromthis file are treated as if logger was debug level.

nice opportunity for a context manager (for xtra style points)

class CustomLogger(logging.Logger):
	def log():
		if condition:
			with TmpDebugLevel():
				super().log()
		else:
			super().log()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions