API Documentation¶
A basic extended attributes (xattr) implementation for Linux and MacOS X
logging facilities
The way to use this is as follows:
each module declares its own logger, using:
from .logger import create_logger logger = create_logger()
then each module uses logger.info/warning/debug/etc according to the level it believes is appropriate:
logger.debug(‘debugging info for developers or power users’) logger.info(‘normal, informational output’) logger.warning(‘warn about a non-fatal error or sth else’) logger.error(‘a fatal error’)
... and so on. see the logging documentation for more information
console interaction happens on stderr, that includes interactive reporting functions like help, info and list
...except
input()
is special, because we can’t control the stream it is using, unfortunately. we assume that it won’t clutter stdout, because interaction would be broken then anywayswhat is output on INFO level is additionally controlled by commandline flags
-
borg.logger.
create_logger
(name=None)[source]¶ create a Logger object with the proper path, which is returned by find_parent_module() by default, or is provided via the commandline
this is really a shortcut for:
logger = logging.getLogger(__name__)we use it to avoid errors and provide a more standard API.