Пример #1
0
  def test_07fatal(self):
    """
    Create Fatal log and test it
    """
    gLogger.fatal("message")
    oldgLogger.fatal("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFrameworkFATAL:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    self.log.fatal("message")
    self.oldlog.fatal("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFramework/logFATAL:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #2
0
  def test_08exception(self):
    """
    Create Exception log and test it
    Differences between the two systems :
    - gLogger: Traceback ...
    - old gLogger: === Exception === ...
    """
    try:
      badIdea = 1 / 0
      print badIdea
    except ZeroDivisionError:
      gLogger.exception("message")
      oldgLogger.exception("message")

      logstring1 = cleaningLog(self.buffer.getvalue())
      logstring2 = cleaningLog(self.oldbuffer.getvalue())

      self.assertNotEqual(logstring1, logstring2)
      self.buffer.truncate(0)
      self.oldbuffer.truncate(0)

      self.log.exception("message")
      self.oldlog.exception("message")

      logstring1 = cleaningLog(self.buffer.getvalue())
      logstring2 = cleaningLog(self.oldbuffer.getvalue())

      self.assertNotEqual(logstring1, logstring2)
      self.buffer.truncate(0)
      self.oldbuffer.truncate(0)
Пример #3
0
  def test_06error(self):
    """
    Create Error log and test it
    """
    gLogger.error("message")
    oldgLogger.error("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFrameworkERROR:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    self.log.error("message")
    self.oldlog.error("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFramework/logERROR:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #4
0
  def test_05warn(self):
    """
    Create Warn log and test it
    """
    gLogger.warn("message")
    oldgLogger.warn("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFrameworkWARN:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    self.log.warn("message")
    self.oldlog.warn("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFramework/logWARN:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #5
0
  def test_04debug(self):
    """
    Create Debug log and test it
    """
    gLogger.debug("message")
    oldgLogger.debug("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFrameworkDEBUG:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    self.log.debug("message")
    self.oldlog.debug("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFramework/logDEBUG:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #6
0
  def test_00always(self):
    """
    Create Always log and test it
    """
    gLogger.always("message")
    oldgLogger.always("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFrameworkALWAYS:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    self.log.always("message")
    self.oldlog.always("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFramework/logALWAYS:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #7
0
  def test_02info(self):
    """
    Create Info log and test it
    """
    gLogger.info("message")
    oldgLogger.info("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFrameworkINFO:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    self.log.info("message")
    self.oldlog.info("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFramework/logINFO:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
  def test_01displayLogs(self):
    """
    Test the display of the logs according to the value of the boolean in the method.
    """
    # Enabled
    gLogger.enableLogsFromExternalLibs()

    # modify the output to capture logs of the root logger
    bufferRoot = StringIO()
    logging.getLogger().handlers[0].stream = bufferRoot

    logging.getLogger().info("message")
    logstring1 = cleaningLog(bufferRoot.getvalue())

    self.assertEqual("UTCExternalLibrary/rootINFO:message\n", logstring1)
    bufferRoot.truncate(0)

    # this is a direct child of root, as the logger in DIRAC
    logging.getLogger("sublog").info("message")
    logstring1 = cleaningLog(bufferRoot.getvalue())

    self.assertEqual("UTCExternalLibrary/sublogINFO:message\n", logstring1)
    bufferRoot.truncate(0)

    # Disabled
    gLogger.disableLogsFromExternalLibs()

    logging.getLogger().info("message")
    # this is a direct child of root, as the logger in DIRAC
    logging.getLogger("sublog").info("message")

    self.assertEqual("", bufferRoot.getvalue())
Пример #9
0
  def test_00setShowHeaders(self):
    """
    Set the headers
    """
    gLogger.showHeaders(False)
    gLogger.notice('message')

    oldgLogger.showHeaders(False)
    oldgLogger.notice('message')

    self.assertEqual("message \n", self.buffer.getvalue())
    self.assertEqual(self.buffer.getvalue().replace(" ", ""), self.oldbuffer.getvalue().replace(" ", ""))
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    gLogger.showHeaders(True)
    gLogger.notice('message')

    oldgLogger.showHeaders(True)
    oldgLogger.notice('message')

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFrameworkNOTICE:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #10
0
  def test_01setShowThreadIDs(self):
    """
    Set the thread ID
    Differences between the two systems :
    - gLogger: threadID [1254868214]
    - old gLogger: threadID [GEko]
    """
    gLogger.showThreadIDs(False)
    gLogger.notice('message')

    oldgLogger.showThreadIDs(False)
    oldgLogger.notice('message')

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFrameworkNOTICE:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    gLogger.showThreadIDs(True)
    gLogger.notice('message')

    oldgLogger.showThreadIDs(True)
    oldgLogger.notice('message')

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertIn(str(thread.get_ident()), logstring1)
    self.assertNotEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #11
0
    def test_01displayLogs(self):
        """
    Test the display of the logs according to the value of the boolean in the method.
    """
        # Enabled
        gLogger.enableLogsFromExternalLibs()

        # modify the output to capture logs of the root logger
        bufferRoot = StringIO()
        logging.getLogger().handlers[0].stream = bufferRoot

        logging.getLogger().info("message")
        logstring1 = cleaningLog(bufferRoot.getvalue())

        self.assertEqual("UTCExternalLibrary/rootINFO:message\n", logstring1)
        bufferRoot.truncate(0)

        # this is a direct child of root, as the logger in DIRAC
        logging.getLogger("sublog").info("message")
        logstring1 = cleaningLog(bufferRoot.getvalue())

        self.assertEqual("UTCExternalLibrary/sublogINFO:message\n", logstring1)
        bufferRoot.truncate(0)

        # Disabled
        gLogger.disableLogsFromExternalLibs()

        logging.getLogger().info("message")
        # this is a direct child of root, as the logger in DIRAC
        logging.getLogger("sublog").info("message")

        self.assertEqual("", bufferRoot.getvalue())
Пример #12
0
  def test_01notice(self):
    """
    Create Notice log and test it
    """
    gLogger.notice("message")
    oldgLogger.notice("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFrameworkNOTICE:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    self.log.notice("message")
    self.oldlog.notice("message")

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFramework/logNOTICE:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #13
0
  def test_01setShowThreadIDs(self):
    """
    Set the thread ID
    Differences between the two systems :
    - gLogger: threadID [1254868214]
    - old gLogger: threadID [GEko]
    """
    gLogger.showThreadIDs(False)
    gLogger.notice('message')

    oldgLogger.showThreadIDs(False)
    oldgLogger.notice('message')

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFrameworkNOTICE:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    gLogger.showThreadIDs(True)
    gLogger.notice('message')

    oldgLogger.showThreadIDs(True)
    oldgLogger.notice('message')

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertIn(str(thread.get_ident()), logstring1)
    self.assertNotEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #14
0
  def test_00setShowHeaders(self):
    """
    Set the headers
    """
    gLogger.showHeaders(False)
    gLogger.notice('message', 'varmessage')

    oldgLogger.showHeaders(False)
    oldgLogger.notice('message', 'varmessage')

    self.assertEqual("message varmessage\n", self.buffer.getvalue())
    self.assertEqual(self.buffer.getvalue(), self.oldbuffer.getvalue())
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    gLogger.showHeaders(True)
    gLogger.notice('message')

    oldgLogger.showHeaders(True)
    oldgLogger.notice('message')

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFrameworkNOTICE:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #15
0
  def test_14showStack(self):
    """
    Get the showStack
    """
    gLogger.showStack()
    oldgLogger.showStack()

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual(logstring1, "UTCFrameworkDEBUG:\n")
    self.assertEqual(logstring2, "UTCFrameworkDEBUG:\n")
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #16
0
  def test_11WithVarMsg(self):
    """
    Create Always log with variable message and test it
    """
    self.log.always("mess", "age")
    logstring1 = cleaningLog(self.buffer.getvalue())

    self.assertEqual(logstring1, "UTCFramework/logALWAYS:message\n")
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #17
0
  def test_09WithExtrasArgs(self):
    """
    Create Always log with extra arguments and test it
    """
    self.log.always('%s.' % "message")
    logstring1 = cleaningLog(self.buffer.getvalue())

    self.assertEqual(logstring1, "UTCFramework/logALWAYS:message.\n")
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #18
0
  def test_03verbose(self):
    """
    Create Verbose log and test it
    Differences between the two systems :
    - gLogger: VERBOSE
    - old gLogger: VERB
    """
    gLogger.verbose("message")

    logstring1 = cleaningLog(self.buffer.getvalue())

    self.assertEqual("UTCFrameworkVERBOSE:message\n", logstring1)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    self.log.verbose("message")

    logstring1 = cleaningLog(self.buffer.getvalue())

    self.assertEqual("UTCFramework/logVERBOSE:message\n", logstring1)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #19
0
  def test_10onMultipleLines(self):
    """
    Create Always log on multiple lines and test it
    Differences between the two systems :
    - gLogger: ALWAYS: this
               ALWAYS: is
    - old gLogger: ALWAYS: this
                   is
    """
    self.log.always('this\nis\na\nmessage\non\nmultiple\nlines.')
    logstring1 = cleaningLog(self.buffer.getvalue())

    self.assertEqual(logstring1, "UTCFramework/logALWAYS:this\nis\na\nmessage\non\nmultiple\nlines.\n")
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #20
0
  def test_03setSubLogShowHeaders(self):
    """
    Create a sublogger and set it its own Header option.
    """
    sublog = gLogger.getSubLogger('sublog')
    sublog.setLevel('notice')
    sublog.showHeaders(False)
    sublog.registerBackend('file', {'FileName': self.filename})
    # Empty the buffer to remove the Object Loader log message "trying to load..."
    self.buffer.truncate(0)

    sublog.notice("message")
    with open(self.filename) as file:
      message = file.read()

    self.assertEqual(message, "message\n")
    logstring1 = cleaningLog(self.buffer.getvalue())
    self.assertEqual(logstring1, "UTCFramework/sublogNOTICE:message\n")
Пример #21
0
  def test_03setSubLogShowHeaders(self):
    """
    Create a sublogger and set it its own Header option.
    """
    sublog = gLogger.getSubLogger('sublog')
    sublog.setLevel('notice')
    sublog.showHeaders(False)
    sublog.registerBackend('file', {'FileName': self.filename})
    # Empty the buffer to remove the Object Loader log message "trying to load..."
    self.buffer.truncate(0)

    sublog.notice("message")
    with open(self.filename) as file:
      message = file.read()

    self.assertEqual(message, "message \n")
    logstring1 = cleaningLog(self.buffer.getvalue())
    self.assertEqual(logstring1, "UTCFramework/sublogNOTICE:message\n")
Пример #22
0
  def test_06setSubLoggLoggerShowHeadersInverse(self):
    """
    Create a sublogger, set the Header option of the gLogger and its Header option. 
    Show that the gLogger Header option do not follow the change of its child Header option.
    """
    sublog = gLogger.getSubLogger('sublog4')
    sublog.setLevel('notice')
    sublog.registerBackend('file', {'FileName': self.filename})
    # Empty the buffer to remove the Object Loader log message "trying to load..."
    self.buffer.truncate(0)
    gLogger.showHeaders(True)
    sublog.showHeaders(False)

    sublog.notice("message")
    with open(self.filename) as file:
      message = file.read()

    self.assertEqual(message, "message \n")
    logstring1 = cleaningLog(self.buffer.getvalue())
    self.assertEqual(logstring1, "UTCFramework/sublog4NOTICE:message\n")
Пример #23
0
  def test_06setSubLoggLoggerShowHeadersInverse(self):
    """
    Create a sublogger, set the Header option of the gLogger and its Header option. 
    Show that the gLogger Header option do not follow the change of its child Header option.
    """
    sublog = gLogger.getSubLogger('sublog4')
    sublog.setLevel('notice')
    sublog.registerBackend('file', {'FileName': self.filename})
    # Empty the buffer to remove the Object Loader log message "trying to load..."
    self.buffer.truncate(0)
    gLogger.showHeaders(True)
    sublog.showHeaders(False)

    sublog.notice("message")
    with open(self.filename) as file:
      message = file.read()

    self.assertEqual(message, "message\n")
    logstring1 = cleaningLog(self.buffer.getvalue())
    self.assertEqual(logstring1, "UTCFramework/sublog4NOTICE:message\n")
Пример #24
0
  def test_09subLogShowHeadersChangeSetSubLogger(self):
    """
    Create a subsublogger and set its Header option and show that 
    its Header option do not follow the change of its parent Header option.
    """
    sublog = gLogger.getSubLogger('sublog7')
    sublog.setLevel('notice')
    sublog.registerBackend('file', {'FileName': self.filename})
    # Empty the buffer to remove the Object Loader log message "trying to load..."
    self.buffer.truncate(0)
    subsublog = sublog.getSubLogger('subsublog')
    subsublog.registerBackends(['file'], {'FileName': self.filename})
    # Empty the buffer to remove the Object Loader log message "trying to load..."
    self.buffer.truncate(0)
    sublog.showHeaders(False)
    subsublog.showHeaders(True)

    subsublog.notice("message")
    with open(self.filename) as file:
      message = file.read()

    self.assertIn("UTC Framework/sublog7/subsublog NOTICE: message \nmessage \n", message)
    logstring1 = cleaningLog(self.buffer.getvalue())
    self.assertEqual(logstring1, "UTCFramework/sublog7/subsublogNOTICE:message\n")
Пример #25
0
  def test_09subLogShowHeadersChangeSetSubLogger(self):
    """
    Create a subsublogger and set its Header option and show that 
    its Header option do not follow the change of its parent Header option.
    """
    sublog = gLogger.getSubLogger('sublog7')
    sublog.setLevel('notice')
    sublog.registerBackend('file', {'FileName': self.filename})
    # Empty the buffer to remove the Object Loader log message "trying to load..."
    self.buffer.truncate(0)
    subsublog = sublog.getSubLogger('subsublog')
    subsublog.registerBackends(['file'], {'FileName': self.filename})
    # Empty the buffer to remove the Object Loader log message "trying to load..."
    self.buffer.truncate(0)
    sublog.showHeaders(False)
    subsublog.showHeaders(True)

    subsublog.notice("message")
    with open(self.filename) as file:
      message = file.read()

    self.assertIn("UTC Framework/sublog7/subsublog NOTICE: message\nmessage\n", message)
    logstring1 = cleaningLog(self.buffer.getvalue())
    self.assertEqual(logstring1, "UTCFramework/sublog7/subsublogNOTICE:message\n")
Пример #26
0
  def test_02setShowThreadIDsHeaders(self):
    """
    Create a subsubsublogger and create a logrecord
    """
    gLogger.showHeaders(False)
    gLogger.showThreadIDs(False)
    gLogger.notice('message')

    oldgLogger.showHeaders(False)
    oldgLogger.showThreadIDs(False)
    oldgLogger.notice('message')

    self.assertEqual("message \n", self.buffer.getvalue())
    self.assertEqual(self.buffer.getvalue().replace(" ", ""), self.oldbuffer.getvalue().replace(" ", ""))
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    gLogger.showHeaders(False)
    gLogger.showThreadIDs(True)
    gLogger.notice('message')

    oldgLogger.showHeaders(False)
    oldgLogger.showThreadIDs(True)
    oldgLogger.notice('message')

    self.assertEqual("message \n", self.buffer.getvalue())
    self.assertEqual(self.buffer.getvalue().replace(" ", ""), self.oldbuffer.getvalue().replace(" ", ""))
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    gLogger.showHeaders(True)
    gLogger.showThreadIDs(False)
    gLogger.notice('message')

    oldgLogger.showHeaders(True)
    oldgLogger.showThreadIDs(False)
    oldgLogger.notice('message')

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFrameworkNOTICE:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    gLogger.showHeaders(True)
    gLogger.showThreadIDs(True)
    gLogger.notice('message')

    oldgLogger.showHeaders(True)
    oldgLogger.showThreadIDs(True)
    oldgLogger.notice('message')

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertIn(str(thread.get_ident()), logstring1)
    self.assertNotEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)
Пример #27
0
  def test_02setShowThreadIDsHeaders(self):
    """
    Create a subsubsublogger and create a logrecord
    """
    gLogger.showHeaders(False)
    gLogger.showThreadIDs(False)
    gLogger.notice('message')

    oldgLogger.showHeaders(False)
    oldgLogger.showThreadIDs(False)
    oldgLogger.notice('message')

    self.assertEqual("message\n", self.buffer.getvalue())
    self.assertEqual(self.buffer.getvalue(), self.oldbuffer.getvalue())
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    gLogger.showHeaders(False)
    gLogger.showThreadIDs(True)
    gLogger.notice('message')

    oldgLogger.showHeaders(False)
    oldgLogger.showThreadIDs(True)
    oldgLogger.notice('message')

    self.assertEqual("message\n", self.buffer.getvalue())
    self.assertEqual(self.buffer.getvalue(), self.oldbuffer.getvalue())
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    gLogger.showHeaders(True)
    gLogger.showThreadIDs(False)
    gLogger.notice('message')

    oldgLogger.showHeaders(True)
    oldgLogger.showThreadIDs(False)
    oldgLogger.notice('message')

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertEqual("UTCFrameworkNOTICE:message\n", logstring1)
    self.assertEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)

    gLogger.showHeaders(True)
    gLogger.showThreadIDs(True)
    gLogger.notice('message')

    oldgLogger.showHeaders(True)
    oldgLogger.showThreadIDs(True)
    oldgLogger.notice('message')

    logstring1 = cleaningLog(self.buffer.getvalue())
    logstring2 = cleaningLog(self.oldbuffer.getvalue())

    self.assertIn(str(thread.get_ident()), logstring1)
    self.assertNotEqual(logstring1, logstring2)
    self.buffer.truncate(0)
    self.oldbuffer.truncate(0)