CausalDiscoveryToolbox icon indicating copy to clipboard operation
CausalDiscoveryToolbox copied to clipboard

Replace printing with logging

Open n8sty opened this issue 5 years ago • 3 comments

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.

n8sty avatar Aug 15 '20 20:08 n8sty

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

diviyank avatar Aug 17 '20 08:08 diviyank

Hi again @n8sty , Were you able to work on this matter ?

Kind regards, Diviyan

diviyank avatar Nov 25 '20 08:11 diviyank

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.

n8sty avatar Feb 05 '21 04:02 n8sty