Skip to content
module

rsconnect.log

Logging wrapper and shared instance

Classes
  • RSLogger An adapter for loggers which makes it easier to specify contextual information in logging output.</>
class

rsconnect.log.RSLogger()

Bases
logging.LoggerAdapter

An adapter for loggers which makes it easier to specify contextual information in logging output.

Methods
  • critical(msg, *args, **kwargs) Delegate a critical call to the underlying logger.</>
  • debug(msg, *args, **kwargs) Delegate a debug call to the underlying logger.</>
  • error(msg, *args, **kwargs) Delegate an error call to the underlying logger.</>
  • exception(msg, *args, exc_info, **kwargs) Delegate an exception call to the underlying logger.</>
  • getEffectiveLevel() Get the effective level for the underlying logger.</>
  • hasHandlers() See if the underlying logger has any handlers.</>
  • info(msg, *args, **kwargs) Delegate an info call to the underlying logger.</>
  • isEnabledFor(level) Is this logger enabled for level 'level'?</>
  • log(level, msg, *args, **kwargs) Delegate a log call to the underlying logger, after adding contextual information from this adapter instance.</>
  • process(msg, kwargs) Process the logging message and keyword arguments passed in to a logging call to insert contextual information. You can either manipulate the message itself, the keyword args or both. Return the message and kwargs modified (or not) to suit your needs.</>
  • setLevel(level) Set the specified level on the underlying logger.</>
  • warning(msg, *args, **kwargs) Delegate a warning call to the underlying logger.</>
method

debug(msg, *args, **kwargs)

Delegate a debug call to the underlying logger.

method

info(msg, *args, **kwargs)

Delegate an info call to the underlying logger.

method

warning(msg, *args, **kwargs)

Delegate a warning call to the underlying logger.

method

error(msg, *args, **kwargs)

Delegate an error call to the underlying logger.

method

exception(msg, *args, exc_info=True, **kwargs)

Delegate an exception call to the underlying logger.

method

critical(msg, *args, **kwargs)

Delegate a critical call to the underlying logger.

method

log(level, msg, *args, **kwargs)

Delegate a log call to the underlying logger, after adding contextual information from this adapter instance.

method

isEnabledFor(level)

Is this logger enabled for level 'level'?

Get the effective level for the underlying logger.

method

hasHandlers()

See if the underlying logger has any handlers.

method

process(msg, kwargs)

Process the logging message and keyword arguments passed in to a logging call to insert contextual information. You can either manipulate the message itself, the keyword args or both. Return the message and kwargs modified (or not) to suit your needs.

Normally, you'll only need to override this one method in a LoggerAdapter subclass for your specific needs.

method

setLevel(level)

Set the specified level on the underlying logger.

Note: This is present in newer Python versions but since it's missing from 2.7, we replicate it here.