Skip to content
This repository was archived by the owner on May 3, 2021. It is now read-only.

HelperObjectsDocs

Simon Olofsson edited this page Apr 9, 2020 · 2 revisions

Helper objects documentation

This file contains documentation for classes that are objects intended to make development simpler. They are not intended for inheritance but to use as a part of your toolbox when creating Features with CommandIntegrator.

logger

The @logger decorator above your methods allows simple, pragmatic and unified logging across your tech stack. It is a closure, also referred to as a wrapper method which will automatically log the arguments, keyword arguments and return of your method, including logging errors as ERROR log level if errors are encountered during the method execution.

Usage Example
from CommandIntegrator.logger import logger

@logger
def add_ints(a: int, b: int) -> int:
    return a + b

s = add_ints(a = 4, b = 4)
Result in runtime.log file located in execution directory

2020-04-02 09:41:32,185:DEBUG:CI Logger: Ran method "add" in __main__ with ARGS: () & KWARGS: {a: 4, b: 4} & RETURN: 8

RestApiHandle

Documentation will be written shortly.

Clone this wiki locally