Skip to content

Commit 1ef1043

Browse files
committed
[TASK] logging changed to info level
1 parent 6d6dae2 commit 1ef1043

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

src/dt4acc/core/utils/logger.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import functools
12
import logging
3+
logging.basicConfig(level=logging.INFO)
24

5+
@functools.lru_cache(maxsize=None)
36
def setup_logger(name):
47
"""
58
Setup and return a logger.
@@ -13,4 +16,5 @@ def setup_logger(name):
1316
return logger
1417

1518
def get_logger():
16-
return logging.getLogger("dt4acc")
19+
return setup_logger("dt4acc")
20+
# return logging.getLogger("dt4acc")

src/dt4acc/custom_tango/ioc/devices/master_clock_device.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,18 @@ class MasterClockDevice(Device):
2222

2323
def init_device(self):
2424
"""Initialize the device with default values matching EPICS master clock PV setup."""
25+
26+
logger.warning("\n[DEBUG] Master Clock Device initialized successfully:")
2527
Device.init_device(self)
2628
self.set_state(DevState.ON)
27-
29+
2830
# Initialize master clock data matching EPICS initialize_master_clock_pvs()
2931
self._initialize_master_clock_data()
30-
31-
logger.info("MasterClockDevice initialized successfully")
3232

33+
logger.warning(f" - Device properties: {self._frequency=}, {self._ref_freq=}, {self._ref_freq_khz_up=}, {self._ref_freq_khz_frac=}")
34+
# logger.info("MasterClockDevice initialized successfully")
35+
36+
logger.warning(f" - Device name from get_name(): {self.name}")
3337
def _initialize_master_clock_data(self):
3438
"""Initialize master clock data matching EPICS initialize_master_clock_pvs()."""
3539
try:

src/dt4acc/custom_tango/ioc/devices/tune_device.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def init_device(self):
3131
self._tune_y = 0.0
3232
self._count = 0
3333

34-
logger.info("TuneDevice initialized successfully")
34+
logger.warning("TuneDevice initialized successfully")
35+
3536

3637
@attribute(
3738
name="TUNECC/x",
@@ -48,7 +49,7 @@ def tune_x(self) -> float:
4849
def tune_x(self, value: float):
4950
"""Set tune X value."""
5051
self._tune_x = float(value)
51-
logger.info(f"Updated tune X to {value}")
52+
logger.warning(f"Updated tune X to {value}")
5253

5354
@attribute(
5455
name="TUNECC/y",
@@ -65,7 +66,7 @@ def tune_y(self) -> float:
6566
def tune_y(self, value: float):
6667
"""Set tune Y value."""
6768
self._tune_y = float(value)
68-
logger.info(f"Updated tune Y to {value}")
69+
logger.warning(f"Updated tune Y to {value}")
6970

7071
@attribute(
7172
name="TUNECC/count",
@@ -81,15 +82,15 @@ def count(self) -> int:
8182
def count(self, value: int):
8283
"""Set tune count."""
8384
self._count = int(value)
84-
logger.info(f"Updated tune count to {value}")
85+
logger.warning(f"Updated tune count to {value}")
8586

8687
@command(dtype_in=None, doc_in="Reset tune values to defaults")
8788
def reset(self):
8889
"""Reset tune values to defaults."""
8990
self._tune_x = 0.0
9091
self._tune_y = 0.0
9192
self._count = 0
92-
logger.info("Tune device reset to default values")
93+
logger.warning("Tune device reset to default values")
9394
return "Tune device reset to default values"
9495

9596
@command(dtype_in=None, doc_in="Get tune information")

0 commit comments

Comments
 (0)