Overwriting the "codecarbon" logger handler with ours, which is closer to their example. This would require either setting the tracker at the same time as our logger, or accessing the root logger, and also returns fewer details:
2024-07-10 17:23:48,206 - codecarbon : INFO Energy consumed for RAM : 0.000005 kWh. RAM Power : 5.823497772216797 W
2024-07-10 17:23:48,206 - codecarbon : INFO Energy consumed for all CPUs : 0.000006 kWh. Total CPU Power : 7.5 W
2024-07-10 17:23:48,206 - codecarbon : INFO 0.000011 kWh of electricity used since the beginning.
Use the @track_emissions decorator, which would either require a global logger object to pass correctly, or we use other output options e.g. the csv file, which would probably be the simplest implementation.
Resolves #68
See https://codecarbon.io/ and https://mlco2.github.io/codecarbon/index.html
There are quite a few alternative implementations, but this is one option, which adds a section to the log, based on the documentation e.g.:
Alternatives include:
Overwriting the
"codecarbon"
logger handler with ours, which is closer to their example. This would require either setting the tracker at the same time as our logger, or accessing the root logger, and also returns fewer details:Use the
@track_emissions
decorator, which would either require a globallogger
object to pass correctly, or we use other output options e.g. the csv file, which would probably be the simplest implementation.