equinor / equinor/ccs-scripts

Print warnings summary at the end up the scripts

Open
#462 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
2
Forks
2
Avg merge
5d 23h
Merged PRs (30d)
2

Description

Now the user has to look at the entire log output to check for warnings. They are colored (#334), but it would still be nice to have a warnings summary at the end of the scripts, after the Performance Timing Report.

Seems very doable with something like this (from copilot):

`
class WarningCollector(logging.Handler):
"""Custom logging handler that collects warning messages."""

def __init__(self):
super().__init__()
self.warnings = []

def emit(self, record):
if record.levelno == logging.WARNING:
self.warnings.append(self.format(record))

def get_warnings(self):
return self.warnings

def clear(self):
self.warnings = []
`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.