Changeset 6667 for anuga_core/source/anuga/utilities/log.py
- Timestamp:
- Mar 31, 2009, 1:07:40 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/log.py
r6663 r6667 18 18 Until the first call to log() the user is free to play with the module data 19 19 to configure the logging. 20 21 Note that this module uses features of the logging package that were introduced 22 in python2.5. If running on earlier versions, these features are disables: 23 . Module name + line number 20 24 ''' 21 25 … … 75 79 global _setup, log_logging_level 76 80 81 # get running python version for later 82 (version_major, version_minor, _, _, _) = sys.version_info 83 77 84 # have we been setup? 78 85 if not _setup: … … 99 106 logging.getLevelName(log_logging_level), 100 107 logging.getLevelName(console_logging_level))) 101 logging.log(logging.CRITICAL, start_msg, 102 extra={'mname': __name__, 'lnum': 0}) 108 if version_major >= 2 and version_minor >= 5: 109 logging.log(logging.CRITICAL, start_msg, 110 extra={'mname': __name__, 'lnum': 0}) 111 else: 112 logging.log(logging.CRITICAL, start_msg) 103 113 104 114 # mark module as *setup* … … 113 123 break 114 124 115 logging.log(level, msg, extra={'mname': fname, 'lnum': lnum}) 125 if version_major >= 2 and version_minor >= 5: 126 logging.log(level, msg, extra={'mname': fname, 'lnum': lnum}) 127 else: 128 logging.log(level, msg) 116 129 117 130 ################################################################################
Note: See TracChangeset
for help on using the changeset viewer.