nemoguardrails.guardrails

View as Markdown

Submodules

Package Contents

Functions

NameDescription
configure_loggingConfigure logging for the nemoguardrails.guardrails package.

Data

DEFAULT_DATEFMT

DEFAULT_FORMAT

API

nemoguardrails.guardrails.configure_logging(
level: int = logging.INFO,
formatter: logging.Formatter | None = None,
handler: logging.Handler | None = None
) -> logging.Logger

Configure logging for the nemoguardrails.guardrails package.

Attaches a handler if none exist, or updates existing handlers if they do. If a handler is provided on repeat calls, it is ignored to avoid accumulating handlers. Sets level and formatter of all handlers so that all modules under this package (model_engine, api_engine, rails_manager, etc.) inherit the same settings.

nemoguardrails.guardrails.DEFAULT_DATEFMT = '%Y-%m-%d %H:%M:%S'
nemoguardrails.guardrails.DEFAULT_FORMAT = '%(asctime)s %(levelname)s: %(message)s'