Helper class for using logging as trace file object

This commit is contained in:
stroeder 2011-03-21 14:19:43 +00:00
parent 37f50da0ef
commit 110aa5bd1d
1 changed files with 16 additions and 0 deletions

16
Lib/ldap/logger.py Normal file
View File

@ -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)