Closed coleramos425 closed 7 months ago
Per our conversation last week, I revisited all logging in Omniperf to move towards a consistent approach. The changes in this branch introduce dedicated logging helpers for each supported log level:
Now, we only import the logging module in src/utils/utils.py (where these helpers are defined) and utilize the helpers everywhere else.
logging
In our logging, sometimes we want to call out the specific module (i.e. profiling, analysis, database) that a log message is coming from for context, i.e. https://github.com/AMDResearch/omniperf/blob/78b58f8df66db65f5d1377772ca83cb2d443e6bc/src/omniperf_profile/profiler_base.py#L334-L337 other times the context isn't needed https://github.com/AMDResearch/omniperf/blob/78b58f8df66db65f5d1377772ca83cb2d443e6bc/src/omniperf_profile/profiler_base.py#L296
for this, we can provide two arguments, where the first is the module to "pretty-print" in the log, i.e.
The PR also adds color to our console output for improved readability.
try something like loguru?:)
Superseded by #308.
Per our conversation last week, I revisited all logging in Omniperf to move towards a consistent approach. The changes in this branch introduce dedicated logging helpers for each supported log level:
Now, we only import the
logging
module in src/utils/utils.py (where these helpers are defined) and utilize the helpers everywhere else.In our logging, sometimes we want to call out the specific module (i.e. profiling, analysis, database) that a log message is coming from for context, i.e. https://github.com/AMDResearch/omniperf/blob/78b58f8df66db65f5d1377772ca83cb2d443e6bc/src/omniperf_profile/profiler_base.py#L334-L337 other times the context isn't needed https://github.com/AMDResearch/omniperf/blob/78b58f8df66db65f5d1377772ca83cb2d443e6bc/src/omniperf_profile/profiler_base.py#L296
for this, we can provide two arguments, where the first is the module to "pretty-print" in the log, i.e.
The PR also adds color to our console output for improved readability.