./
mgfflogger__define.pro
Logger object to control logging.
Class description for mgfflogger
Properties
- _extra init type=keywords
 any keyword accepted by
MGffLogger::setProperty- output get type=strarr
 output sent to the logger already
- clobber set type=boolean
 set, along with filename, to clobber pre-existing file
- name get init type=string
 name of the logger
- format get set type=string
 format string for messages, default value for format is:
where the possible names to include are: "time", "levelname", "routine", "stacktrace", "name", and "message".'%(time)s %(levelname)s: %(routine)s: %(message)s'Note that the time argument will first be formatted using the
TIME_FORMATspecification- filename get set type=string
 filename to send append output to; set to empty string to send output to
stderr- level get set type=long
 current level of logging: 0 (none), 1 (critial), 2 (error), 3 (warning), 4 (info), or 5 (debug); can be set to an array of levels which will be cascaded up to the parents of the logger with the logger taking the last level and passing the previous ones up to its parent; only messages with levels lower or equal to than the logger level will be logged
- time_format get set type=string
 Fortran style format code to specify the format of the time in the
FORMATproperty; the default value formats the time/date like "2003-07-08 16:49:45.891"
Routines
result = mgfflogger::getByName(name)Traverses a hierarchy of named objects using a path of names delimited with /'s.
mgfflogger::getProperty, level=long, format=string, time_format=string, name=string, filename=string, output=strarrSet properties.
mgfflogger::setProperty, level=long, format=string, time_format=string, filename=string, /clobberGet properties.
mgfflogger::insertLastErrorInsert the stack trace for the last error message into the log.
mgfflogger::print, msg [, level=long]Log message to given level.
mgfflogger::cleanupFree resources.
result = mgfflogger::init(parent=parent, name=string, _extra=keywords)Create logger object.
mgfflogger__defineDefine instance variables.
Routine details
top source mgfflogger::getByName
result = mgfflogger::getByName(name)
Traverses a hierarchy of named objects using a path of names delimited with /'s.
Return value
object
Parameters
- name in required type=string
 path of names to the desired object; names are delimited with /'s
top source mgfflogger::getProperty
mgfflogger::getProperty, level=long, format=string, time_format=string, name=string, filename=string, output=strarr
Set properties.
Keywords
- level type=long
 current level of logging: 0 (none), 1 (critial), 2 (error), 3 (warning), 4 (info), or 5 (debug); can be set to an array of levels which will be cascaded up to the parents of the logger with the logger taking the last level and passing the previous ones up to its parent; only messages with levels lower or equal to than the logger level will be logged
- format type=string
 format string for messages, default value for format is:
where the possible names to include are: "time", "levelname", "routine", "stacktrace", "name", and "message".'%(time)s %(levelname)s: %(routine)s: %(message)s'Note that the time argument will first be formatted using the
TIME_FORMATspecification- time_format type=string
 Fortran style format code to specify the format of the time in the
FORMATproperty; the default value formats the time/date like "2003-07-08 16:49:45.891"- name type=string
 name of the logger
- filename type=string
 filename to send append output to; set to empty string to send output to
stderr- output type=strarr
 output sent to the logger already
top source mgfflogger::setProperty
mgfflogger::setProperty, level=long, format=string, time_format=string, filename=string, /clobber
Get properties.
Keywords
- level type=long
 current level of logging: 0 (none), 1 (critial), 2 (error), 3 (warning), 4 (info), or 5 (debug); can be set to an array of levels which will be cascaded up to the parents of the logger with the logger taking the last level and passing the previous ones up to its parent; only messages with levels lower or equal to than the logger level will be logged
- format type=string
 format string for messages, default value for format is:
where the possible names to include are: "time", "levelname", "routine", "stacktrace", "name", and "message".'%(time)s %(levelname)s: %(routine)s: %(message)s'Note that the time argument will first be formatted using the
TIME_FORMATspecification- time_format type=string
 Fortran style format code to specify the format of the time in the
FORMATproperty; the default value formats the time/date like "2003-07-08 16:49:45.891"- filename type=string
 filename to send append output to; set to empty string to send output to
stderr- clobber type=boolean
 set, along with filename, to clobber pre-existing file
top source mgfflogger::insertLastError
mgfflogger::insertLastError
Insert the stack trace for the last error message into the log. Since stack traces are from run-time crashes they are considered to be at the CRITICAL level.
Keywords
- back_levels in optional private type=boolean
 number of levels to go back in the stack trace beyond the normal ones; should be set to 1 if calling this routine from
MG_LOGfor example
top source mgfflogger::print
mgfflogger::print, msg [, level=long]
Log message to given level.
Parameters
- msg in required type=string
 message to print
Keywords
- level in optional type=long
 level of message
- back_levels in optional private type=boolean
 number of levels to go back in the stack trace beyond the normal ones; should be set to 1 if calling this routine from
MG_LOGfor example
File attributes
| Modification date: | Wed Nov 2 17:04:50 2011 | 
| Lines: | 354 | 
| Docformat: | rst rst | 
![[attach.png]](idldoc-resources/attach.png)