MCPcopy
hub / github.com/pallets/click / messing_with_logger

Function messing_with_logger

tests/test_context.py:489–503  ·  tests/test_context.py::messing_with_logger
(ctx, debug_logger_name)

Source from the content-addressed store, hash-verified

487 @help_option()
488 @click.pass_context
489 def messing_with_logger(ctx, debug_logger_name):
490 class="cm"># Introspect context to make sure logger name are aligned.
491 assert debug_logger_name == ctx.command.params[0].logger_name
492
493 logger = logging.getLogger(debug_logger_name)
494
495 class="cm"># Logger's level has been properly set to DEBUG by DebugLoggerOption.
496 assert logger.level == logging.DEBUG
497 assert logger.getEffectiveLevel() == logging.DEBUG
498
499 logger.debug(class="st">"Blah blah blah")
500
501 ctx.exit()
502
503 click.echo(class="st">"This will never be printed as we exited early")
504
505 class="cm"># Call the CLI to mess with the custom logger.
506 result = runner.invoke(

Callers

nothing calls this directly

Calls 1

exitMethod · 0.80

Tested by

no test coverage detected