Vinay Sajip
1211edd81b
Added a docstring
2007-01-09 14:54:56 +00:00
Vinay Sajip
825b75a053
Bug #1627575 : Added _open() method to FileHandler which can be used to reopen files. The FileHandler instance now saves the encoding (which can be None) in an attribute called "encoding".
2007-01-09 14:50:28 +00:00
Vinay Sajip
2cd79f6b78
Bare except clause removed from LogRecord.__init__. Now, only ValueError, TypeError and AttributeError are trapped.
...
(SF #411881 )
2007-01-08 18:51:46 +00:00
Vinay Sajip
ef7f3bf3b3
Change to improve speed of _fixupChildren
2006-10-31 17:32:37 +00:00
Vinay Sajip
2c050af28b
Modified LogRecord.__init__ to make the func parameter optional. (See SF #1569622 ).
2006-10-03 18:21:56 +00:00
Georg Brandl
0a7d1bb168
logging's atexit hook now runs even if the rest of the module has
...
already been cleaned up.
2006-08-11 07:26:10 +00:00
Vinay Sajip
9e9c2528a4
Changed status from "beta" to "production"; since logging has been part of the stdlib since 2.3, it should be safe to make this assertion ;-)
2006-05-18 07:28:58 +00:00
Vinay Sajip
502348d010
StreamHandler now checks explicitly for None before using sys.stderr as the stream (see SF bug #1463840 ).
2006-04-11 21:42:00 +00:00
Vinay Sajip
a2173a189a
Catch situations where currentframe() returns None. See SF patch #1447410 , this is a different implementation.
2006-03-15 12:45:07 +00:00
Vinay Sajip
d364a07517
Added logThreads and logProcesses to allow conditional omission of logging this information
2006-03-13 22:05:28 +00:00
Vinay Sajip
ed1992f2aa
Added function name to LogRecord.
2006-02-09 08:48:36 +00:00
Vinay Sajip
260ce43252
Propagate exceptions from shutdown() if raiseExceptions is not set.
...
Added 'extra' keyword argument handling to logging calls, as discussed on python-dev.
2006-02-09 08:34:14 +00:00
Vinay Sajip
e0f85926d6
Removed defensive test in Handler.close
2006-02-07 13:55:52 +00:00
Neal Norwitz
55cd82fe0a
Get test_logging to not hang when running under regrtest.py -R ::
...
Not sure why/how _handlers/_handlerList is out of sync. This could
indicate a deeper problem.
In test_logging, the only absolutely necessary change to get working
was tcpserver.abort = 1. But we don't want to wait infinitely
to join the threads, so give a 2.0 second timeout.
There doesn't appear to be a need for a local abort variable
in serve_until_stopped, so just use the instance member.
Note the problem is only on HEAD, not in 2.4.
2006-02-05 08:21:08 +00:00
Vinay Sajip
85c1909a78
Exception handling now raises KeyboardInterrupt and SystemExit rather than passing to handleError
2005-10-31 13:14:19 +00:00
Vinay Sajip
1e86beb3f8
One-off "No handlers..." error message only raised if raiseExceptions is set.
2005-10-23 22:32:59 +00:00
Neal Norwitz
1e8659b963
Don't use a string exception since it's deprecated
2005-10-21 06:00:24 +00:00
Vinay Sajip
239322b97e
Optimised Placeholders handling of child loggers by using a dict rather than a list (much slower in the pathological case of hundreds of child Loggers to a Placeholder - problem reported by Ryan Blazecka).
2005-10-14 09:36:35 +00:00
Vinay Sajip
43d6e812c8
Fixed bug where the logging message was wrongly being demoted from Unicode to string (SF #1314107 )
2005-10-07 08:35:36 +00:00
Vinay Sajip
116f16e4ab
Added lock acquisition around handler removal from logger
2005-09-16 10:33:40 +00:00
Vinay Sajip
0ee9ba258e
Added _handlerList to allow shutdown to flush and close handlers in reverse order of creation (see SF# 1282539)
2005-09-08 18:14:16 +00:00
Vinay Sajip
c384fc2357
Changed _srcfile determination to support py2exe.
2005-09-02 11:20:33 +00:00
Vinay Sajip
4a70486c37
Added threadName and now using re-entrant lock
2005-03-31 20:16:55 +00:00
Vinay Sajip
b89e7c9bc9
Added optional encoding argument to file handlers. Made traceback import unconditional, to avoid lock contention problems which occur when logging from custom importers (SF patch #1158052 )
2005-03-13 09:54:31 +00:00
Vinay Sajip
829dc51a05
Improved frame handling for 1.5.2, and now return func from findCaller (not actually used yet)
2005-02-18 11:53:32 +00:00
Vinay Sajip
dccd4321a7
Fixed bug in handling of args in LogRecord.__init__.
2004-10-21 21:24:27 +00:00
Vinay Sajip
4ed315ae66
Changed handling of args in LogRecord.__init__.
2004-10-20 08:39:40 +00:00
Vinay Sajip
2d5fee06e0
Version number updated to 0.4.9.5
2004-10-03 19:10:53 +00:00
Vinay Sajip
b2635b2f71
Added log() function
2004-09-24 11:45:52 +00:00
Vinay Sajip
b9591174df
Added getLoggerClass()
2004-09-22 12:39:26 +00:00
Vinay Sajip
eb477d04f7
Updated Logger.log() docstring to clarify that lvl parameter should be an integer.
2004-08-04 08:38:08 +00:00
Vinay Sajip
e12f71586a
Ignore exceptions which occur when closing files in shutdown()
2004-07-29 09:19:30 +00:00
Vinay Sajip
4bbab2bde4
FileHandler now stores the basename as an absolute path (fix for SF #982049 )
2004-07-08 10:22:35 +00:00
Tim Peters
4e0e1b6a54
Whitespace normalization.
2004-07-07 20:54:48 +00:00
Vinay Sajip
779e0c9334
Changed basicConfig() to add keyword arguments. Changes are backward-compatible.
...
Added error checking to log() to check that level is an integer, and raise a TypeError if not (as long as raiseExceptions is set).
Minor documentation corrections.
2004-07-03 11:47:26 +00:00
Vinay Sajip
3f74284e1b
Minor documentation changes
2004-02-28 16:07:46 +00:00
Vinay Sajip
3f9f84def4
Handler close() functions call flush() [SF #901330 ]
2004-02-21 22:12:32 +00:00
Vinay Sajip
ed6bb1414c
Copyright year & version number/version date changes.
...
Exception traceback text is now cached.
Closing a handler now removes it from the internal _handlers list.
Handlers now chain to Handler.close() from their close() methods.
Exception info can be passed as a tuple in exc_info.
shutdown() is registered to be called at application exit.
2004-02-20 13:18:36 +00:00
Raymond Hettinger
6f3eaa67e5
SF patch #761519 : Fixes for bugs 760703 and 757821
...
SF bug #760703 : SocketHandler and LogRecord don't work well together
SF bug #757821 : logging module docs
Applied Vinay Sajip's patch with a few minor fixups and a NEWS item.
Patched __init__.py - added new function
makeLogRecord (for bug report 760703).
Patched handlers.py - updated some docstrings and
deleted some old commented-out code.
Patched test_logging.py to make use of makeLogRecord.
Patched liblogging.tex to fill documentation gaps (both
760703 and bug 757821).
2003-06-27 21:43:39 +00:00
Neal Norwitz
a256f7d36f
Fix SF bug #723801 , logging.setLoggerClass() doesn't support new-style classes
2003-04-23 13:12:19 +00:00
Neal Norwitz
f297bd1937
SF patch #725904 , Minor changes to logging from module author (Vinay Sajip)
...
- upgrade to version 0.4.8
2003-04-23 03:49:43 +00:00
Guido van Rossum
0df6442ae5
Undo the apply() removals; this code needs to run under Python 1.5.2.
2003-03-02 20:47:29 +00:00
Guido van Rossum
68468eba63
Get rid of many apply() calls.
2003-02-27 20:14:51 +00:00
Jack Jansen
4c641d0ce1
getpid doesn't exist on MacOS9.
2003-02-21 22:29:45 +00:00
Neal Norwitz
6fa635df7a
SF patch #687683 , Patches to logging (updates from Vinay)
...
Mostly rename WARN -> WARNING
Other misc tweaks
Update tests (not in original patch)
2003-02-18 14:20:07 +00:00
Jeremy Hylton
250684ddd8
Use lightweight introspection instead of the inspect module hammer.
...
Removing locking are findCaller() calls as the implementation using
sys._getframe() is thread-safe.
Changes reviewed by Vinay.
2003-01-23 18:29:29 +00:00
Neal Norwitz
d1cade0d1f
SF Patch #638825 logging module
...
Fix pychecker warnings, remove unused imports and rename root
2002-11-15 23:31:28 +00:00
Guido van Rossum
455ab77f34
Get rid of #! lines, references to usage as __main__, README.txt, and
...
http://www.red-dove.com/python_logging.html .
2002-11-13 16:18:29 +00:00
Guido van Rossum
57102f861d
Adding Vinay Sajip's logging package.
2002-11-13 16:15:58 +00:00