2018-12-11 22:01:50 +01:00
|
|
|
package rpc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2020-04-11 15:49:41 +02:00
|
|
|
"github.com/zrepl/zrepl/daemon/logging"
|
2018-12-11 22:01:50 +01:00
|
|
|
"github.com/zrepl/zrepl/logger"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Logger = logger.Logger
|
|
|
|
|
2022-10-24 22:09:02 +02:00
|
|
|
// All fields must be non-nil
|
2018-12-11 22:01:50 +01:00
|
|
|
type Loggers struct {
|
|
|
|
General Logger
|
|
|
|
Control Logger
|
|
|
|
Data Logger
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetLoggersOrPanic(ctx context.Context) Loggers {
|
2020-04-11 15:49:41 +02:00
|
|
|
return Loggers{
|
|
|
|
General: logging.GetLogger(ctx, logging.SubsysRPC),
|
|
|
|
Control: logging.GetLogger(ctx, logging.SubsysRPCControl),
|
|
|
|
Data: logging.GetLogger(ctx, logging.SubsysRPCData),
|
|
|
|
}
|
2018-12-11 22:01:50 +01:00
|
|
|
}
|