The cleanmymac.log Module

cleanmymac.log.LOGGER_NAME = 'cleanmymac'

the main cleanmymac logger name

cleanmymac.log.STR_LEVELS = {'info': 20, 'warn': 30, 'critical': 50, 'error': 40, 'debug': 10, 'warning': 30}

string mapping for logging levels

cleanmymac.log.debug(msg, *args)[source]

log debug messages.

Parameters:
  • or object msg (str) – the message + format
  • args (list) – message arguments
cleanmymac.log.debug_param(msg, value, padding=30)[source]

helper method to debug parameter values, with alignment

Parameters:
  • msg (str) – the message
  • value (Object) – the value
  • padding (int) – padding for the message
cleanmymac.log.disable_logger(name)[source]

disable the given logger

Parameters:name – the name of the logger
cleanmymac.log.echo(msg)[source]

convenience method to display a message, the method relies on click.echo()

Parameters:msg (str) – the message
cleanmymac.log.echo_error(msg, verbose=True)[source]

convenience method to display a message using the red ANSI color, the method relies on click.secho()

Parameters:
  • msg (str) – the message
  • verbose (bool) – echo message only if True
cleanmymac.log.echo_info(msg, verbose=True)[source]

convenience method to display a message using the white ANSI color, the method relies on click.secho()

Parameters:
  • msg (str) – the message
  • verbose (bool) – echo message only if True
cleanmymac.log.echo_success(msg, verbose=True, nl=True)[source]

convenience method to display a message using the green ANSI color, the method relies on click.secho()

Parameters:
  • msg (str) – the message
  • verbose (bool) – echo message only if True
  • nl (bool) – print new line
cleanmymac.log.echo_target(msg, verbose=True)[source]

convenience method to display a message using the blue ANSI color, the method relies on click.secho()

Parameters:
  • msg (str) – the message
  • verbose (bool) – echo message only if True
cleanmymac.log.echo_warn(msg, verbose=True)[source]

convenience method to display a message using the yellow ANSI color, the method relies on click.secho()

Parameters:
  • msg (str) – the message
  • verbose (bool) – echo message only if True
cleanmymac.log.error(msg, *args)[source]

log error messages

Parameters:
  • or object msg (str) – the message + format
  • args (list) – message arguments
cleanmymac.log.info(msg, *args)[source]

log info messages

Parameters:
  • or object msg (str) – the message + format
  • args (list) – message arguments
cleanmymac.log.is_debug()[source]

test if the click_log.get_level() is logging.DEBUG

Returns:True if in debug mode
Return type:bool
cleanmymac.log.is_level(level)[source]

test if the click_log.get_level() is same as level

Parameters:or str level (int) – the level to check
Returns:True if level matches
Return type:bool
cleanmymac.log.warn(msg, *args)[source]

log warning messages

Parameters:
  • or object msg (str) – the message + format
  • args (list) – message arguments