logger
Runtime-backed logging for pyRevit.
Attributes
DEFAULT_LOGGING_LEVEL = logging.WARNING
module-attribute
DEPRECATE_LOG_LEVEL = 25
module-attribute
SUCCESS_LOG_LEVEL = 80
module-attribute
loggers = {}
module-attribute
Classes
LoggerWrapper(name, bound_service=None)
Bases: object
Small Python facade over the active runtime logging service.
Source code in pyrevitlib/pyrevit/coreutils/logger.py
Attributes
name = name
instance-attribute
warn = warning
class-attribute
instance-attribute
Methods:
debug(message, *args, **kwargs)
info(message, *args, **kwargs)
warning(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
critical(message, *args, **kwargs)
success(message, *args, **kwargs)
deprecate(message, *args, **kwargs)
isEnabledFor(level)
is_enabled_for(level)
has_errors()
set_level(level)
set_quiet_mode()
set_verbose_mode()
set_debug_mode()
reset_level()
get_level()
log_parse_except(parsed_file, parse_ex)
Source code in pyrevitlib/pyrevit/coreutils/logger.py
dev_log(source, message='')
Append a developer note to a log file in pyRevit's log folder.
Notes are written only while the debug level is on, so a script can
record handled errors without leaving files behind for end users. The
file is named after the command unique id, then after this logger,
then pyrevit. A callback defined in a command script keeps that
command's id; a caller without a command execution scope gets the id of
the command running at the time, if any.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
source of the message |
required |
message
|
str
|
message to log |
''
|
Source code in pyrevitlib/pyrevit/coreutils/logger.py
Functions:
get_logger(logger_name)
Return the cached runtime-backed facade for logger_name.
Source code in pyrevitlib/pyrevit/coreutils/logger.py
get_bound_logger(logger_name)
Return a logger bound to the current command's service.
Source code in pyrevitlib/pyrevit/coreutils/logger.py
set_file_logging(status)
Enable or disable the runtime-owned default log file.
loggers_have_errors()
Return whether the active runtime logging service recorded an error.
Source code in pyrevitlib/pyrevit/coreutils/logger.py
get_runtime_logfile_path()
Return the path of the current session's default runtime log file.
Resolved by the runtime logging service so callers always agree with where the file is actually written. Returns None if it can't be determined.