CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Attributes
uploads.output Class Reference

Public Member Functions

def __init__ (self, log_handle=None, verbose=False, debug=False)
 
def write (self, message="", level=INFO)
 

Public Attributes

 current_output_length
 
 labels
 

Private Attributes

 _debug
 
 _log_handle
 
 _verbose
 

Detailed Description

Definition at line 61 of file uploads.py.

Constructor & Destructor Documentation

◆ __init__()

def uploads.output.__init__ (   self,
  log_handle = None,
  verbose = False,
  debug = False 
)

Definition at line 72 of file uploads.py.

72  def __init__(self, log_handle=None, verbose=False, debug=False):
73  # first time writing progress bar, don't need to go back along the line
74  self.current_output_length = 0
75  self._verbose = verbose
76  self._log_handle = log_handle
77  self._debug = debug
78  self.labels = ["INFO", "ERROR", "WARNING", "VERBOSE", "DEBUG"]
79 

Member Function Documentation

◆ write()

def uploads.output.write (   self,
  message = "",
  level = INFO 
)
Write to the console and to the log file held by self.

Definition at line 80 of file uploads.py.

80  def write(self, message="", level=INFO):
81  """
82  Write to the console and to the log file held by self.
83  """
84  message = "[%s] %s: %s"%(datetime.now(), self.labels[level], message)
85  if self._verbose:
86  if level == output.DEBUG and self._debug:
87  print(message)
88  elif level < output.DEBUG:
89  print(message)
90  elif self._debug:
91  if level == output.DEBUG:
92  print(message)
93  elif level <= output.ERROR:
94  print(message)
95  if self._log_handle != None:
96  log(self._log_handle, message)
97 

References EcalMatacqAnalyzer._debug, EcalABAnalyzer._debug, uploads.output._debug, EcalLaserAnalyzer2._debug, EcalLaserAnalyzer._debug, uploads.output._log_handle, uploads.output._verbose, uploads.output.labels, svgfig.Ticks.labels, uploads.log(), and print().

Referenced by pkg.AbstractPkg.generate().

Member Data Documentation

◆ _debug

uploads.output._debug
private

◆ _log_handle

uploads.output._log_handle
private

Definition at line 76 of file uploads.py.

Referenced by uploads.output.write().

◆ _verbose

uploads.output._verbose
private

◆ current_output_length

uploads.output.current_output_length

Definition at line 74 of file uploads.py.

◆ labels

uploads.output.labels

Definition at line 78 of file uploads.py.

Referenced by confdb.HLTProcess.dump(), and uploads.output.write().

uploads.log
def log(file_handle, message)
Definition: uploads.py:41
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
writeEcalDQMStatus.write
write
Definition: writeEcalDQMStatus.py:48