From e207b8c931be08770cf94c373bf3abf3c4c955c1 Mon Sep 17 00:00:00 2001 From: Dominic Canare Date: Fri, 26 Jul 2024 16:50:02 -0400 Subject: [PATCH] cleanup logging --- src/pupil_labs/neon_recording/__init__.py | 2 -- src/pupil_labs/neon_recording/neon_recording.py | 11 ++++------- .../neon_recording/stream/av_stream/base_av_stream.py | 2 +- src/pupil_labs/neon_recording/stream/event_stream.py | 2 +- .../neon_recording/stream/eye_state_stream.py | 2 +- src/pupil_labs/neon_recording/stream/gaze_stream.py | 6 +++--- .../neon_recording/stream/imu/imu_stream.py | 2 +- 7 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/pupil_labs/neon_recording/__init__.py b/src/pupil_labs/neon_recording/__init__.py index a90525c..5ef6d55 100644 --- a/src/pupil_labs/neon_recording/__init__.py +++ b/src/pupil_labs/neon_recording/__init__.py @@ -34,6 +34,4 @@ ], ) -log.info("NeonRecording: package loaded.") - __all__ = ["__version__", "load"] diff --git a/src/pupil_labs/neon_recording/neon_recording.py b/src/pupil_labs/neon_recording/neon_recording.py index 2a3f68f..3aaeb10 100644 --- a/src/pupil_labs/neon_recording/neon_recording.py +++ b/src/pupil_labs/neon_recording/neon_recording.py @@ -45,16 +45,16 @@ def __init__(self, rec_dir_in: Union[pathlib.Path, str]): if not self._rec_dir.exists() or not self._rec_dir.is_dir(): raise FileNotFoundError(f"Directory not found or not valid: {self._rec_dir}") - log.info(f"NeonRecording: Loading recording from {rec_dir_in}") + log.debug(f"NeonRecording: Loading recording from {rec_dir_in}") - log.info("NeonRecording: Loading recording info") + log.debug("NeonRecording: Loading recording info") with open(self._rec_dir / "info.json") as f: self.info = json.load(f) self.start_ts_ns = self.info["start_time"] self.start_ts = self.start_ts_ns * 1e-9 - log.info("NeonRecording: Loading wearer") + log.debug("NeonRecording: Loading wearer") self.wearer = {"uuid": "", "name": ""} with open(self._rec_dir / "wearer.json") as f: wearer_data = json.load(f) @@ -62,7 +62,7 @@ def __init__(self, rec_dir_in: Union[pathlib.Path, str]): self.wearer["uuid"] = wearer_data["uuid"] self.wearer["name"] = wearer_data["name"] - log.info("NeonRecording: Loading calibration data") + log.debug("NeonRecording: Loading calibration data") self._calib = _parse_calib_bin(self._rec_dir) self.calib_version = str(self._calib["version"]) @@ -83,11 +83,8 @@ def __init__(self, rec_dir_in: Union[pathlib.Path, str]): self._calib["left_extrinsics_affine_matrix"], ) - log.info("NeonRecording: Loading data streams") self.streams = {} - log.info("NeonRecording: Finished loading recording.") - @property def gaze(self) -> GazeStream: """ diff --git a/src/pupil_labs/neon_recording/stream/av_stream/base_av_stream.py b/src/pupil_labs/neon_recording/stream/av_stream/base_av_stream.py index 4a5ddee..b018b45 100644 --- a/src/pupil_labs/neon_recording/stream/av_stream/base_av_stream.py +++ b/src/pupil_labs/neon_recording/stream/av_stream/base_av_stream.py @@ -125,7 +125,7 @@ def __init__(self, name, base_name, recording, audio_or_video): self._base_name = base_name self.recording = recording - log.info(f"NeonRecording: Loading video: {self._base_name}.") + log.debug(f"NeonRecording: Loading video: {self._base_name}.") self.video_parts = [] diff --git a/src/pupil_labs/neon_recording/stream/event_stream.py b/src/pupil_labs/neon_recording/stream/event_stream.py index 0ed3a82..c32b955 100644 --- a/src/pupil_labs/neon_recording/stream/event_stream.py +++ b/src/pupil_labs/neon_recording/stream/event_stream.py @@ -17,7 +17,7 @@ class EventStream(Stream): """ def __init__(self, recording): - log.info("NeonRecording: Loading event data") + log.debug("NeonRecording: Loading event data") events_file = recording._rec_dir / "event.txt" time_file = events_file.with_suffix(".time") diff --git a/src/pupil_labs/neon_recording/stream/eye_state_stream.py b/src/pupil_labs/neon_recording/stream/eye_state_stream.py index 316cd1b..54b7162 100644 --- a/src/pupil_labs/neon_recording/stream/eye_state_stream.py +++ b/src/pupil_labs/neon_recording/stream/eye_state_stream.py @@ -33,7 +33,7 @@ class EyeStateStream(Stream): """ def __init__(self, recording): - log.info("NeonRecording: Loading eye state data") + log.debug("NeonRecording: Loading eye state data") eye_state_files = find_sorted_multipart_files(recording._rec_dir, "eye_state") eye_state_data, time_data = load_multipart_data_time_pairs(eye_state_files, "