pygogo

raw JSON →
1.3.0 verified Sat May 09 auth: no python

A Python logging library with super powers, providing easy-to-use loggers with customizable formatting, handlers, and verbosity control. Current version 1.3.0 with infrequent releases.

pip install pygogo
error AttributeError: module 'pygogo' has no attribute 'Gogo'
cause Incorrect import statement like 'import pygogo' then 'pygogo.Gogo'.
fix
Use 'from pygogo import Gogo'.
error ValueError: Unknown level 'INFO'
cause Passing a string level like 'INFO' instead of logging.INFO.
fix
Use logging.INFO or pass integer level (e.g., 20).
deprecated The 'verbose' parameter in Gogo init is deprecated. Use 'level' with a logging constant.
fix Replace verbose=True with level=logging.DEBUG.
gotcha Calling Gogo(__name__).logger twice creates two separate loggers with the same name. The second overwrites the first's handlers.
fix Assign the logger to a variable and reuse it instead of calling Gogo repeatedly.

Create and use a basic logger.

from pygogo import Gogo

logger = Gogo(__name__).logger
logger.info('Hello, world!')