changeset 13:d5265a0da13a

Always log exceptions to file.
author Benoît Allard <benoit.allard@greenbone.net>
date Tue, 30 Sep 2014 14:25:25 +0200
parents 4219d6fb4c38
children a52995b50ecc
files farol/main.py
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/farol/main.py	Tue Sep 30 12:18:52 2014 +0200
+++ b/farol/main.py	Tue Sep 30 14:25:25 2014 +0200
@@ -23,6 +23,8 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 
 import os
+import logging
+from logging import FileHandler
 
 from farolluz.cvrf import CVRF, ValidationError
 from farolluz.parsers.cvrf import parse
@@ -48,12 +50,9 @@
 app.register_blueprint(vulnerability, url_prefix='/vulnerability')
 app.register_blueprint(producttree, url_prefix='/producttree')
 
-if not app.debug:
-    import logging
-    from logging import FileHandler
-    file_handler = FileHandler(os.path.join(app.instance_path, 'farol.log'))
-    file_handler.setLevel(logging.WARNING)
-    app.logger.addHandler(file_handler)
+file_handler = FileHandler(os.path.join(app.instance_path, 'farol.log'))
+file_handler.setLevel(logging.WARNING)
+app.logger.addHandler(file_handler)
 
 @app.context_processor
 def cache_content():

http://farol.wald.intevation.org