[Python-checkins] cpython: Closes #21980: Added a __repr__ for LogRecord.

vinay.sajip python-checkins at python.org
Tue Jan 6 12:19:57 CET 2015


https://hg.python.org/cpython/rev/390ffd39631b
changeset:   94044:390ffd39631b
parent:      94042:8bfe230db0bc
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Tue Jan 06 11:19:42 2015 +0000
summary:
  Closes #21980: Added a __repr__ for LogRecord.

files:
  Lib/logging/__init__.py |  6 ++++--
  1 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2001-2014 by Vinay Sajip. All Rights Reserved.
+# Copyright 2001-2015 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,
@@ -18,7 +18,7 @@
 Logging package for Python. Based on PEP 282 and comments thereto in
 comp.lang.python.
 
-Copyright (C) 2001-2014 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2015 Vinay Sajip. All Rights Reserved.
 
 To use, simply 'import logging' and log away!
 """
@@ -316,6 +316,8 @@
         return '<LogRecord: %s, %s, %s, %s, "%s">'%(self.name, self.levelno,
             self.pathname, self.lineno, self.msg)
 
+    __repr__ = __str__
+
     def getMessage(self):
         """
         Return the message for this LogRecord.

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list