dist_tools/
mgfflogger__define.pro
Logger object to control logging.
Class description for mgfflogger
Properties
Properties in mgfflogger
- _extra init type=keywords
any keyword accepted by
MGffLogger::setProperty
- clobber set type=boolean
set, along with filename, to clobber pre-existing file
- filename get set type=string
filename to send append output to; set to empty string to send output to
stderr
- format get set type=string
format string for messages, default value for format is:
where the possible names to include are: "time", "levelname", "levelshortname", "routine", "stacktrace", "name", "fullname" and "message".'%(time)s %(levelname)s: %(routine)s: %(message)s'
Note that the time argument will first be formatted using the
TIME_FORMAT
specification- fullname get
- 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
- name get init type=string
name of the logger
- output get type=strarr
output sent to the logger already
- time_format get set type=string
Fortran style format code to specify the format of the time in the
FORMAT
property; the default value formats the time/date like "2003-07-08 16:49:45.891"
Routines
Routines from mgfflogger__define.pro
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, fullname=fullname, filename=string, output=strarr
Set properties.
mgfflogger::setProperty, level=long, format=string, time_format=string, filename=string, /clobber
Get properties.
mgfflogger::insertLastError
Insert the stack trace for the last error message into the log.
mgfflogger::print, msg [, level=long]
Log message to given level.
mgfflogger::cleanup
Free resources.
result = mgfflogger::init(parent=parent, name=string, _extra=keywords)
Create logger object.
mgfflogger__define
Define instance variables.
Routine details
top 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 mgfflogger::getProperty
mgfflogger::getProperty, level=long, format=string, time_format=string, name=string, fullname=fullname, 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", "levelshortname", "routine", "stacktrace", "name", "fullname" and "message".'%(time)s %(levelname)s: %(routine)s: %(message)s'
Note that the time argument will first be formatted using the
TIME_FORMAT
specification- time_format type=string
Fortran style format code to specify the format of the time in the
FORMAT
property; the default value formats the time/date like "2003-07-08 16:49:45.891"- name type=string
name of the logger
- fullname
- 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 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", "levelshortname", "routine", "stacktrace", "name", "fullname" and "message".'%(time)s %(levelname)s: %(routine)s: %(message)s'
Note that the time argument will first be formatted using the
TIME_FORMAT
specification- time_format type=string
Fortran style format code to specify the format of the time in the
FORMAT
property; 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 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_LOG
for example
top 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_LOG
for example
top mgfflogger::init
result = mgfflogger::init(parent=parent, name=string, _extra=keywords)
Create logger object.
Return value
1 for success, 0 for failure
Keywords
- parent
parent logger
- name type=string
name of the logger
- _extra type=keywords
any keyword accepted by
MGffLogger::setProperty
File attributes
Modification date: | Sat Jun 21 18:49:18 2014 |
Lines: | 168 |
Docformat: | rst rst |
Contact me if you have enhancement requests or bug fixes.