From 356bcf74c44039a01e29fb5a890e19b865ebf3d7 Mon Sep 17 00:00:00 2001 From: jar3b Date: Tue, 15 Mar 2016 12:59:33 +0300 Subject: [PATCH] Add log filename to config --- aore/config/common.py | 1 + aore/phias.py | 3 +++ config.example.py | 1 + passenger_wsgi.py | 4 ++-- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/aore/config/common.py b/aore/config/common.py index 161b529..34bee2e 100644 --- a/aore/config/common.py +++ b/aore/config/common.py @@ -2,6 +2,7 @@ class basic: logging = False + logfile = "" class sphinx_conf: diff --git a/aore/phias.py b/aore/phias.py index d6b7f6d..eda9a3a 100644 --- a/aore/phias.py +++ b/aore/phias.py @@ -15,6 +15,9 @@ class App(BottleCL): self._factory = FiasFactory() + def get_app(self): + return self._app + def init_routes(self): self.add_route(r'/expand/', self.__expand) self.add_route(r'/normalize/', self.__normalize) diff --git a/config.example.py b/config.example.py index cc0d46c..23c87b6 100644 --- a/config.example.py +++ b/config.example.py @@ -15,3 +15,4 @@ config.unrar_config.path = "C:\\Program Files\\WinRAR\\unrar.exe" config.folders.temp = "E:\\!TEMP" config.basic.logging = True +config.basic.logfile = "pyphias.log" diff --git a/passenger_wsgi.py b/passenger_wsgi.py index 4d1ac54..4570273 100644 --- a/passenger_wsgi.py +++ b/passenger_wsgi.py @@ -9,9 +9,9 @@ except ImportError: assert "No config" # Define main app -phias_app = phias.App("pyphias.log") +phias_app = phias.App(config.basic.logfile) # Define wsgi app -application = phias_app._app +application = phias_app.get_app() # Run bottle WSGI server if no external if __name__ == '__main__':