mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 22:46:40 +01:00
24 lines
597 B
Go
24 lines
597 B
Go
|
package build
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
|
||
|
"github.com/btcsuite/btclog/v2"
|
||
|
)
|
||
|
|
||
|
// NewDefaultLogHandlers returns the standard console logger and rotating log
|
||
|
// writer handlers that we generally want to use. It also applies the various
|
||
|
// config options to the loggers.
|
||
|
func NewDefaultLogHandlers(cfg *LogConfig, rotator *RotatingLogWriter) (
|
||
|
btclog.Handler, btclog.Handler) {
|
||
|
|
||
|
consoleLogHandler := btclog.NewDefaultHandler(
|
||
|
os.Stdout, cfg.Console.HandlerOptions()...,
|
||
|
)
|
||
|
logFileHandler := btclog.NewDefaultHandler(
|
||
|
rotator, cfg.File.HandlerOptions()...,
|
||
|
)
|
||
|
|
||
|
return consoleLogHandler, logFileHandler
|
||
|
}
|