test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
ztee Namespace Reference

Classes

class  GZipLog
 

Functions

def capture
 
def log
 

Variables

tuple args = parser.parse_args()
 
tuple fd = sys.stdout.fileno()
 
tuple parser = argparse.ArgumentParser(description="Take all input and write a compressed log file.")
 

Function Documentation

def ztee.capture (   fd,
  args 
)

Definition at line 94 of file ztee.py.

Referenced by HadronPhysicsQGSPCMS_FTFP_BERT.ConstructProcess().

94 
95 def capture(fd, args):
96  log_handler = GZipLog(log_file=args.log)
97 
98  def sigusr1_handle(*kargs, **kwargs):
99  log_handler._sigusr_interrupt = True
100  if log_handler.file:
101  log_handler.flush_block()
102 
103  signal.signal(signal.SIGUSR1, sigusr1_handle)
104 
105  try:
106  while True:
107  try:
108  log_handler._sigusr_interrupt = False
109  rlist, wlist, xlist = select.select([fd], [], [], 5)
110  except select.error as e:
111  if e[0] != errno.EINTR: raise
112  if not log_handler._sigusr_interrupt: raise
113 
114  continue
115 
116  if not rlist:
117  log_handler.handle_timeout()
118  continue
119 
120  bytes = os.read(fd, 4096)
121  if (bytes == ''):
122  break
123 
124  log_handler.write(bytes)
125  if not args.q:
126  sys.stdout.write(bytes)
127  finally:
128  log_handler.finish()
def capture
Definition: ztee.py:94
def ztee.log (   s)

Definition at line 9 of file ztee.py.

9 
10 def log(s):
11  sys.stderr.write("m: " + s + "\n");
12  sys.stderr.flush()
def log
Definition: ztee.py:9

Variable Documentation

tuple ztee.args = parser.parse_args()

Definition at line 133 of file ztee.py.

tuple ztee.fd = sys.stdout.fileno()

Definition at line 136 of file ztee.py.

Referenced by hcaldqm::DQTask._getCalibType(), File.abort(), addFilesWithFork(), METAnalyzer.analyze(), File.attach(), File.close(), ExternalLHEProducer.closeDescriptors(), CosmicGenFilterHelix.createHistsEnd(), CosmicGenFilterHelix.createHistsStart(), File.duplicate(), File.File(), File.flush(), WatcherStreamFileReader.getInputFile(), LocalCacheFile.LocalCacheFile(), spu.md5_File(), File.open(), File.position(), File.prefetch(), TShapeAnalysis.printshapeData(), RawDataUnpacker.ProcessVFATDataParallel(), File.read(), ExternalLHEProducer.readOutput(), gen::Py8InterfaceBase.readSettings(), File.resize(), File.size(), and File.write().

tuple ztee.parser = argparse.ArgumentParser(description="Take all input and write a compressed log file.")

Definition at line 130 of file ztee.py.