lib.log

class lib.log.Log(smarthome, name, mapping, maxlen=50)[Quellcode]

Bases: collections.deque

add(entry)[Quellcode]

Just adds a log entry to the left side of the queue. If the queue already holds maxlen entries, the rightmost will be discarded automatically.

clean(dt)[Quellcode]

Assuming dt to be a datetime: remove all entries that are smaller or equal to this given datetime from the right side of the queue

export(number)[Quellcode]

Returns up to number entries from the log and prepares them together with the mapping

last(number)[Quellcode]

Returns the last number entries of the log