mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
So setting up logging for ctrld binary and ctrld packages could be done more easily, decouple the required setup for interactive vs daemon running. This is the first step toward replacing rs/zerolog libary with a different logging library.
20 lines
267 B
Go
20 lines
267 B
Go
package cli
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/rs/zerolog"
|
|
|
|
"github.com/Control-D-Inc/ctrld"
|
|
)
|
|
|
|
var logOutput strings.Builder
|
|
|
|
func TestMain(m *testing.M) {
|
|
l := zerolog.New(&logOutput)
|
|
mainLog.Store(&ctrld.Logger{Logger: &l})
|
|
os.Exit(m.Run())
|
|
}
|