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

  • name – name of the logging.Logger to log to

  • message – 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 are


for the new demand being set,

demand, supply, utilisation and allocation

for the current state of target, and


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. Use allocation instead.

property demand

The volume of resources to be provided by this site

property name: str