heros.helper - heros 0.8.1 documentation

Skip to content
Back to top
View this page

# heros.helper

## Attributes

`SPAM` |
`log` |

## Classes

`Logger` | Instances of the Logger class represent a single logging channel. A

## Functions

`object_name_from_keyexpr`(key_expr, ns_objects, realm) |
`full_classname`(o) | Return the fully qualified class name of an object.
`get_logger`(→ Logger) |

## Module Contents

heros.helper.object_name_from_keyexpr(key_expr, ns_objects, realm, endpoint='.*')

heros.helper.full_classname(o)

  Return the fully qualified class name of an object.

  Parameters:

    o – object

  Returns:

    fully qualified module and class name

heros.helper.SPAM = 5

class heros.helper.Logger(name, level=NOTSET)

  Bases: `logging.Logger`

  Instances of the Logger class represent a single logging channel. A “logging channel” indicates an area of an application. Exactly how an “area” is defined is up to the application developer. Since an application can have any number of areas, logging channels are identified by a unique string. Application areas can be nested (e.g. an area of “input processing” might include sub-areas “read CSV files”, “read XLS files” and “read Gnumeric files”). To cater for this natural nesting, channel names are organized into a namespace hierarchy where levels are separated by periods, much like the Java or Python package namespace. So in the instance given above, channel names might be “input” for the upper level, and “input.csv”, “input.xls” and “input.gnu” for the sub-levels. There is no arbitrary limit to the depth of nesting.

  setLevel(level, globally=False)

    Set logger level; optionally propagate to all existing loggers.

  spam(msg, *args, **kwargs)

    Log a SPAM-level message.

heros.helper.get_logger(name: str = 'heros') → Logger

heros.helper.log