Closed dahlia closed 3 years ago
Merged, thank you ! Please definitely get in touch and let me know how you are using the module, i'm very interested.
Thank you for merging my patch! When would you make a new release?
Please definitely get in touch and let me know how you are using the module, i'm very interested.
I use this module in my small command-line program to generate HTML code. As my project consists of polyglot scripts and they are glued using Makefile, all these programs communicate each other through pipe. This module's previous behavior mixed its own logging messages with HTML code, and it leads the browser to render unwanted result.
@dahlia I just pushed v0.9 : https://pypi.org/project/pinyin_jyutping_sentence/#history
Thank you!
The previous behavior of the module made CLI programs to be consumed by other programs through pipe cannot use it, because its
print()
calls pollute programs' stdout. For example, if a program purposes to write a valid JSON into stdout and be consumed by other program which reads a valid JSON through stdin (e.g.,jq
), the consumer program fails to parse it because its input is not a valid JSON due to the module's log messages.Rather than printing these log messages into stdout, I changed it to use
logging
module instead. The standardlogging
module can be handled by a client code and silences log messages by default.