Skip to content

Commit

Permalink
Added computer prefix to windows logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonidBeynenson committed Sep 2, 2016
1 parent d2e0c60 commit 5413e63
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions windows_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def __init__(self, parent, id, title):
self.LOGON_ICON_PATH = os.path.join(self.ICONS_FOLDER, 'logon.ico')
self.LOGOFF_ICON_PATH = os.path.join(self.ICONS_FOLDER, 'logoff.ico')

self.COMPUTER_PREFIX = "P"

print "Will log into", self.LOG_FILE_PATH

self.ICON_STATE = 1
Expand Down Expand Up @@ -91,7 +93,7 @@ def MainStep(self, evt):
if not self.WAS_ACTIVE:
dt_sleep = time() - self.TIME_OF_SCREENSAVER_START
if dt_sleep > 60:
log_line_from_screensaver_work = "rest {} min??????????????????????????????".format(int(dt_sleep/60))
log_line_from_screensaver_work = "rest {} min on {} ??????????????????????????????".format(int(dt_sleep/60), self.COMPUTER_PREFIX)
self.Write("\n" + log_line_from_screensaver_work + "\n\n")
# else: #very small rest
# self.Write("\n") #is it required?
Expand All @@ -111,7 +113,7 @@ def MainStep(self, evt):
traceback.print_exc(None, None);

def WriteLog(self, text, idle_time):
log_line = '%s\t%-100s\t%f sec\n' % (self.Now(), text, float(idle_time))
log_line = '%s\t%s\t%-100s\t%f sec\n' % (self.Now(), self.COMPUTER_PREFIX, text, float(idle_time))
self.Write(log_line)

def Write(self, log_line):
Expand Down

0 comments on commit 5413e63

Please sign in to comment.