From 200c0e65fa724b02711a68542e05bfa0464d5d32 Mon Sep 17 00:00:00 2001 From: Schrolli Date: Mon, 18 May 2015 12:17:06 +0200 Subject: [PATCH] logging filemode = w --- .gitignore | 3 ++- plugin_test/boswatch.log | 44 +++++--------------------------------- plugin_test/plugin_test.py | 2 +- 3 files changed, 8 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index ac7b2b5..a74980d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -*.psd \ No newline at end of file +*.psd +*.pyc \ No newline at end of file diff --git a/plugin_test/boswatch.log b/plugin_test/boswatch.log index dc860c0..d0cf339 100644 --- a/plugin_test/boswatch.log +++ b/plugin_test/boswatch.log @@ -1,42 +1,8 @@ -18.05.2015 12:00:39 - INFO: Alarm! -18.05.2015 12:00:39 - DEBUG: Loading plugin template -18.05.2015 12:00:39 - DEBUG: Throw Template Plugin -18.05.2015 12:00:40 - INFO: Alarm! -18.05.2015 12:00:40 - DEBUG: Loading plugin template -18.05.2015 12:00:40 - DEBUG: Throw Template Plugin -18.05.2015 12:00:41 - INFO: Alarm! -18.05.2015 12:00:41 - DEBUG: Loading plugin template -18.05.2015 12:00:41 - DEBUG: Throw Template Plugin -18.05.2015 12:00:42 - INFO: Alarm! -18.05.2015 12:00:42 - DEBUG: Loading plugin template -18.05.2015 12:00:42 - DEBUG: Throw Template Plugin -18.05.2015 12:01:58 - INFO: Alarm! -18.05.2015 12:01:58 - DEBUG: Loading plugin template -18.05.2015 12:01:58 - DEBUG: Throw Template Plugin -18.05.2015 12:01:58 - DEBUG: try 5/0 -18.05.2015 12:02:09 - INFO: Alarm! -18.05.2015 12:02:09 - DEBUG: Loading plugin template -18.05.2015 12:02:09 - DEBUG: Throw Template Plugin -18.05.2015 12:02:09 - DEBUG: try 5/0 -18.05.2015 12:02:09 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:02:10 - INFO: Alarm! -18.05.2015 12:02:10 - DEBUG: Loading plugin template -18.05.2015 12:02:10 - DEBUG: Throw Template Plugin -18.05.2015 12:02:10 - DEBUG: try 5/0 -18.05.2015 12:02:10 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:02:11 - INFO: Alarm! -18.05.2015 12:02:11 - DEBUG: Loading plugin template -18.05.2015 12:02:11 - DEBUG: Throw Template Plugin -18.05.2015 12:02:11 - DEBUG: try 5/0 -18.05.2015 12:02:11 - ERROR: Error in Template Plugin +18.05.2015 12:15:05 - INFO: Alarm! +18.05.2015 12:15:05 - DEBUG: Loading plugin template +18.05.2015 12:15:05 - DEBUG: Throw Template Plugin +18.05.2015 12:15:05 - DEBUG: try 5/0 +18.05.2015 12:15:05 - ERROR: Error in Template Plugin Traceback (most recent call last): File "./plugins\template\__init__.py", line 7, in run test = 5/0 diff --git a/plugin_test/plugin_test.py b/plugin_test/plugin_test.py index 1dd9597..c42e718 100644 --- a/plugin_test/plugin_test.py +++ b/plugin_test/plugin_test.py @@ -5,7 +5,7 @@ import time import pluginloader import logging -logging.basicConfig(filename='boswatch.log',level=logging.DEBUG, format='%(asctime)s - %(levelname)s: %(message)s', datefmt='%d.%m.%Y %I:%M:%S') +logging.basicConfig(filename='boswatch.log', filemode='w', level=logging.DEBUG, format='%(asctime)s - %(levelname)s: %(message)s', datefmt='%d.%m.%Y %I:%M:%S') #https://docs.python.org/2/howto/logging.html#logging-basic-tutorial #log levels