Helper class for using logging as trace file object
This commit is contained in:
		
							
								
								
									
										16
									
								
								Lib/ldap/logger.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								Lib/ldap/logger.py
									
									
									
									
									
										Normal 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)
 | 
			
		||||
		Reference in New Issue
	
	Block a user