From aac9cb1e82b9dc32f6b1dad7dd9a6dec63b40857 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 7 Dec 2009 16:49:23 +0000 Subject: [PATCH] respect notify-timestamp --- direct/src/directnotify/Notifier.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/direct/src/directnotify/Notifier.py b/direct/src/directnotify/Notifier.py index 152f4de77a..76737c8982 100644 --- a/direct/src/directnotify/Notifier.py +++ b/direct/src/directnotify/Notifier.py @@ -4,6 +4,7 @@ for the programmer/user """ from LoggerGlobal import defaultLogger from direct.showbase import PythonUtil +from libpandaexpress import ConfigVariableBool import time import types import sys @@ -16,7 +17,7 @@ class Notifier: # particularly useful for integrating the Python notify system # with the C++ notify system. streamWriter = None - showTime = 0 + showTime = ConfigVariableBool('notify-timestamp', False) def __init__(self, name, logger=None): """ @@ -123,7 +124,7 @@ class Notifier: Exception: error """ message = str(errorString) - if Notifier.showTime: + if Notifier.showTime.getValue(): string = (self.getTime() + str(exception) + ": " + self.__name + "(error): " + message) else: string = (str(exception) + ": " + self.__name + "(error): " + message) @@ -137,7 +138,7 @@ class Notifier: """ if self.__warning: message = str(warningString) - if Notifier.showTime: + if Notifier.showTime.getValue(): string = (self.getTime() + self.__name + '(warning): ' + message) else: string = (":" + self.__name + '(warning): ' + message) @@ -164,7 +165,7 @@ class Notifier: """ if self.__debug: message = str(debugString) - if Notifier.showTime: + if Notifier.showTime.getValue(): string = (self.getTime() + self.__name + '(debug): ' + message) else: string = (':' + self.__name + '(debug): ' + message) @@ -191,7 +192,7 @@ class Notifier: """ if self.__info: message = str(infoString) - if Notifier.showTime: + if Notifier.showTime.getValue(): string = (self.getTime() + self.__name + ': ' + message) else: string = (':' + self.__name + ': ' + message)