| 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( |