ROCm / rocprofiler-compute

Advanced Profiling and Analytics for AMD Hardware
https://rocm.docs.amd.com/projects/omniperf/en/latest/
MIT License
135 stars 49 forks source link

Improving 2.x logging #236

Closed coleramos425 closed 7 months ago

coleramos425 commented 9 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.

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.

image

The PR also adds color to our console output for improved readability.

feizheng10 commented 8 months ago

try something like loguru?:)

koomie commented 7 months ago

Superseded by #308.