diff --git a/.gitignore b/.gitignore index 292800c..c65eeac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,15 @@ +config.py +.settings +*~ +messages.* + + # ---> Python # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class -config.py - # C extensions *.so diff --git a/config_example/config.py b/config_example/config.py index d508f9b..2f99e5e 100644 --- a/config_example/config.py +++ b/config_example/config.py @@ -1,36 +1,21 @@ #!/usr/bin/env python # -*- coding: UTF-8 -*- -import geo -import socket_protocol -import state_machine -import stringtools -import task -import tcp_socket +import report secret = b'give_a_secret_string_here' server_ip = '127.0.0.1' server_port = 10001 +# Logging +# +APP_NAME = 'leyk' + LOG_TARGET_STDOUT = 'stdout' LOG_TARGET_FILE = 'logfile' -LOG_TARGET = LOG_TARGET_STDOUT +LOGTARGET = LOG_TARGET_STDOUT +LOGHOST = 'localhost' +LOGPORT = 19996 -SHORT_FMT = "%(asctime)s: %(levelname)-7s - %(message)s" -""" A short formatter including the most important information""" -LONG_FMT = """~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -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'), - (geo.logger_name, 'DEBUG'), - (socket_protocol.logger_name, 'DEBUG'), - (state_machine.logger_name, 'DEBUG'), - (stringtools.logger_name, 'DEBUG'), - (task.logger_name, 'DEBUG'), - (tcp_socket.logger_name, 'DEBUG'), -) -formatter = LONG_FMT +formatter = report.LONG_FMT diff --git a/leyk.py b/leyk.py index 000823f..7be51f2 100644 --- a/leyk.py +++ b/leyk.py @@ -10,7 +10,7 @@ import time if __name__ == '__main__': - report.appLoggingConfigure(os.path.dirname(__file__), config.LOG_TARGET, config.loggers) + report.appLoggingConfigure(os.path.dirname(__file__), config.LOGTARGET, ((config.APP_NAME, 'DEBUG'), ), fmt=config.formatter, host=config.LOGHOST, port=config.LOGPORT) s = tcp_socket.tcp_server_stp(config.server_ip, port=config.server_port) prot = protocol.my_server_protocol(s, secret=config.secret) while True: 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/socket_protocol b/socket_protocol index b0857e4..8a8522d 160000 --- a/socket_protocol +++ b/socket_protocol @@ -1 +1 @@ -Subproject commit b0857e4569c34b9b644f5640731be0c413ce54d4 +Subproject commit 8a8522d26b486b005f65e7e542742e898f1109e7 diff --git a/state_machine b/state_machine index 362cb1f..561b564 160000 --- a/state_machine +++ b/state_machine @@ -1 +1 @@ -Subproject commit 362cb1fc1772f8fae4629ebbd8828d5c63689ecd +Subproject commit 561b564b3dc9298936de5b4b51267e56d86ac426 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 62f13e2..576494b 160000 --- a/tcp_socket +++ b/tcp_socket @@ -1 +1 @@ -Subproject commit 62f13e2d878b09b81d094c2f77dbd830d72be2c7 +Subproject commit 576494b2008b857ed9b6c4bb3f162b5c73cf4b33