From 378127c4eb6d68203132fe086c719439791973d9 Mon Sep 17 00:00:00 2001 From: boyska Date: Tue, 15 Apr 2014 01:20:24 +0200 Subject: [PATCH] logging to stdout (as required by 12factors) --- server/cli.py | 5 ++++- server/techrec.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/server/cli.py b/server/cli.py index 8ed764b..13e6545 100644 --- a/server/cli.py +++ b/server/cli.py @@ -3,7 +3,10 @@ import sys from argparse import ArgumentParser, Action from datetime import datetime import logging +logging.basicConfig(stream=sys.stdout) logger = logging.getLogger('cli') + + CWD = os.getcwd() import forge @@ -76,7 +79,7 @@ def common_pre(): for check in prechecks: for warn in check(): - logging.warn(warn) + logger.warn(warn) if __name__ == "__main__": parser = ArgumentParser(description='creates mp3 from live recordings') diff --git a/server/techrec.py b/server/techrec.py index 5fa650e..b05b740 100644 --- a/server/techrec.py +++ b/server/techrec.py @@ -115,12 +115,12 @@ class RecDB: s = self.get_session() s.delete(_rlist[0]) - logging.info("DB: Delete: delete complete") + self.log.info("Delete: delete complete") s.commit() return True def commit(self): - logging.info("DB: Commit!!") + self.log.info("Commit!!") self.session.commit() def get_session(self, rec=None):