Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log the timestamp (date+time) when logging starts #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion q.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,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)
skorokithakis marked this conversation as resolved.
Show resolved Hide resolved
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