Summary
On import, kokoro/__init__.py calls logger.remove(), adds its own stderr sink (level INFO), and then calls logger.disable("kokoro"). In loguru, disable() filters at the record's origin (the record.name namespace) before any sink runs — including the package's own sink and any sink a caller adds afterward. As a result, all kokoro log output is invisible by default, including the Truncating len(ps) == N > 510 warning in kokoro/pipeline.py. On the espeak (non-English) path, where there is no internal chunking logic (as the constructor's own warning states), this message is the only signal that audio has been silently truncated. Users get shortened audio with no indication why, unless they already know to call logger.enable("kokoro").
Related: #269 reports the complementary symptom of the same __init__.py code — the package's logger.remove() clobbering the host application's loguru configuration. This report is about the package muting its own warnings.
Environment
- kokoro 0.7.16
- PyTorch 2.x
- Python 3.13
- macOS arm64 (Apple Silicon, M1 Max)
Reproduction
- Build a
KPipeline with an espeak-backed language.
- Feed it text that produces more than 510 phonemes with no newline splits.
- Without calling
logger.enable("kokoro"), no warning is printed and the output audio is truncated.
- With
logger.enable("kokoro"), the same run prints the Truncating len(ps) == N > 510 warning. Audio length is identical either way (truncated) — comparing duration with and without \n-based text splitting confirms the cut.
Expected vs. Actual
- Expected: a warning about silent truncation of synthesized audio should be visible by default, since it signals data loss with no other symptom.
- Actual: the warning exists but is suppressed by the package's own
logger.disable("kokoro") call, so it never reaches any sink unless the caller explicitly re-enables the logger namespace.
Suggestion
Either drop the logger.disable("kokoro") call (the package's own sink and level already control verbosity), or document the need for logger.enable("kokoro") prominently in the README. At minimum, exempt the truncation warning from the disable — e.g. log it under a differently-named logger, or raise instead of only logging.
Summary
On import,
kokoro/__init__.pycallslogger.remove(), adds its own stderr sink (level INFO), and then callslogger.disable("kokoro"). In loguru,disable()filters at the record's origin (therecord.namenamespace) before any sink runs — including the package's own sink and any sink a caller adds afterward. As a result, all kokoro log output is invisible by default, including theTruncating len(ps) == N > 510warning inkokoro/pipeline.py. On the espeak (non-English) path, where there is no internal chunking logic (as the constructor's own warning states), this message is the only signal that audio has been silently truncated. Users get shortened audio with no indication why, unless they already know to calllogger.enable("kokoro").Related: #269 reports the complementary symptom of the same
__init__.pycode — the package'slogger.remove()clobbering the host application's loguru configuration. This report is about the package muting its own warnings.Environment
Reproduction
KPipelinewith an espeak-backed language.logger.enable("kokoro"), no warning is printed and the output audio is truncated.logger.enable("kokoro"), the same run prints theTruncating len(ps) == N > 510warning. Audio length is identical either way (truncated) — comparing duration with and without\n-based text splitting confirms the cut.Expected vs. Actual
logger.disable("kokoro")call, so it never reaches any sink unless the caller explicitly re-enables the logger namespace.Suggestion
Either drop the
logger.disable("kokoro")call (the package's own sink and level already control verbosity), or document the need forlogger.enable("kokoro")prominently in the README. At minimum, exempt the truncation warning from the disable — e.g. log it under a differently-named logger, or raise instead of only logging.