diff --git a/config_example/config.py b/config_example/config.py index aa480e6..b12cdb5 100644 --- a/config_example/config.py +++ b/config_example/config.py @@ -1,10 +1,7 @@ #!/usr/bin/env python # -*- coding: UTF-8 -*- -import socket_protocol -import stringtools -import task -import tcp_socket +import report FULL_SCREEN = False @@ -31,11 +28,12 @@ File "%(pathname)s", line %(lineno)d, in %(funcName)s %(asctime)s: %(levelname)-7s - %(message)s""" """ A long formatter which results in links to the source code inside Eclipse""" -loggers = ( - ('APP', 'DEBUG'), - (socket_protocol.logger_name, 'WARNING'), - (stringtools.logger_name, 'WARNING'), - (task.logger_name, 'WARNING'), - (tcp_socket.logger_name, 'WARNING'), -) -formatter = LONG_FMT +# Logging +# +APP_NAME = 'smarthome' +LOGTARGET = 'stdout' # possible choices are: 'logfile' or 'stdout' + +LOGHOST = 'localhost' +LOGPORT = 19996 + +formatter = report.LONG_FMT diff --git a/garage_protocol b/garage_protocol index ae391a4..c5f4e03 160000 --- a/garage_protocol +++ b/garage_protocol @@ -1 +1 @@ -Subproject commit ae391a4698abc0834519cfade3c96b06a59a22d9 +Subproject commit c5f4e0323aa0a07d996372f94c9652be6fad3919 diff --git a/helpers b/helpers index 43e0d55..53e9e08 160000 --- a/helpers +++ b/helpers @@ -1 +1 @@ -Subproject commit 43e0d556d1bbe6fed06bf5a90fa1bea8a8b2c81e +Subproject commit 53e9e080f8f19c068135a67ede6ac736ba3bf94c diff --git a/report b/report index ce17433..25889f2 160000 --- a/report +++ b/report @@ -1 +1 @@ -Subproject commit ce174339bc61a57dbb1c152f329d01ec4a5e1040 +Subproject commit 25889f225b3593d515e37bebffef21458c961f64 diff --git a/rpi_envsens b/rpi_envsens index a0bfadc..f8cb99a 160000 --- a/rpi_envsens +++ b/rpi_envsens @@ -1 +1 @@ -Subproject commit a0bfadcce811fcf2190d830dddb717dabc07875e +Subproject commit f8cb99aa08dd26583588de206c2774a1a0b8e2bf diff --git a/smarthome.py b/smarthome.py index 6eca5f5..be2703c 100644 --- a/smarthome.py +++ b/smarthome.py @@ -18,7 +18,11 @@ import time import wetation_protocol import wx -logger = logging.getLogger('APP') +try: + from config import APP_NAME as ROOT_LOGGER_NAME +except ImportError: + ROOT_LOGGER_NAME = 'root' +logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__) class WetationFrameProt(gui.Wetation): @@ -340,7 +344,7 @@ class MyApp(wx.App): if __name__ == "__main__": - report.appLoggingConfigure(os.path.dirname(__file__), config.LOGTARGET, config.loggers, fmt=config.formatter) + report.appLoggingConfigure(os.path.dirname(__file__), config.LOGTARGET, ((config.APP_NAME, 'DEBUG'), ), fmt=config.formatter, host=config.LOGHOST, port=config.LOGPORT) # app = MyApp(0) app.frame.run() diff --git a/socket_protocol b/socket_protocol index cd50834..8a8522d 160000 --- a/socket_protocol +++ b/socket_protocol @@ -1 +1 @@ -Subproject commit cd508340e390fc01ebdf81eae3b1e221aa1b658a +Subproject commit 8a8522d26b486b005f65e7e542742e898f1109e7 diff --git a/stringtools b/stringtools index d5f9931..76d8ae9 160000 --- a/stringtools +++ b/stringtools @@ -1 +1 @@ -Subproject commit d5f9931bcab942ac84d8f09b1559995da0d2676c +Subproject commit 76d8ae9b1bfd894bc5f4b830394ce0552120a508 diff --git a/task b/task index d3fbc59..bbc3c6f 160000 --- a/task +++ b/task @@ -1 +1 @@ -Subproject commit d3fbc5934051ab165723ca37e8f02596329f174a +Subproject commit bbc3c6f93588942087d617e33bc5797041ae2658 diff --git a/tcp_socket b/tcp_socket index d9bdc90..576494b 160000 --- a/tcp_socket +++ b/tcp_socket @@ -1 +1 @@ -Subproject commit d9bdc909e98f627fea4417d027ae5d9cb9e2ed81 +Subproject commit 576494b2008b857ed9b6c4bb3f162b5c73cf4b33 diff --git a/wetation_protocol b/wetation_protocol index e9c6321..cdc9912 160000 --- a/wetation_protocol +++ b/wetation_protocol @@ -1 +1 @@ -Subproject commit e9c6321772df731317b5398b624e10ff509d489b +Subproject commit cdc9912f3d26edea9e0a36b0fccfc7d3bfd6b868