mlco2 / codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.
https://mlco2.github.io/codecarbon
MIT License
1.18k stars 177 forks source link

Removal of print statement from `codecarbon/input.py` #658

Closed kzscisoft closed 2 months ago

kzscisoft commented 2 months ago

Description

Hello CC development team, just wanted to draw your attention to the presence of the print statement here:

https://github.com/mlco2/codecarbon/blob/49922ad2e8e51ec7cf47e89f6d0cfe026cd4b357/codecarbon/input.py#L43

which in my case is causing the same message to be repeated numerous times quickly filling output to the terminal. I am opening an issue rather than removing it directly in case the statement is needed, if this is the case could it instead be changed to a debug log statement?

Thanks for your time,

Kristian

What I Did

Experimented with custom handler creation for processing the output from CC.

benoit-cty commented 2 months ago

Thanks for reporting this. You could definitely open a PR, print has nothing to do in the package, we must use logger. I think it's a print I introduce to debug, sorry about that.

benoit-cty commented 2 months ago

The 2.7.1 has been released to fix this.

kzscisoft commented 2 months ago

@benoit-cty Thanks for looking into this, I will do next time 🙂