stylish.logging

stylish.logging.root = <sawmill.handler.distribute.Distribute object>

Top level handler responsible for relaying all logs to other handlers.

stylish.logging.configure(stderr_level='info')[source]

Configure logging handlers.

A standard error handler is created to output any message with a level greater than stderr_level.

A file handler is created to log warnings and greater to stylish/logs under system temporary directory.

Note

Standard Python logging are redirected to sawmill to unify the logging systems.

class stylish.logging.Formatter(template, with_color=True)[source]

Mustache template to format logs.

__init__(template, with_color=True)[source]

Initialize with Mustache template.

format(logs)[source]

Format logs for display.

class stylish.logging.Logger(name, **kw)[source]

Extended logger with timestamp and username information.

prepare(*args, **kw)[source]

Prepare and return a log for emission.

__init__(name, **kw)

Initialise logger with identifying name.

clear() → None. Remove all items from D.
clone()

Return a clone of this log.

This is a mixture of shallow and deep copies where the log instance and its attributes are shallow copied, but the actual mapping (items) are deepcopied.

copy() → a shallow copy of D
debug(message, **kw)

Log a debug level message.

error(message, **kw)

Log an error level message.

fromkeys()

Create a new dictionary with keys from iterable and values set to value.

get(k[, d]) → D[k] if k in D, else d. d defaults to None.
info(message, **kw)

Log an info level message.

items() → a set-like object providing a view on D's items
keys() → a set-like object providing a view on D's keys
log(message, **kw)

Log a message with additional kw arguments.

pop(k[, d]) → v, remove specified key and return the corresponding value.

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem() → (k, v), remove and return some (key, value) pair

as a 2-tuple; but raise KeyError if D is empty.

setdefault(k[, d]) → D.get(k,d), also set D[k]=d if k not in D
update([E, ]**F) → None. Update D from mapping/iterable E and F.

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values() → an object providing a view on D's values
warning(message, **kw)

Log a warning level message.