Changeset 6888
- Timestamp:
- Apr 23, 2009, 4:47:07 PM (16 years ago)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/log.py
r6668 r6888 20 20 21 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 disable s:23 . Module name + line number22 in python2.5. If running on earlier versions, these features are disabled: 23 . Calling module name + line number 24 24 ''' 25 25 … … 85 85 if not _setup: 86 86 # sanity check the logging levels, require console >= file 87 if console_logging_level < log_logging_level:87 if log_logging_level > console_logging_level: 88 88 log_logging_level = console_logging_level 89 89 … … 121 121 frames = traceback.extract_stack() 122 122 frames.reverse() 123 (_, mod_name) = __name__.rsplit('.', 1) 123 124 for (fpath, lnum, mname, _) in frames: 124 fname = os.path.basename(mname).rsplit('.', 1)[0]125 if mname != __name__:125 (fname, _) = os.path.basename(fpath).rsplit('.', 1) 126 if fname != mod_name: 126 127 break 127 128 … … 165 166 log(logging.CRITICAL, msg) 166 167 167 def resource_usage(level=logging.CRITICAL): 168 '''Log resource usage at given log level.''' 168 ## 169 # @brief Log memory usage at time of call. 170 # @param level Override the default INFO logging level. 171 # @note From http://code.activestate.com/recipes/286222/. 172 def resource_usage(level=logging.INFO): 173 '''Log memory usage at given log level.''' 169 174 170 175 if sys.platform != 'win32': -
branches/numpy/anuga/utilities/log.py
r6833 r6888 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 20 21 Note that this module uses features of the logging package that were introduced 21 22 in python2.5. If running on earlier versions, these features are disabled:
Note: See TracChangeset
for help on using the changeset viewer.