-
Notifications
You must be signed in to change notification settings - Fork 1
/
screenlog.py
executable file
·51 lines (36 loc) · 1.09 KB
/
screenlog.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
#!/usr/bin/python
# coding: utf-8
"""
Thin timesink clone.
TODO
====
screenshot resize
store path to screenshot in db
analyze
"""
import sys
import logging
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from actionlogger import ActionLogger
if __name__ == "__main__":
''' write test info in default db for ActionLogger '''
parser = ArgumentParser(prog=sys.argv[0], formatter_class=ArgumentDefaultsHelpFormatter)
parser.add_argument('--dbname',
action='store',
default='logger.db',
help="sqlite3 DB to use")
parser.add_argument('--prefix',
default='i_did_',
help="Prefix for screenshots")
parser.add_argument('--logfile',
action='store',
default='screen.log',
help="Log file name")
args = parser.parse_args(sys.argv[1:])
act_logger = ActionLogger(args.dbname, args.prefix)
logging.basicConfig(filename=args.logfile,
filemode='a',
format='[%(asctime)s][%(levelname)s] %(message)s',
datefmt='%Y/%m/%d %H:%M:%S',
level=logging.DEBUG)
act_logger.proceed()