Open n8sty opened 3 years ago
Hello @n8sty, You are right ! We need to transition from raw printing to logging. Could you open a PR on this ?
Thanks for the feedback! Diviyan
Hi again @n8sty , Were you able to work on this matter ?
Kind regards, Diviyan
I should have an opportunity to take a crack it soon, maybe in a week or two. Do you have any particular features you'd like for the logging setup? I was thinking of just attaching a NullHandler
and replacing all of the print
statements with calls to my best guess at an appropriately leveled log message. If this sounds good, I should hopefully have a PR open in a week or two since it's not too much work.
I'm using cdt (thanks for this package!) in a few different toy projects. I'm wondering whether it would tolerable to replace calls to
print
that are used for logging (eg: https://github.com/FenTechSolutions/CausalDiscoveryToolbox/blob/184b33d218259b511772f4e089d201c0ddeaa019/cdt/causality/graph/model.py#L69) to an actual logger. This would make it a bit easier to observe processes that use cdt through regular means. It's also possible for me to redirect stdout/err to a logger so this isn't a huge blocking problem, but I do think it would make this package just that much easier to integrate into larger projects. I'd be happy to open a PR to this effect.