Skip to content

Commit

Permalink
better log support
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Sep 24, 2015
1 parent 6c9d396 commit dc5efc5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/admin_scripts/extra/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,19 @@

import sys

USE_STDERR = False

USE_STDERR = True
FLUSH_STREAM = True
STDOUT = sys.stdout
STDERR = sys.stderr if USE_STDERR else STDOUT

def echo(message):
STDOUT.write(message + "\n")
STDOUT.flush()

def warn(message):
STDERR.write("WARNING: " + message + "\n")
STDERR.flush()

def error(message):
STDERR.write("ERROR: " + message + "\n")
STDERR.flush()

0 comments on commit dc5efc5

Please sign in to comment.