package log

import (
	"testing"

	"git.eeqj.de/sneak/ipapi/internal/config"
)

func TestNew(t *testing.T) {
	tests := []struct {
		name     string
		logLevel string
	}{
		{"debug level", "debug"},
		{"info level", "info"},
		{"warn level", "warn"},
		{"warning level", "warning"},
		{"error level", "error"},
		{"invalid level", "invalid"},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			cfg := &config.Config{
				LogLevel: tt.logLevel,
			}
			logger := New(cfg)
			if logger == nil {
				t.Fatal("expected logger, got nil")
			}
		})
	}
}

func TestIsTerminal(t *testing.T) {
	// Just test that it doesn't panic
	_ = isTerminal()
}
