Ark
Loading...
Searching...
No Matches
ark.tools.log Namespace Reference

Classes

class  bcolors
 This class contains color codes to be used in the log messages to provide visual cues for different log levels. More...
class  CustomFormatter
 CustomFormatter for applying color coding to log levels and including timestamp. More...

Functions

None ok (logging.Logger self, str message, *object args, **object kwargs)
 Custom log method for the OK log level.
str apply_panda_style (str text)
None log_panda (logging.Logger self, str message, *object args, **object kwargs)
logging.Logger setup_logger ()
 Configures and returns a global logger with a custom formatter for colorized output.
str query (str msg)
 Prompts the user for input after printing a message to the console.

Variables

int OK_LEVEL_NUM = 25
 ok
 panda
logging.Logger log = setup_logger()
 query
logging.Logger usrin = log.query("ready?")

Function Documentation

◆ apply_panda_style()

str ark.tools.log.apply_panda_style ( str text)

◆ log_panda()

None ark.tools.log.log_panda ( logging.Logger self,
str message,
*object args,
**object kwargs )

◆ ok()

None ark.tools.log.ok ( logging.Logger self,
str message,
*object args,
**object kwargs )

Custom log method for the OK log level.

This method adds a custom logging level between INFO and WARNING. It is used to log messages that indicate normal operations, but with higher importance than INFO.

Parameters
messageThe log message.
argsAdditional arguments for formatting the message.
kwargsAdditional keyword arguments.

◆ query()

str ark.tools.log.query ( str msg)

Prompts the user for input after printing a message to the console.

This function logs the action of querying the user, prints the provided message to the console, and waits for the user's input.

Parameters
msgThe message to display to the user.
Returns
The user's input as a string.

◆ setup_logger()

logging.Logger ark.tools.log.setup_logger ( )

Configures and returns a global logger with a custom formatter for colorized output.

This function sets up a logger that includes the custom colorized formatter, and configures it to output logs to the console. It uses the DEBUG level as the minimum level to capture logs.

Returns
The configured logger.

Variable Documentation

◆ log

logging.Logger ark.tools.log.log = setup_logger()

◆ ok

ark.tools.log.ok

◆ OK_LEVEL_NUM

int ark.tools.log.OK_LEVEL_NUM = 25

◆ panda

ark.tools.log.panda

◆ query

ark.tools.log.query

◆ usrin

logging.Logger ark.tools.log.usrin = log.query("ready?")