MCPcopy
hub / github.com/microsoft/retina / main

Function main

test/plugin/linuxutil/main_linux.go:19–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17)
18
19func main() {
20 log.SetupZapLogger(log.GetDefaultLogOpts())
21 l := log.Logger().Named("test-linuxutil")
22
23 metrics.InitializeMetrics(slog.Default())
24
25 cfg := &kcfg.Config{
26 MetricsInterval: 1 * time.Second,
27 EnablePodLevel: true,
28 }
29 tt := linuxutil.New(cfg)
30 err := tt.Init()
31 if err != nil {
32 l.Error("Init failed:%v", zap.Error(err))
33 return
34 }
35 ctx := context.Background()
36 err = tt.Start(ctx)
37 if err != nil {
38 l.Error("start failed:%v", zap.Error(err))
39 return
40 }
41 l.Info("started linuxutil logger")
42
43 defer func() {
44 err := tt.Stop()
45 if err != nil {
46 l.Error("stop failed:%v", zap.Error(err))
47 }
48 }()
49
50 for range ctx.Done() {
51 }
52}

Callers

nothing calls this directly

Calls 11

SetupZapLoggerFunction · 0.92
GetDefaultLogOptsFunction · 0.92
LoggerFunction · 0.92
InitializeMetricsFunction · 0.92
NewFunction · 0.92
NamedMethod · 0.80
InfoMethod · 0.80
InitMethod · 0.65
StartMethod · 0.65
StopMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected