Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

590 B
Raw Blame
package monitoring

import (
	"bytes"
	"context"
	"testing"

	"github.com/rs/zerolog"
	"github.com/rs/zerolog/log"
)

func TestGuestFilesystemLoggerKeepsOrdinaryFallback(t *testing.T) {
	if guestFilesystemLogger(context.Background()) != &log.Logger {
		t.Fatal("ordinary filesystem guidance lost its process logger")
	}
	var output bytes.Buffer
	logger := zerolog.New(&output)
	ctx := logger.WithContext(context.Background())
	if guestFilesystemLogger(ctx) != log.Ctx(ctx) || guestFilesystemLogger(ctx) == &log.Logger {
		t.Fatal("filesystem guidance lost its explicit caller logger")
	}
}