Beispiel #1
0
def _trc_msg_direct(level):
    atm = (level, "direct _ec message:" + str(level * 77), "A1,B2,python",
           "MyFile.py", "MyFunc", 4242)
    import _streamsx_ec
    _streamsx_ec._app_trc(atm)
    ctl = _streamsx_ec._app_trc_level()
    print("Current Trace level:", ctl, logging.getLevelName(ctl))
Beispiel #2
0
def _setup():
    if _is_supported():
        trc_lvl = _ec._app_trc_level()
        # Python does not have the concept of OFF
        if trc_lvl == 0:
            trc_lvl = logging.CRITICAL
        _ROOT_LOGGER = logging.getLogger()
        _ROOT_LOGGER.addHandler(_AppHandler(trc_lvl, _ec._app_trc));
        _ROOT_LOGGER.setLevel(trc_lvl)

        log_lvl = _ec._app_log_level()
        # Python does not have the concept of OFF
        if log_lvl == 0:
            log_lvl = logging.CRITICAL
        _STREAMS_LOG = logging.getLogger('com.ibm.streams.log')
        _STREAMS_LOG.propagate = False
        _STREAMS_LOG.addHandler(_AppHandler(log_lvl, _ec._app_log));
        _STREAMS_LOG.setLevel(log_lvl)
Beispiel #3
0
def _setup():
    if _is_supported():
        trc_lvl = _ec._app_trc_level()
        # Python does not have the concept of OFF
        if trc_lvl == 0:
            trc_lvl = logging.CRITICAL
        _ROOT_LOGGER = logging.getLogger()
        _ROOT_LOGGER.addHandler(_AppHandler(trc_lvl, _ec._app_trc))
        _ROOT_LOGGER.setLevel(trc_lvl)

        log_lvl = _ec._app_log_level()
        # Python does not have the concept of OFF
        if log_lvl == 0:
            log_lvl = logging.CRITICAL
        _STREAMS_LOG = logging.getLogger('com.ibm.streams.log')
        _STREAMS_LOG.propagate = False
        _STREAMS_LOG.addHandler(_AppHandler(log_lvl, _ec._app_log))
        _STREAMS_LOG.setLevel(log_lvl)
Beispiel #4
0
def _setup():
    if _is_supported():
        trace = logging.getLogger()
        if 'trace' not in _LOGGERS:
            _LOGGERS['trace'] = trace
            trc_lvl = _ec._app_trc_level()
            # Python does not have the concept of OFF
            if trc_lvl == 0:
                trc_lvl = logging.CRITICAL
            trace.addHandler(_AppHandler(trc_lvl, _ec._app_trc));
            trace.setLevel(trc_lvl)

        log = logging.getLogger('com.ibm.streams.log')
        if 'log' not in _LOGGERS:
            _LOGGERS['log'] = log
            log_lvl = _ec._app_log_level()
            # Python does not have the concept of OFF
            if log_lvl == 0:
                log_lvl = logging.CRITICAL
            log.propagate = False
            log.addHandler(_AppHandler(log_lvl, _ec._app_log));
            log.setLevel(log_lvl)
Beispiel #5
0
def _setup():
    if _is_supported():
        trace = logging.getLogger()
        if 'trace' not in _LOGGERS:
            _LOGGERS['trace'] = trace
            trc_lvl = _ec._app_trc_level()
            # Python does not have the concept of OFF
            if trc_lvl == 0:
                trc_lvl = logging.CRITICAL
            trace.addHandler(_AppHandler(trc_lvl, _ec._app_trc))
            trace.setLevel(trc_lvl)

        log = logging.getLogger('com.ibm.streams.log')
        if 'log' not in _LOGGERS:
            _LOGGERS['log'] = log
            log_lvl = _ec._app_log_level()
            # Python does not have the concept of OFF
            if log_lvl == 0:
                log_lvl = logging.CRITICAL
            log.propagate = False
            log.addHandler(_AppHandler(log_lvl, _ec._app_log))
            log.setLevel(log_lvl)
def _trc_msg_direct(level):
    atm = (level, "direct _ec message:" + str(level*77), "A1,B2,python", "MyFile.py", "MyFunc", 4242)
    import _streamsx_ec
    _streamsx_ec._app_trc(atm)
    ctl = _streamsx_ec._app_trc_level()
    print("Current Trace level:", ctl, logging.getLevelName(ctl))