silo.low_code.framework.framework_logging module
Configure the snippet_framework namespace for logging. There are several namespaces in-use:
- snippet_framework: Root namespace. There are typically no
handlers configured for this namespace unless we are running as an async task (UIDebug, dynamic_single). When running in as an async task, a SteamHandler to stderr is added. There is no way to request this logger.
- snippet_framework.internal: Used for logging SF-related messages
that do not require context. These messages should state information about the execution of the SF itself, regardless of ResultContainers. You can request this logger by calling
get_internal_logger
with your current namespace (__name__).
- snippet_framework.module: Used for logging non-SF/non-context
messages. These could be messages that are outside the scope of the Snippet Framework but could be important on a module level such as specific configuration. You can request this logger by calling
get_module_logger
with your current namespace (__name__).
- snippet_framework.step: Used for logging contextually-aware
messages. These messages should come from within a step and state something important about the execution of the step. This namespace is further divided into areas based on LogPolicies. If there is a LogPolicy match, the namespace that is used will be snippet_framework.step.configured_policies. This namespace will container all configured LogPolicies. A single namespace is used so that if a context matches more than one policy, it will have the ability to log into all areas. If there is no LogPolicy match, the namespace used will be snippet_framework.step.generic_step_area. You can request this logger by calling
get_context_logger
with your current ResultContainer that will provide the required context.
- silo.low_code.framework.framework_logging.get_module_logger(name)
Get a logger for the module
This logger is used when any non-contextually aware information needs to be logged.
- Parameters
name (str) – Name of the module
- Returns
Logger that is used for logging non-contextually aware information
- silo.low_code.framework.framework_logging.get_step_adapter(rc, user_logger)
Get a LogAdapter for context-aware log messages based on the user-provided logger
This adapter updates the log messages to use the Framework’s logging header. These messages will not be available in the snippet_framework logfile but will be captured by the WebUIs logging capturing.
- Parameters
rc (ResultContainer) – Result container containing information about the current collection
user_logger (logger) – Logger for the Adapter
- Returns
A logger adapter with extra content headers.
- silo.low_code.framework.framework_logging.get_step_logger(rc)
Get access to the Snippet Frameworks debug function
This allows a step developer access to write to snippet_framework.log through the debug method. It allows tracing for the framework to be handled in a single log file. If the developer wanted to write “Hello, World!” into the snippet_framework log the following commands would need to be run:
debug = get_step_logger(rc) debug("Hello, World!")
- Parameters
rc (ResultContainer) – Result container containing information about the current collection
- Returns
Debug function for the snippet_framework
- Return type
callable