~ubuntu-branches/ubuntu/karmic/python3.0/karmic

« back to all changes in this revision

Viewing changes to Lib/logging/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-16 17:18:23 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090216171823-1d5cm5qnnjvmnzzm
Tags: 3.0.1-0ubuntu1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2001-2008 by Vinay Sajip. All Rights Reserved.
 
1
# Copyright 2001-2009 by Vinay Sajip. All Rights Reserved.
2
2
#
3
3
# Permission to use, copy, modify, and distribute this software and its
4
4
# documentation for any purpose and without fee is hereby granted,
18
18
Logging package for Python. Based on PEP 282 and comments thereto in
19
19
comp.lang.python, and influenced by Apache's log4j system.
20
20
 
21
 
Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved.
 
21
Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved.
22
22
 
23
23
To use, simply 'import logging' and log away!
24
24
"""
43
43
__author__  = "Vinay Sajip <vinay_sajip@red-dove.com>"
44
44
__status__  = "production"
45
45
__version__ = "0.5.0.5"
46
 
__date__    = "24 January 2008"
 
46
__date__    = "20 January 2009"
47
47
 
48
48
#---------------------------------------------------------------------------
49
49
#   Miscellaneous module data
726
726
        if strm is None:
727
727
            strm = sys.stderr
728
728
        self.stream = strm
729
 
        self.formatter = None
730
729
 
731
730
    def flush(self):
732
731
        """
781
780
        self.mode = mode
782
781
        self.encoding = encoding
783
782
        if delay:
 
783
            #We don't open the stream, but we still need to call the
 
784
            #Handler constructor to set level, formatter, lock etc.
 
785
            Handler.__init__(self)
784
786
            self.stream = None
785
787
        else:
786
 
            stream = self._open()
787
 
            StreamHandler.__init__(self, stream)
 
788
            StreamHandler.__init__(self, self._open())
788
789
 
789
790
    def close(self):
790
791
        """
816
817
        constructor, open it before calling the superclass's emit.
817
818
        """
818
819
        if self.stream is None:
819
 
            stream = self._open()
820
 
            StreamHandler.__init__(self, stream)
 
820
            self.stream = self._open()
821
821
        StreamHandler.emit(self, record)
822
822
 
823
823
#---------------------------------------------------------------------------