tall-autumn-57974
09/29/2025, 10:10 AMhpack.hpack debug logs in the console. They are quite polluting my dev env although I'd like to keep log_level to DEBUG for other logs (livekit.agents, my own logs)tall-airline-16756
09/29/2025, 10:10 AMtall-airline-16756
09/29/2025, 10:10 AMhpack.hpack but still keep the log level set to DEBUG for other logs, I’m happy to guide you through some prefix-based filtering options that can help:
For Go-based services (like agents or server SDKs):
• You can define custom prefix filters specifically for log scopes including hpack.hpack.
• Then, apply these filters when you initialize your logger. Here’s a simple example:
import "github.com/livekit/protocol/logger/pionlogger"
// Define your custom prefix filter
customFilters := pionlogger.PrefixFilter{
"hpack": {
"hpack.hpack", // this will suppress any log line starting with this prefix
},
}
// Apply the filter when creating the logger factory
loggerFactory := pionlogger.NewLoggerFactory(yourLogger, pionlogger.WithPrefixFilter(customFilters))
For JavaScript/TypeScript SDKs:
• You can use setLogExtension to programmatically filter out logs. Here’s how you might do it:
import { setLogExtension, LogLevel } from 'livekit-client';
setLogExtension((level, message, context) => {
// Filter out specific debug messages
if (level === LogLevel.debug && message.includes('hpack.hpack')) {
return; // This skips logging those messages
}
// For all other logs, just forward them along
console.log(level, message, context);
});
Using these methods, you can easily keep your logs clean by suppressing unwanted debug messages while still having full visibility into other important debug-level logs. If you have any questions or need further help setting this up, please don’t hesitate to ask—I’m here to help!
Sources: README.md | Log collection | LiveKit Docs | logger/pionlogger/logger.gotall-autumn-57974
09/29/2025, 10:12 AMtall-airline-16756
09/29/2025, 10:13 AMhpack.hpack debug logs in the Python SDK, while still keeping other debug logs active, you can easily do this using Python's standard logging module. Let me walk you through it:
import logging
# Silence hpack.hpack specifically
hpack_logger = logging.getLogger('hpack.hpack')
hpack_logger.setLevel(logging.WARNING)
# Ensure your root logger or other loggers remain at DEBUG level
logging.basicConfig(level=logging.DEBUG)
This way, you’ll still see debug logs from other parts of your application and the LiveKit SDK, but the verbose hpack.hpack logs will be nicely tucked away.
If you want a more thorough setup to handle multiple noisy loggers, here’s a handy function you can use:
def setup_logging():
logging.basicConfig(level=logging.DEBUG)
# List of known noisy loggers to reduce verbosity
noisy_loggers = [
"hpack.hpack", # HPACK debug output
"httpx", # Common in LiveKit API clients
"httpcore", # Underlying HTTP transport
"websockets.client",
"urllib3.connectionpool",
]
for name in noisy_loggers:
logger = logging.getLogger(name)
if logger.level == logging.NOTSET:
logger.setLevel(logging.WARNING)
# Call this before initializing LiveKit components
setup_logging()
This approach fits nicely with LiveKit's logging style and helps keep your debug output clean and easy to follow. If you have any questions or need further help, feel free to ask—I'm here for you!
Sources: livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/log.py | livekit-rtc/livekit/rtc/log.py