gbp :: log :: GbpStreamHandler :: Class GbpStreamHandler

[hide private]
[frames] | no frames]

# Class GbpStreamHandler

          object --+
                   |
    logging.Filterer --+
                       |
         logging.Handler --+
                           |
       logging.StreamHandler --+
                               |
                              GbpStreamHandler

Special stream handler for enabling colored output

Instance Methods | [hide private]

__init__(self, stream=None, color=`'``auto``'`) Initialize the handler. |

set_color(self, color) Set/unset colorized output |

set_color_scheme(self, color_scheme=`{``}`) Set logging colors |

set_format(self, fmt) Set logging format |

_use_color(self) Check if to print in color or not |

format(self, record) Colorizing formatter |

Inherited from `logging.StreamHandler`: `emit`, `flush`

Inherited from `logging.Handler`: `acquire`, `close`, `createLock`, `get_name`, `handle`, `handleError`, `release`, `setFormatter`, `setLevel`, `set_name`

Inherited from `logging.Filterer`: `addFilter`, `filter`, `removeFilter`

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]

| COLOR_SEQ = ``'``\x1b[%dm``'``
| OFF_SEQ = ``'``\x1b[0m``'``

Properties | [hide private]

Inherited from `logging.Handler`: `name` Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, stream=None, color=`'``auto``'`)
(Constructor)

Initialize the handler.

If stream is not specified, sys.stderr is used.

Overrides: object.__init__
  (inherited documentation)

### format(self, record)

Colorizing formatter

Overrides: logging.Handler.format