Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Logging #1691

Closed
noranraskin opened this issue Jun 24, 2022 · 9 comments · Fixed by idiap/coqui-ai-TTS#3
Closed

Better Logging #1691

noranraskin opened this issue Jun 24, 2022 · 9 comments · Fixed by idiap/coqui-ai-TTS#3
Labels
feature request feature requests for making TTS better. wontfix This will not be worked on but feel free to help.

Comments

@noranraskin
Copy link
Contributor

Problem

As of right now, all logging is done through print statements. When using the TTS library in different projects it spams the console on every call.

Solution

Instead of print statements, a logging library should be used. Loguru or pythons standard logging library are viable options.
This would allow for better filtering using logging levels, custom handlers to allow writing log files without rerouting stdout, turn all logging off, highlight errors more clearly, etc.

@noranraskin noranraskin added the feature request feature requests for making TTS better. label Jun 24, 2022
@erogol
Copy link
Member

erogol commented Jun 27, 2022

I don't know who is gonna take on this issue but I agree. It'd be nice to have logging scope.

@stale
Copy link

stale bot commented Jul 27, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.

@stale stale bot added the wontfix This will not be worked on but feel free to help. label Jul 27, 2022
@stale stale bot closed this as completed Aug 3, 2022
@jjxtra
Copy link

jjxtra commented Feb 7, 2023

Something to suppress all std out would be nice

@tadeodonegana
Copy link

Any updates on this issue?

@eginhard
Copy link
Contributor

Any updates on this issue?

I've started work on this and will add it to my fork eventually, but it's not a main priority at the moment.

@tadeodonegana
Copy link

Any updates on this issue?

I've started work on this and will add it to my fork eventually, but it's not a main priority at the moment.

Thanks, let me know if i can help!

@LagSlug
Copy link

LagSlug commented Mar 29, 2024

You can redirect the output using this pattern:

from contextlib import redirect_stdout
import io

stdout_capture = io.StringIO()
with redirect_stdout(stdout_capture):

  tts = TTS(model).to('cpu') # or 'gpu' if you have cuda
  tts.tts_to_file(text="Hello", file_path="hello.wav")

print('done')

eginhard added a commit to idiap/coqui-ai-TTS that referenced this issue Apr 2, 2024
eginhard added a commit to idiap/coqui-ai-TTS that referenced this issue Apr 2, 2024
eginhard added a commit to idiap/coqui-ai-TTS that referenced this issue Apr 2, 2024
@eginhard
Copy link
Contributor

eginhard commented Apr 2, 2024

Any updates on this issue?

I've started work on this and will add it to my fork eventually, but it's not a main priority at the moment.

Thanks, let me know if i can help!

@tadeodonegana (and others interested in this), feel free to test/review this PR: idiap#3

@eginhard
Copy link
Contributor

In our fork we've now switched uses of print to use standard Python logging, allowing for configurable output: https://github.com/idiap/coqui-ai-TTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request feature requests for making TTS better. wontfix This will not be worked on but feel free to help.
Projects
None yet
6 participants