mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-09 00:52:14 +01:00
32 lines
577 B
Go
32 lines
577 B
Go
package chromium
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
// debugLogger is wrapper around a [zap.Logger] which is used for debugging
|
|
// Chromium.
|
|
type debugLogger struct {
|
|
logger *zap.Logger
|
|
}
|
|
|
|
// Write logs the bytes in a debug message.
|
|
func (debug *debugLogger) Write(p []byte) (n int, err error) {
|
|
debug.logger.Debug(string(p))
|
|
|
|
return len(p), nil
|
|
}
|
|
|
|
// Printf logs a debug message.
|
|
func (debug *debugLogger) Printf(format string, v ...interface{}) {
|
|
debug.logger.Debug(fmt.Sprintf(format, v...))
|
|
}
|
|
|
|
// Interface guards.
|
|
var (
|
|
_ io.Writer = (*debugLogger)(nil)
|
|
)
|