-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgraa_logger.py
More file actions
23 lines (19 loc) · 753 Bytes
/
graa_logger.py
File metadata and controls
23 lines (19 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""
The logger class.
Handles the different log outputs.
"""
import sys
from graa_session import GraaSession as session
class GraaLogger():
beat_outfile = open("beat_out", "a")
#leap_outfile = open("leap_out", "a")
action_outfile = open("action_out", "a")
shell_outfile = sys.stdout
def shell(msg):
print(msg, file=GraaLogger.shell_outfile, flush=True)
def beat(msg):
print("@{}: ".format(session.now) + msg, file=GraaLogger.beat_outfile, flush=True)
def action(msg):
print("@{}: ".format(session.now) + msg, file=GraaLogger.action_outfile, flush=True)
#def leap(arg1, arg2, arg3):
# print("LAST: {} NOW: {} LEAP: {}".format(arg1, arg2, arg3), file=GraaLogger.leap_outfile, flush=True)