Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Bug 829941 - Add PROCESS-CRASH as a mozlog log level; r=ahal
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Morley committed Jan 14, 2013
1 parent f5cb4c1 commit 137cf86
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mozlog/mozlog/logger.py
Expand Up @@ -18,12 +18,14 @@
PASS = _default_level + 3
KNOWN_FAIL = _default_level + 4
FAIL = _default_level + 5
CRASH = _default_level + 6
# Define associated text of log levels
addLevelName(START, 'TEST-START')
addLevelName(END, 'TEST-END')
addLevelName(PASS, 'TEST-PASS')
addLevelName(KNOWN_FAIL, 'TEST-KNOWN-FAIL')
addLevelName(FAIL, 'TEST-UNEXPECTED-FAIL')
addLevelName(CRASH, 'PROCESS-CRASH')

class MozLogger(_LoggerClass):
"""
Expand All @@ -50,6 +52,10 @@ def testKnownFail(self, message, *args, **kwargs):
"""Logs a test known fail message"""
self.log(KNOWN_FAIL, message, *args, **kwargs)

def processCrash(self, message, *args, **kwargs):
"""Logs a process crash message"""
self.log(CRASH, message, *args, **kwargs)

class _MozFormatter(Formatter):
"""
MozFormatter class used to standardize formatting
Expand Down

0 comments on commit 137cf86

Please sign in to comment.