Back to index

python3.2  3.2.2
Classes | Functions | Variables
test.test_logging Namespace Reference

Classes

class  BaseTest
class  BuiltinLevelsTest
class  BasicFilterTest
class  GarrulousFilter
class  VerySpecificFilter
class  CustomLevelsAndFiltersTest
class  MemoryHandlerTest
class  ExceptionFormatter
class  ConfigFileTest
class  LogRecordStreamHandler
class  LogRecordSocketReceiver
class  SocketHandlerTest
class  MemoryTest
class  EncodingTest
class  WarningsTest
class  CustomHandler
class  ConfigDictTest
class  ManagerTest
class  ChildLoggerTest
class  DerivedLogRecord
class  LogRecordFactoryTest
class  QueueHandlerTest
class  FormatterTest
class  LastResortTest
class  BaseFileTest
class  RotatingFileHandlerTest
class  TimedRotatingFileHandlerTest

Functions

def formatFunc
def handlerFunc
def secs
def test_compute_rollover
def test_main

Variables

 threading = None
int SILENT = 120
int TACITURN = 119
int TERSE = 118
int EFFUSIVE = 117
int SOCIABLE = 116
int VERBOSE = 115
int TALKATIVE = 114
int GARRULOUS = 113
int CHATTERBOX = 112
int BORING = 111
tuple LEVEL_RANGE = range(BORING, SILENT + 1)
dictionary my_logging_levels

Class Documentation

class test::test_logging::CustomHandler

Definition at line 1116 of file test_logging.py.


Function Documentation

def test.test_logging.formatFunc (   format,
  datefmt = None 
)

Definition at line 1110 of file test_logging.py.

01110 
01111 def formatFunc(format, datefmt=None):
01112     return logging.Formatter(format, datefmt)

Definition at line 1113 of file test_logging.py.

01113 
01114 def handlerFunc():
01115     return logging.StreamHandler()

def test.test_logging.secs (   kw)

Definition at line 2282 of file test_logging.py.

02282 
02283 def secs(**kw):
02284     return datetime.timedelta(**kw) // datetime.timedelta(seconds=1)

Here is the caller graph for this function:

def test.test_logging.test_compute_rollover (   self,
  when = when,
  exp = exp 
)

Definition at line 2293 of file test_logging.py.

02293 
02294     def test_compute_rollover(self, when=when, exp=exp):
02295         rh = logging.handlers.TimedRotatingFileHandler(
02296             self.fn, when=when, interval=1, backupCount=0, utc=True)
02297         currentTime = 0.0
02298         actual = rh.computeRollover(currentTime)
02299         if exp != actual:
02300             # Failures occur on some systems for MIDNIGHT and W0.
02301             # Print detailed calculation for MIDNIGHT so we can try to see
02302             # what's going on
02303             import time
02304             if when == 'MIDNIGHT':
02305                 try:
02306                     if rh.utc:
02307                         t = time.gmtime(currentTime)
02308                     else:
02309                         t = time.localtime(currentTime)
02310                     currentHour = t[3]
02311                     currentMinute = t[4]
02312                     currentSecond = t[5]
02313                     # r is the number of seconds left between now and midnight
02314                     r = logging.handlers._MIDNIGHT - ((currentHour * 60 +
02315                                                        currentMinute) * 60 +
02316                             currentSecond)
02317                     result = currentTime + r
02318                     print('t: %s (%s)' % (t, rh.utc), file=sys.stderr)
02319                     print('currentHour: %s' % currentHour, file=sys.stderr)
02320                     print('currentMinute: %s' % currentMinute, file=sys.stderr)
02321                     print('currentSecond: %s' % currentSecond, file=sys.stderr)
02322                     print('r: %s' % r, file=sys.stderr)
02323                     print('result: %s' % result, file=sys.stderr)
02324                 except Exception:
02325                     print('exception in diagnostic code: %s' % sys.exc_info()[1], file=sys.stderr)
02326         self.assertEqual(exp, actual)
        rh.close()

Here is the call graph for this function:

Definition at line 2333 of file test_logging.py.

02333 
02334 def test_main():
02335     run_unittest(BuiltinLevelsTest, BasicFilterTest,
02336                  CustomLevelsAndFiltersTest, MemoryHandlerTest,
02337                  ConfigFileTest, SocketHandlerTest, MemoryTest,
02338                  EncodingTest, WarningsTest, ConfigDictTest, ManagerTest,
02339                  FormatterTest,
02340                  LogRecordFactoryTest, ChildLoggerTest, QueueHandlerTest,
02341                  RotatingFileHandlerTest,
02342                  LastResortTest,
02343                  TimedRotatingFileHandlerTest
02344                 )

Here is the call graph for this function:


Variable Documentation

Definition at line 372 of file test_logging.py.

Definition at line 371 of file test_logging.py.

Definition at line 366 of file test_logging.py.

Definition at line 370 of file test_logging.py.

Definition at line 374 of file test_logging.py.

Initial value:
00001 {
00002     SILENT      : 'Silent',
00003     TACITURN    : 'Taciturn',
00004     TERSE       : 'Terse',
00005     EFFUSIVE    : 'Effusive',
00006     SOCIABLE    : 'Sociable',
00007     VERBOSE     : 'Verbose',
00008     TALKATIVE   : 'Talkative',
00009     GARRULOUS   : 'Garrulous',
00010     CHATTERBOX  : 'Chatterbox',
00011     BORING      : 'Boring',
00012 }

Definition at line 380 of file test_logging.py.

Definition at line 363 of file test_logging.py.

Definition at line 367 of file test_logging.py.

Definition at line 364 of file test_logging.py.

Definition at line 369 of file test_logging.py.

Definition at line 365 of file test_logging.py.

Definition at line 52 of file test_logging.py.

Definition at line 368 of file test_logging.py.