LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | List of all members
lsst.sconsUtils.utils.Log Class Reference

A dead-simple logger for all messages. More...

Inheritance diagram for lsst.sconsUtils.utils.Log:

Public Member Functions

def __init__
 
def info
 
def warn
 
def fail
 
def flush
 

Public Attributes

 traceback
 
 verbose
 

Detailed Description

A dead-simple logger for all messages.

This simply centralizes decisions about whether to throw exceptions or print user-friendly messages (the traceback variable) and whether to print extra debug info (the verbose variable). These are set from command-line options in state.py.

Definition at line 20 of file utils.py.

Constructor & Destructor Documentation

def lsst.sconsUtils.utils.Log.__init__ (   self)

Definition at line 22 of file utils.py.

22 
23  def __init__(self):
24  self.traceback = False
25  self.verbose = True

Member Function Documentation

def lsst.sconsUtils.utils.Log.fail (   self,
  message 
)

Definition at line 36 of file utils.py.

36 
37  def fail(self, message):
38  if self.traceback:
39  raise RuntimeError(message)
40  else:
41  if message:
42  print(message, file=sys.stderr)
43  SCons.Script.Exit(1)
def lsst.sconsUtils.utils.Log.flush (   self)

Definition at line 44 of file utils.py.

44 
45  def flush(self):
46  sys.stderr.flush()
def lsst.sconsUtils.utils.Log.info (   self,
  message 
)

Definition at line 26 of file utils.py.

26 
27  def info(self, message):
28  if self.verbose:
29  print(message)
def lsst.sconsUtils.utils.Log.warn (   self,
  message 
)

Definition at line 30 of file utils.py.

30 
31  def warn(self, message):
32  if self.traceback:
33  warnings.warn(message, stacklevel=2)
34  else:
35  print(message, file=sys.stderr)

Member Data Documentation

lsst.sconsUtils.utils.Log.traceback

Definition at line 23 of file utils.py.

lsst.sconsUtils.utils.Log.verbose

Definition at line 24 of file utils.py.


The documentation for this class was generated from the following file: