Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update logconfig by setting loglevel to warning. #28

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions pysignalscope/logconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,12 @@ def setup_logging():
You can adjust (suppress logging) of signal files by setting a higher level for this particular file.
"""
# Set logging level for all imported modules
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(funcName)s - %(message)s')
logging.basicConfig(level=logging.WARNING, format='%(asctime)s - %(name)s - %(levelname)s - %(funcName)s - %(message)s')

# Set logging level for my modules
# Set logging level for my modules (only valid if basic config is set less equal selected loglevel)
# Logger for scope
Lm_logger = logging.getLogger('scope')
Lm_logger.setLevel(logging.DEBUG)
# Logger for color
ts_logger = logging.getLogger('color')
ts_logger.setLevel(logging.DEBUG)
# Logger for generalplotsettings
tf_logger = logging.getLogger('generalplotsettings')
tf_logger.setLevel(logging.DEBUG)
# Logger for function
Lm_logger = logging.getLogger('function')
Lm_logger.setLevel(logging.DEBUG)

###############################################################################################
# Do not change the lines below. These suppress logging information of external modules
Expand Down
16 changes: 8 additions & 8 deletions pysignalscope/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def from_tektronix(csv_file: str) -> List['Channel']:

# Log user error Empty csv-file
if channel_count == 0:
logging.info(f"{class_modulename} : Invalid file or file without content")
logging.warning(f"{class_modulename} : Invalid file or file without content")

# Log flow control
logging.debug(f"{class_modulename} :FlCtl Channel counts {channel_counts}, File {csv_file}")
Expand Down Expand Up @@ -370,15 +370,15 @@ def from_tektronix_mso58(*csv_files: str) -> List['Channel']:

# Log user error Empty csv-file
if not ch1_data:
logging.info(f"{class_modulename} : file {csv_file}->Invalid file or file without content")
logging.warning(f"{class_modulename} : file {csv_file}->Invalid file or file without content")

tektronix_channels.append(Scope.generate_channel(
time, ch1_data, source=channel_source, label=os.path.basename(csv_file).replace('.csv', ''),
unit=None, linestyle=None, color=None))

# Log user error Empty csv-file
if not tektronix_channels:
logging.info(f"{class_modulename} : file {csv_files}-> Invalid file list or files without content")
logging.warning(f"{class_modulename} : file {csv_files}-> Invalid file list or files without content")

# Log flow control
logging.debug(f"{class_modulename} :FlCtl {csv_files}")
Expand Down Expand Up @@ -419,7 +419,7 @@ def from_tektronix_mso58_multichannel(csv_file: str) -> List['Channel']:

# Log user error Empty csv-file
if channel_count == 0:
logging.info(f"{class_modulename} : Invalid file or file without content", class_modulename)
logging.warning(f"{class_modulename} : Invalid file or file without content", class_modulename)

# Log flow control
logging.debug(f"{class_modulename} :FlCtl Channel counts {channel_count},File {csv_file}")
Expand Down Expand Up @@ -465,7 +465,7 @@ def from_lecroy(*csv_files: str) -> List['Channel']:

# Log user error Empty csv-file
if not lecroy_channel:
logging.info(f"{class_modulename} : {csv_files} Invalid file list or files without content")
logging.warning(f"{class_modulename} : {csv_files} Invalid file list or files without content")

# Log flow control
logging.debug(f"{class_modulename} :FlCtl {csv_file}")
Expand Down Expand Up @@ -516,7 +516,7 @@ def from_lecroy_remote(scope_channel_number: int, ip_address: str, label: str) -
else: # "else-case"
channel = None
# Log user info
logging.info(f"{class_modulename} : Requested channel number {scope_channel_number} is out of range (1-8)")
logging.warning(f"{class_modulename} : Requested channel number {scope_channel_number} is out of range (1-8)")
print("No fitting channel found!")

# Log flow control
Expand Down Expand Up @@ -734,7 +734,7 @@ def add(*channels: 'Channel') -> 'Channel':

# Log missing channel input, if amount of channels is one
if len(channels) == 1:
logging.info(f"{class_modulename} :Only on channel was provided. No channel was added.")
logging.info(f"{class_modulename} :Only one channel was provided. No channel was added.")
# Log flow control

logging.debug(f"{class_modulename} :FlCtl Amount of channels, which are added={len(channels)}")
Expand Down Expand Up @@ -776,7 +776,7 @@ def subtract(*channels: 'Channel') -> 'Channel':

# Log missing channel input, if amount of channels is one
if len(channels) == 1:
logging.info(f"{class_modulename} :Only on channel was provided. No channel was subtracted.")
logging.info(f"{class_modulename} :Only one channel was provided. No channel was subtracted.")
# Log flow control

# Log flow control
Expand Down
Loading