logging to stdout (as required by 12factors)
This commit is contained in:
parent
c0de3679a4
commit
378127c4eb
2 changed files with 6 additions and 3 deletions
|
@ -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')
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue