forked from JeffCurless/argoneon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathargonlogging.py
executable file
·46 lines (40 loc) · 977 Bytes
/
argonlogging.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import logging
LOGGING_FILE ='/var/log/argoneon.log'
FORMAT_STRING='%(asctime)s %(process)d [%(levelname)s] %(message)s'
DATE_FORMAT='%b %d %y %H:%M:%S'
#
#
#
def enableLogging( enableDebug : bool = False ):
if enableDebug:
logging.basicConfig( filename=LOGGING_FILE,
filemode='a',
level=logging.DEBUG,
format=FORMAT_STRING,
datefmt=DATE_FORMAT)
else:
logging.basicConfig( filename=LOGGING_FILE,
filemode='a',
level=logging.INFO,
format=FORMAT_STRING,
datefmt=DATE_FORMAT)
#
#
#
def logDebug( message ):
logging.debug( message )
#
#
#
def logInfo( message ):
logging.info( message )
#
#
#
def logWarning( message ):
logging.warning( message )
#
#
#
def logError( message ):
logging.error( message )