Skip to content

Commit

Permalink
Log the timestamp (date+time) when logging starts
Browse files Browse the repository at this point in the history
  • Loading branch information
xsteve committed Jun 10, 2016
1 parent 85d8ea9 commit 674ad7b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion q.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,17 @@ def add(self, items, sep='', wrap=True):
self.column += size

def __init__(self):
self.writer = self.Writer(self.FileWriter(self.OUTPUT_PATH), self.time)
time = self.time
self.writer = self.Writer(self.FileWriter(self.OUTPUT_PATH), time)
self.indent = 0
# in_console tracks whether we're in an interactive console.
# We use it to display the caller as "<console>" instead of "<module>".
self.in_console = False
startup_msg = time.strftime("\nLogging started at: %c",
time.localtime(time.time()))
if self.writer.color:
startup_msg = self.writer.YELLOW + startup_msg + self.writer.NORMAL
self.writer.file_writer.write('a', startup_msg)

def unindent(self, lines):
"""Removes any indentation that is common to all of the given lines."""
Expand Down

0 comments on commit 674ad7b

Please sign in to comment.