jackyfkc.github.io

教土豆学计算机

logging

Anatomy

Critical Data Structures

Global States

root = RootLogger(WARNING)
Logger.root = root
Logger.manager = Manager(Logger.root)


def getLogger(name=None):
    """
    Return a logger with the specified name, creating it if necessary.

    If no name is specified, return the root logger.
    """
    if name:
        return Logger.manager.getLogger(name)
    else:
        return root