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