cobald.decorator.logger module
- class cobald.decorator.logger.Logger(target: Pool, name: Optional[str] = None, message: str = 'demand = %(value)s [demand=%(demand)s, supply=%(supply)s, utilisation=%(utilisation).2f, allocation=%(allocation).2f]', level: int = 20)[source]
Bases:
PoolDecorator
Log a message on every change of
demand
- Parameters
name – name of the
logging.Logger
to log tomessage – format for message to emit on every change
level – numerical logging level
The
message
parameter is used as a%
-style format string with named fields. Valid named format fields arevalue
for the new demand being set,
demand
,supply
,utilisation
andallocation
for the current state of
target
, andtarget
for the
target
pool itself.
For example, a
message
of"adjust demand from %(demand)s to %(value)s"
will log the old and new demand value.Deprecated since version 0.12.2: The
consumption
format field. Useallocation
instead.- property demand
The volume of resources to be provided by this site