Skip to content

Commit

Permalink
Improve Readme example about library 'disable()' (#883)
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Jun 2, 2023
1 parent c0911df commit 4eba4bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,11 @@ Using the logger in your scripts is easy, and you can |configure|_ it at start.
}
logger.configure(**config)

# For libraries
# For libraries, should be your library's `__name__`
logger.disable("my_library")
logger.info("No matter added sinks, this message is not displayed")

# In your application, enable the logger in the library
logger.enable("my_library")
logger.info("This message however is propagated to the sinks")

Expand Down

0 comments on commit 4eba4bd

Please sign in to comment.