@@ -80,6 +80,14 @@ Uninitialized: Final = 0
8080InitializedSuccessfully : Final = 1
8181InitializationFailed : Final = 2
8282
83+ # LogLevel
84+ LogLevelTrace : Final = 0
85+ LogLevelDebug : Final = 1
86+ LogLevelInfo : Final = 2
87+ LogLevelWarning : Final = 3
88+ LogLevelError : Final = 4
89+ LogLevelCritical : Final = 5
90+
8391g_CFGCommand_ConfigGroup : Final [Literal ["ConfigGroup" ]]
8492g_CFGCommand_ConfigPixelSize : Final [Literal ["ConfigPixelSize" ]]
8593g_CFGCommand_Configuration : Final [Literal ["Config" ]]
@@ -241,6 +249,7 @@ PropertyType = int
241249FocusDirection = int
242250DeviceDetectionStatus = int
243251DeviceInitializationState = int
252+ LogLevel = int
244253AffineTuple = Tuple [float , float , float , float , float , float ]
245254
246255# These are special string types used throughout the API.
@@ -727,6 +736,10 @@ class CMMCore:
727736 """Returns the current position of the stage in microns."""
728737 def getPrimaryLogFile (self ) -> str :
729738 """Return the name of the primary Core log file."""
739+ def getPrimaryLogLevel (self ) -> LogLevel :
740+ """Return the current primary log file level."""
741+ def getStderrLogLevel (self ) -> LogLevel :
742+ """Return the current stderr log level."""
730743 def getProperty (
731744 self , label : DeviceLabel | str , propName : PropertyName | str
732745 ) -> str :
@@ -1002,6 +1015,11 @@ class CMMCore:
10021015 for XY stages that are sequenceable
10031016 """
10041017 @overload
1018+ def log (self , msg : str , level : LogLevel ) -> None : ...
1019+ @overload
1020+ def log (self , msg : str , level : LogLevel , loggerName : str ) -> None :
1021+ """Log a message at the given level."""
1022+ @overload
10051023 def logMessage (self , msg : str ) -> None :
10061024 """Record text message in the log file."""
10071025 @overload
@@ -1200,6 +1218,14 @@ class CMMCore:
12001218 @overload
12011219 def setPrimaryLogFile (self , filename : str , truncate : bool ) -> None :
12021220 """Set the primary Core log file."""
1221+ def setPrimaryLogFileRotation (
1222+ self , maxFileSize : int , maxBackupCount : int
1223+ ) -> None :
1224+ """Set the primary log file rotation parameters."""
1225+ def setPrimaryLogLevel (self , level : LogLevel ) -> None :
1226+ """Set the log level for the primary log file."""
1227+ def setStderrLogLevel (self , level : LogLevel ) -> None :
1228+ """Set the stderr log level."""
12031229 def setProperty (
12041230 self ,
12051231 label : DeviceLabel | str ,
0 commit comments