aboutsummaryrefslogtreecommitdiff
path: root/gn3/debug.py
blob: 945e23748a7d15c35f58ebe0805ab49dd46c6b32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Debug utilities"""
import logging
from flask import current_app

__this_module_name__ = __name__

def getLogger():
    return (
        logging.getLogger(__this_module_name__)
        if not bool(current_app)
        else current_app.logger)

def __pk__(*args):
    value = args[-1]
    title_vals = " => ".join(args[0:-1])
    logger = getLogger()
    logger.debug("%s: %s", title_vals, value)
    return value