Configuration¶
The CLI application can bind argument values from the environment. The command-line provides variable names and type information. The OS environment provides string values.
export x=6
export y=7
celpy -n --arg x:int --arg y:int 'x*y'
42
While this example uses the OS environment, it isn’t the usual sense of configuration. The only configuration options available for the command-line application are the logging configuration.
If a celpy.toml
file exists in the local directory or the user’s HOME
directory, this will be used to provide logging configuration for the celpy
application.
This file must have a logging
paragraph.
This paragraph can contain the parameters for logging configuration.
[logging]
version = 1
formatters.minimal.format = "%(message)s"
formatters.console.format = "%(levelname)s:%(name)s:%(message)s"
formatters.details.format = "%(levelname)s:%(name)s:%(module)s:%(lineno)d:%(message)s"
root.level = "WARNING"
root.handlers = ["console"]
[logging.handlers.console]
class = "logging.StreamHandler"
formatter = "console"
To enable very detailed debugging, do the following:
Set the
CEL_TRACE
environment variable to some non-empty value, like"true"
. This enables a@trace
decorator on some evaluation methods.In a
[logging.loggers.celpy.Evaluator]
paragraph, setlevel = "DEBUG"
.Set the
[logging]
paragraph, setroot.level = "DEBUG"
.