Skip to content

Commit 91a4cc6

Browse files
authored
Merge branch 'main' into Inheco-Incubator-Shaker-Integration
2 parents 9448c89 + 4663d6b commit 91a4cc6

File tree

10 files changed

+822
-601
lines changed

10 files changed

+822
-601
lines changed

pylabrobot/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import datetime
22
import logging
3+
import sys
34
from pathlib import Path
45
from typing import Optional, Union
56

@@ -64,3 +65,21 @@ def configure(cfg: Config):
6465

6566

6667
configure(CONFIG)
68+
69+
70+
def verbose(make_verbose: bool, level: int = logging.INFO) -> None:
71+
"""Add a StreamHandler to the pylabrobot logger to make logging output visible to the console.
72+
If set to False, remove the console StreamHandler. This only removes StreamHandlers that output
73+
to sys.stdout or sys.stderr, and will not affect FileHandlers or other subclasses.
74+
"""
75+
logger = logging.getLogger("pylabrobot")
76+
for handler in logger.handlers[:]: # iterate over a copy to allow safe removal
77+
if isinstance(handler, logging.StreamHandler) and not isinstance(handler, logging.FileHandler):
78+
if handler.stream in (sys.stdout, sys.stderr):
79+
logger.removeHandler(handler)
80+
if make_verbose:
81+
logger.setLevel(level)
82+
handler = logging.StreamHandler()
83+
handler.setLevel(level)
84+
handler.setFormatter(logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s"))
85+
logger.addHandler(handler)

pylabrobot/plate_reading/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
from .biotek_backend import Cytation5Backend, Cytation5ImagingConfig
1+
from .agilent_biotek_backend import BioTekPlateReaderBackend
2+
from .agilent_biotek_cytation_backend import (
3+
Cytation5Backend,
4+
Cytation5ImagingConfig,
5+
CytationBackend,
6+
CytationImagingConfig,
7+
)
8+
from .agilent_biotek_synergyh1_backend import SynergyH1Backend
29
from .chatterbox import PlateReaderChatterboxBackend
310
from .clario_star_backend import CLARIOstarBackend
411
from .image_reader import ImageReader

0 commit comments

Comments
 (0)