Exemplo n.º 1
0
def test_config_ophyd_logging():
    datefmt = "%Y:%m:%d %H-%M-%S"

    log.config_ophyd_logging(
        file="ophyd.log",
        datefmt=datefmt,
        color=False,
        level="DEBUG",
    )

    assert isinstance(log.current_handler, logging.FileHandler)
    assert log.current_handler.formatter.datefmt == datefmt
    assert log.logger.getEffectiveLevel() <= logging.DEBUG
    assert log.control_layer_logger.getEffectiveLevel() <= logging.DEBUG
Exemplo n.º 2
0
def main(args):
    config_ophyd_logging(level="DEBUG")
    plugin = create_plugin(args[0])
    setup_plugin(plugin, args[1])
    take_image(plugin)
Exemplo n.º 3
0
def test_default_config_ophyd_logging():
    log.config_ophyd_logging()

    assert isinstance(log.current_handler, logging.StreamHandler)
    assert log.logger.getEffectiveLevel() <= logging.WARNING
    assert log.control_layer_logger.getEffectiveLevel() <= logging.WARNING
Exemplo n.º 4
0
from bluesky.callbacks.best_effort import BestEffortCallback
from bluesky.log import config_bluesky_logging

from ophyd.log import config_ophyd_logging

# from databroker import Broker

# The following plans/devices must be imported (otherwise plan parsing wouldn't work)
from ophyd.sim import det1, det2, motor  # noqa: F401
from bluesky.plans import count, scan  # noqa: F401

import logging
logger = logging.getLogger(__name__)

config_bluesky_logging(level='INFO')
config_ophyd_logging(level='INFO')

mpl_logger = logging.getLogger("matplotlib")
mpl_logger.setLevel(logging.WARNING)


class RunEngineWorker(Process):
    """
    The class implementing Run Engine Worker thread.

    Parameters
    ----------
    conn
        The end of bidirectional (input/output) pipe.
    """
    def __init__(self, *, conn, db):