#!/usr/bin/python
# -*- coding: latin-1 -*-

import sys, logMgr

def demo():
    """
    arg 1 is generally 0, for multiple log functions use the return value of logMgr.openSystemLog()
        e.g.:
        tok=logMgr.openSystemLog()
        logMgr.addLogRecord(tok, ...)
        logMgr.addLogRecord(tok, ...)
        severity = logMgr.getLogSeverity(tok)
        logMgr.closeSystemLog(tok)
    """
    severity = logMgr.getLogSeverity(0)
    if severity == logMgr.CRITICAL:
        print "Log severity level is CRITICAL (%d)" % severity
    elif severity == logMgr.ERROR:
        print "Log severity level is ERROR (%d)" % severity
    elif severity == logMgr.WARNING:
        print "Log severity level is WARNING (%d)" % severity
    elif severity == logMgr.INFO:
        print "Log severity level is INFO (%d)" % severity
    elif severity == logMgr.DEBUG:
        print "Log severity level is DEBUG (%d)" % severity
    elif severity == logMgr.NOTSET:
        print "Log severity level is NOTSET (%d)" % severity
    else:
        print "Invalid log severity level: %d" % severity
    return severity

if __name__ == '__main__':
    sys.exit(demo())
