From: Alec Warner Date: Tue, 23 Oct 2007 07:49:22 +0000 (-0000) Subject: add quickie logger function X-Git-Tag: v2.2_pre1~545 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c1dadc51bafbef49f4c3189fe6afb83d42fd5f95;p=portage.git add quickie logger function svn path=/main/trunk/; revision=8251 --- diff --git a/pym/portage/util.py b/pym/portage/util.py index a7c8a954a..1e3b9cc30 100644 --- a/pym/portage/util.py +++ b/pym/portage/util.py @@ -5,6 +5,7 @@ import os import errno +import logging import shlex import stat import string @@ -22,6 +23,15 @@ except ImportError: noiselimit = 0 +def initialize_logger(level=logging.WARN): + """Sets up basic logging of portage activities + Args: + level: the level to emit messages at ('info', 'debug', 'warning' ...) + Returns: + None + """ + logging.basicConfig(level=logging.WARN, format='[%(levelname)-4s] %(message)s') + def writemsg(mystr,noiselevel=0,fd=None): """Prints out warning and debug messages based on the noiselimit setting""" global noiselimit