diff --git a/bin/rdfdb b/bin/rdfdb --- a/bin/rdfdb +++ b/bin/rdfdb @@ -122,8 +122,8 @@ from light9.rdfdb.rdflibpatch import pat from light9.rdfdb import syncedgraph from twisted.internet.inotify import INotify -logging.basicConfig(level=logging.DEBUG) -log = logging.getLogger() +from run_local import log +log.setLevel(logging.DEBUG) try: import sys diff --git a/bin/run_local.py b/bin/run_local.py --- a/bin/run_local.py +++ b/bin/run_local.py @@ -17,4 +17,17 @@ def rce(self, exc, val, tb): Failure(val, exc, tb).printDetailedTraceback() Tkinter.Tk.report_callback_exception = rce +import coloredlogs, logging, time +log = logging.getLogger() + +class CSH(coloredlogs.ColoredStreamHandler): + def render_timestamp(self, created): + return time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(created)) + ( + "%.3f" % (created % 1)).lstrip('0') + + def render_name(self, name): + return name + +log.addHandler(CSH(show_hostname=False, show_name=True)) + cgitb.enable(format='txt') diff --git a/bin/subcomposer b/bin/subcomposer --- a/bin/subcomposer +++ b/bin/subcomposer @@ -8,7 +8,7 @@ import louie as dispatcher from twisted.internet import reactor, tksupport, task from rdflib import URIRef -import run_local +from run_local import log from light9.dmxchanedit import Levelbox from light9 import dmxclient, Patch, Submaster, showconfig, prof from light9.uihelpers import toplevelat @@ -16,8 +16,7 @@ from light9.rdfdb.syncedgraph import Syn from light9.rdfdb import clientsession from light9.tkdnd import initTkdnd, dragSourceRegister, dropTargetRegister -logging.basicConfig(level=logging.DEBUG) -log = logging.getLogger() +log.setLevel(logging.DEBUG) class _NoNewVal(object): pass diff --git a/pydeps b/pydeps --- a/pydeps +++ b/pydeps @@ -9,4 +9,6 @@ restkit==4.2.1 ipython==0.13.2 nose==1.3.0 nose-alert==0.9.0 -ipdb==0.7 \ No newline at end of file +ipdb==0.7 +# waiting for https://github.com/xolox/python-coloredlogs/pull/1 +git+git://github.com/drewp/python-coloredlogs@9803112ddf7d4cd7dd001912ad1aa482fb8383f6