Exemplo n.º 1
0
''' '''

import sys
import logging
from ophyd.utils.startup import setup as setup_ophyd
import ophyd

setup_ophyd()

LOG_FORMAT = "%(asctime)-15s [%(name)5s:%(levelname)s] %(message)s"
EXAMPLE_LOGGER = 'ophyd_examples'


def setup_loggers(logger_names, fmt=LOG_FORMAT):
    fmt = logging.Formatter(LOG_FORMAT)
    for name in logger_names:
        logger = logging.getLogger(name)
        logger.setLevel(logging.DEBUG)

        handler = logging.StreamHandler(sys.stdout)
        handler.setFormatter(fmt)
        logger.addHandler(handler)


setup_loggers((EXAMPLE_LOGGER, ))
logger = logging.getLogger(EXAMPLE_LOGGER)

motor_recs = [
    'XF:31IDA-OP{Tbl-Ax:X1}Mtr',
    'XF:31IDA-OP{Tbl-Ax:X2}Mtr',
    'XF:31IDA-OP{Tbl-Ax:X3}Mtr',
Exemplo n.º 2
0
''' '''

import sys
import logging
from ophyd.utils.startup import setup as setup_ophyd
import ophyd

setup_ophyd()


LOG_FORMAT = "%(asctime)-15s [%(name)5s:%(levelname)s] %(message)s"
EXAMPLE_LOGGER = 'ophyd_examples'


def setup_loggers(logger_names, fmt=LOG_FORMAT):
    fmt = logging.Formatter(LOG_FORMAT)
    for name in logger_names:
        logger = logging.getLogger(name)
        logger.setLevel(logging.DEBUG)

        handler = logging.StreamHandler(sys.stdout)
        handler.setFormatter(fmt)
        logger.addHandler(handler)


setup_loggers((EXAMPLE_LOGGER, ))
logger = logging.getLogger(EXAMPLE_LOGGER)


motor_recs = ['XF:31IDA-OP{Tbl-Ax:X1}Mtr',
              'XF:31IDA-OP{Tbl-Ax:X2}Mtr',
Exemplo n.º 3
0
def setup_package():
    setup_ophyd()