From 110aa5bd1dbb5687a0d9d14df85b13f384695749 Mon Sep 17 00:00:00 2001 From: stroeder Date: Mon, 21 Mar 2011 14:19:43 +0000 Subject: [PATCH] Helper class for using logging as trace file object --- Lib/ldap/logger.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Lib/ldap/logger.py diff --git a/Lib/ldap/logger.py b/Lib/ldap/logger.py new file mode 100644 index 0000000..a6083dc --- /dev/null +++ b/Lib/ldap/logger.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +""" +Helper class for using logging as trace file object +""" + +import logging + +class logging_file_class: + + def __init__(self,logging_level): + self._logging_level = logging_level + + def write(self,msg): + logging.log(self._logging_level,msg[:-1]) + +logging_file_obj = logging_file_class(logging.DEBUG)