]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/log.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / distutils / log.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/log.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/log.py
deleted file mode 100644 (file)
index ff3b2fa..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-"""A simple log mechanism styled after PEP 282."""\r
-\r
-# The class here is styled after PEP 282 so that it could later be\r
-# replaced with a standard Python logging implementation.\r
-\r
-DEBUG = 1\r
-INFO = 2\r
-WARN = 3\r
-ERROR = 4\r
-FATAL = 5\r
-\r
-import sys\r
-\r
-class Log:\r
-\r
-    def __init__(self, threshold=WARN):\r
-        self.threshold = threshold\r
-\r
-    def _log(self, level, msg, args):\r
-        if level not in (DEBUG, INFO, WARN, ERROR, FATAL):\r
-            raise ValueError('%s wrong log level' % str(level))\r
-\r
-        if level >= self.threshold:\r
-            if args:\r
-                msg = msg % args\r
-            if level in (WARN, ERROR, FATAL):\r
-                stream = sys.stderr\r
-            else:\r
-                stream = sys.stdout\r
-            stream.write('%s\n' % msg)\r
-            stream.flush()\r
-\r
-    def log(self, level, msg, *args):\r
-        self._log(level, msg, args)\r
-\r
-    def debug(self, msg, *args):\r
-        self._log(DEBUG, msg, args)\r
-\r
-    def info(self, msg, *args):\r
-        self._log(INFO, msg, args)\r
-\r
-    def warn(self, msg, *args):\r
-        self._log(WARN, msg, args)\r
-\r
-    def error(self, msg, *args):\r
-        self._log(ERROR, msg, args)\r
-\r
-    def fatal(self, msg, *args):\r
-        self._log(FATAL, msg, args)\r
-\r
-_global_log = Log()\r
-log = _global_log.log\r
-debug = _global_log.debug\r
-info = _global_log.info\r
-warn = _global_log.warn\r
-error = _global_log.error\r
-fatal = _global_log.fatal\r
-\r
-def set_threshold(level):\r
-    # return the old threshold for use from tests\r
-    old = _global_log.threshold\r
-    _global_log.threshold = level\r
-    return old\r
-\r
-def set_verbosity(v):\r
-    if v <= 0:\r
-        set_threshold(WARN)\r
-    elif v == 1:\r
-        set_threshold(INFO)\r
-    elif v >= 2:\r
-        set_threshold(DEBUG)\r