summaryrefslogtreecommitdiff
path: root/logutils
diff options
context:
space:
mode:
Diffstat (limited to 'logutils')
-rw-r--r--logutils/__init__.py5
-rw-r--r--logutils/adapter.py16
-rw-r--r--logutils/colorize.py10
-rw-r--r--logutils/dictconfig.py17
-rw-r--r--logutils/http.py3
-rw-r--r--logutils/queue.py15
-rw-r--r--logutils/redis.py3
-rw-r--r--logutils/testing.py15
8 files changed, 24 insertions, 60 deletions
diff --git a/logutils/__init__.py b/logutils/__init__.py
index f9a677c..44e261f 100644
--- a/logutils/__init__.py
+++ b/logutils/__init__.py
@@ -1,3 +1,6 @@
+#
+# Copyright (C) 2010-2013 Vinay Sajip. See LICENSE.txt for details.
+#
"""
The logutils package provides a set of handlers for the Python standard
library's logging package.
@@ -10,7 +13,7 @@ of Python, and so are packaged here.
import logging
from string import Template
-__version__ = '0.3.2'
+__version__ = '0.3.3'
class NullHandler(logging.Handler):
"""
diff --git a/logutils/adapter.py b/logutils/adapter.py
index a9f5275..399e1ee 100644
--- a/logutils/adapter.py
+++ b/logutils/adapter.py
@@ -1,20 +1,6 @@
-# Copyright (C) 2010 Vinay Sajip. All Rights Reserved.
#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose and without fee is hereby granted,
-# provided that the above copyright notice appear in all copies and that
-# both that copyright notice and this permission notice appear in
-# supporting documentation, and that the name of Vinay Sajip
-# not be used in advertising or publicity pertaining to distribution
-# of the software without specific, written prior permission.
-# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
-# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
-# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+# Copyright (C) 2010-2013 Vinay Sajip. See LICENSE.txt for details.
#
-
import logging
import logutils
diff --git a/logutils/colorize.py b/logutils/colorize.py
index 3dfaad0..2c39639 100644
--- a/logutils/colorize.py
+++ b/logutils/colorize.py
@@ -1,10 +1,15 @@
#
-# Copyright (C) 2010-2011 Vinay Sajip. All rights reserved.
+# Copyright (C) 2010-2013 Vinay Sajip. All rights reserved.
#
import ctypes
import logging
import os
+try:
+ unicode
+except NameError:
+ unicode = None
+
class ColorizingStreamHandler(logging.StreamHandler):
"""
A stream handler which supports colorizing of console streams
@@ -58,6 +63,9 @@ class ColorizingStreamHandler(logging.StreamHandler):
try:
message = self.format(record)
stream = self.stream
+ if unicode and isinstance(message, unicode):
+ enc = getattr(stream, 'encoding', 'utf-8')
+ message = message.encode(enc, 'replace')
if not self.is_tty:
stream.write(message)
else:
diff --git a/logutils/dictconfig.py b/logutils/dictconfig.py
index a4f07cb..4a2281f 100644
--- a/logutils/dictconfig.py
+++ b/logutils/dictconfig.py
@@ -1,19 +1,6 @@
-# Copyright 2009-2010 by Vinay Sajip. All Rights Reserved.
#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose and without fee is hereby granted,
-# provided that the above copyright notice appear in all copies and that
-# both that copyright notice and this permission notice appear in
-# supporting documentation, and that the name of Vinay Sajip
-# not be used in advertising or publicity pertaining to distribution
-# of the software without specific, written prior permission.
-# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
-# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
-# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
+# Copyright (C) 2009-2013 Vinay Sajip. See LICENSE.txt for details.
+#
import logging.handlers
import re
import sys
diff --git a/logutils/http.py b/logutils/http.py
index c3c6c57..5d145c3 100644
--- a/logutils/http.py
+++ b/logutils/http.py
@@ -1,3 +1,6 @@
+#
+# Copyright (C) 2010-2013 Vinay Sajip. See LICENSE.txt for details.
+#
import logging
class HTTPHandler(logging.Handler):
diff --git a/logutils/queue.py b/logutils/queue.py
index 39be637..cced8c5 100644
--- a/logutils/queue.py
+++ b/logutils/queue.py
@@ -1,18 +1,5 @@
-# Copyright (C) 2010 Vinay Sajip. All Rights Reserved.
#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose and without fee is hereby granted,
-# provided that the above copyright notice appear in all copies and that
-# both that copyright notice and this permission notice appear in
-# supporting documentation, and that the name of Vinay Sajip
-# not be used in advertising or publicity pertaining to distribution
-# of the software without specific, written prior permission.
-# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
-# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
-# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+# Copyright (C) 2010-2013 Vinay Sajip. See LICENSE.txt for details.
#
"""
This module contains classes which help you work with queues. A typical
diff --git a/logutils/redis.py b/logutils/redis.py
index 2d7c6bf..0fea2d1 100644
--- a/logutils/redis.py
+++ b/logutils/redis.py
@@ -1,3 +1,6 @@
+#
+# Copyright (C) 2011-2013 Vinay Sajip. See LICENSE.txt for details.
+#
"""
This module contains classes which help you work with Redis queues.
"""
diff --git a/logutils/testing.py b/logutils/testing.py
index 2a623ce..dfc8d21 100644
--- a/logutils/testing.py
+++ b/logutils/testing.py
@@ -1,18 +1,5 @@
-# Copyright (C) 2010 Vinay Sajip. All Rights Reserved.
#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation for any purpose and without fee is hereby granted,
-# provided that the above copyright notice appear in all copies and that
-# both that copyright notice and this permission notice appear in
-# supporting documentation, and that the name of Vinay Sajip
-# not be used in advertising or publicity pertaining to distribution
-# of the software without specific, written prior permission.
-# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
-# VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
-# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
-# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+# Copyright (C) 2010-2013 Vinay Sajip. See LICENSE.txt for details.
#
import logging
from logging.handlers import BufferingHandler