Beispiel #1
0
 def setUp(self):
     self.testFile = 'UUID_to_store'
     self.testCfgFile = 'TestPilotLogger.cfg'
     getUniqueIDAndSaveToFile(self.testFile)
     self.logger = PilotLogger(self.testCfgFile)
     self.badFile = '////'
     self.nonExistentFile = 'abrakadabraToCzaryIMagia'
Beispiel #2
0
 def __init__(self, name='Pilot', debugFlag=False, pilotOutput='pilot.out', isPilotLoggerOn=False):
   """ c'tor
   If flag PilotLoggerOn is not set, the logger will behave just like
   the original Logger object, that means it will just print logs locally on the screen
   """
   super(ExtendedLogger, self).__init__(name, debugFlag, pilotOutput)
   if isPilotLoggerOn:
     # the import here was suggest F.S cause PilotLogger imports stomp
     # which is not yet in the DIRAC externals
     # so up to now we want to turn it off
     from Pilot.PilotLogger import PilotLogger
     self.pilotLogger = PilotLogger()
   else:
     self.pilotLogger = None
   self.isPilotLoggerOn = isPilotLoggerOn
Beispiel #3
0
 def __init__(self,
              name='Pilot',
              debugFlag=False,
              pilotOutput='pilot.out',
              isPilotLoggerOn=True,
              setup='DIRAC-Certification'):
     """ c'tor
 If flag PilotLoggerOn is not set, the logger will behave just like
 the original Logger object, that means it will just print logs locally on the screen
 """
     super(ExtendedLogger, self).__init__(name, debugFlag, pilotOutput)
     if isPilotLoggerOn:
         self.pilotLogger = PilotLogger(setup=setup)
     else:
         self.pilotLogger = None
     self.isPilotLoggerOn = isPilotLoggerOn
Beispiel #4
0
 def test_DefaultCtrNonJsonFile(self):
     logger = PilotLogger()
     self.assertEqual(logger.params["LoggingType"], "LOCAL_FILE")
     self.assertEqual(logger.params["LocalOutputFile"],
                      "myLocalQueueOfMessages")
     self.assertEqual(logger.params["FileWithID"], "PilotUUID")
Beispiel #5
0
 def setUp(self):
     self.uuidFile = "PilotUUID"
     self.logger = PilotLogger()
Beispiel #6
0
 def test_DefaultCtrNonJsonFile(self):
     logger = PilotLogger()
     self.assertEqual(logger.params['LoggingType'], 'LOCAL_FILE')
     self.assertEqual(logger.params['LocalOutputFile'],
                      'myLocalQueueOfMessages')
     self.assertEqual(logger.params['FileWithID'], 'PilotUUID')
Beispiel #7
0
 def setUp(self):
     self.uuidFile = 'PilotUUID'
     self.logger = PilotLogger()