Skip to content

Logger🍋

Logger 🍋

Unique Logger object to handle Python logging.

Example

import logging
import geolime as geo

geo.Project().set_config(geo.Config.COLORED_LOGS, True)
geo.Logger().set_level(logging.DEBUG)

geo.debug("debug")
geo.info("info")
geo.warning("warning")
geo.error("error")
geo.critical("critical")

logger(trace=1) 🍋

Returns the logger.

Parameters:

Name Type Description Default
trace int

number of hops back in the function call stack to tie the logger to. By default, it is the last function calling this logger().

1

set_level(level) 🍋

Convenience function to set the root Python logger level.

Parameters:

Name Type Description Default
level int

numerical value to set the logging level to. See Python logging for more information.

required

critical(msg) 🍋

Convenience function to log a critical message.

Parameters:

Name Type Description Default
msg str

message to log.

required

debug(msg) 🍋

Convenience function to log a debug message.

Parameters:

Name Type Description Default
msg str

message to log.

required

error(msg) 🍋

Convenience function to log a error message.

Parameters:

Name Type Description Default
msg str

message to log.

required

info(msg) 🍋

Convenience function to log an info message.

Parameters:

Name Type Description Default
msg str

message to log.

required

warning(msg) 🍋

Convenience function to log a warning message.

Parameters:

Name Type Description Default
msg str

message to log.

required

Last update: 2022-12-07