From c1dadc51bafbef49f4c3189fe6afb83d42fd5f95 Mon Sep 17 00:00:00 2001 From: Alec Warner Date: Tue, 23 Oct 2007 07:49:22 +0000 Subject: [PATCH] add quickie logger function svn path=/main/trunk/; revision=8251 --- pym/portage/util.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- 2.26.2