-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscream.py
52 lines (35 loc) · 1.03 KB
/
scream.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
46
47
48
49
50
51
52
import sys
import logging
import logging.handlers
import logging.config
import datetime
DISABLE__STD = False
logging.config.fileConfig('logging.conf')
logger = logging.getLogger(__name__)
intelliTag_verbose = False
def log(s):
if intelliTag_verbose:
logger.info(str(s))
def say(s):
if intelliTag_verbose:
print str(s)
def ssay(s):
if intelliTag_verbose:
print str(datetime.datetime.now()) + ': ' + str(s)
logger.info(s)
def log_error(s):
if intelliTag_verbose:
print str(datetime.datetime.now()) + ': ' + str(s)
logger.error(s)
def log_warning(s):
if intelliTag_verbose:
print str(datetime.datetime.now()) + ': ' + str(s)
logger.warning(s)
def log_debug(s):
if intelliTag_verbose:
print str(datetime.datetime.now()) + ': ' + str(s)
logger.debug(s)
def std_write(s):
if (intelliTag_verbose) and (not DISABLE__STD):
sys.stdout.write(str(s))
sys.stdout.flush()