Skip to content

Commit 1e38cc5

Browse files
committed
Revert --native-log flag for Apple Unified Logging
The cgo requirement made this incompatible with cross-compiled CI releases. Will revisit with a different approach later.
1 parent b91454a commit 1e38cc5

File tree

7 files changed

+8
-326
lines changed

7 files changed

+8
-326
lines changed

.tasks/closed/5p7v12qq.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

.tasks/closed/ecyzfr5y.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

.tasks/closed/wqdrkrc0.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

.tasks/closed/xprycypa.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

cmd/epithet/main.go

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99

1010
"github.com/alecthomas/kong"
1111
"github.com/brianm/kongcue"
12-
"github.com/epithet-ssh/epithet/pkg/slogoslog"
1312
"github.com/epithet-ssh/epithet/pkg/tlsconfig"
1413
"github.com/lmittmann/tint"
1514
)
@@ -21,11 +20,10 @@ var (
2120
)
2221

2322
var cli struct {
24-
Version kong.VersionFlag `short:"V" help:"Print version information"`
25-
Verbose int `short:"v" type:"counter" help:"Increase verbosity (-v for debug, -vv for trace)"`
26-
LogFile string `name:"log-file" help:"Path to log file (supports ~ expansion)" env:"EPITHET_LOG_FILE"`
27-
NativeLog bool `name:"native-log" help:"Use native OS logging (macOS: Console.app)" env:"EPITHET_NATIVE_LOG"`
28-
Config kongcue.Config `help:"Path to config file" sep:";" default:"/etc/epithet/*.{cue,yaml,yml,json};~/.epithet/*.{cue,yaml,yml,json}"`
23+
Version kong.VersionFlag `short:"V" help:"Print version information"`
24+
Verbose int `short:"v" type:"counter" help:"Increase verbosity (-v for debug, -vv for trace)"`
25+
LogFile string `name:"log-file" help:"Path to log file (supports ~ expansion)" env:"EPITHET_LOG_FILE"`
26+
Config kongcue.Config `help:"Path to config file" sep:";" default:"/etc/epithet/*.{cue,yaml,yml,json};~/.epithet/*.{cue,yaml,yml,json}"`
2927

3028
// TLS configuration flags (global)
3129
Insecure bool `help:"Disable TLS certificate verification (NOT RECOMMENDED)" env:"EPITHET_INSECURE"`
@@ -84,7 +82,7 @@ func expandPath(path string) (string, error) {
8482
}
8583

8684
func setupLogger() *slog.Logger {
87-
// Determine log level based on verbosity.
85+
// Determine log level based on verbosity
8886
level := slog.LevelWarn
8987
switch cli.Verbose {
9088
case 0:
@@ -95,24 +93,15 @@ func setupLogger() *slog.Logger {
9593
level = slog.LevelDebug
9694
}
9795

98-
// If native logging requested, try to use it.
99-
if cli.NativeLog {
100-
if handler := slogoslog.NewHandler(level); handler != nil {
101-
return slog.New(handler)
102-
}
103-
// Fall through to default handler if native not available.
104-
slog.Warn("native logging not available on this platform, using console")
105-
}
106-
107-
// Determine output writer.
96+
// Determine output writer
10897
var w io.Writer = os.Stderr
10998
if cli.LogFile != "" {
11099
path, err := expandPath(cli.LogFile)
111100
if err != nil {
112-
// Fall back to stderr if path expansion fails.
101+
// Fall back to stderr if path expansion fails
113102
slog.Error("failed to expand log file path", "error", err)
114103
} else {
115-
// Ensure parent directory exists.
104+
// Ensure parent directory exists
116105
if err := os.MkdirAll(filepath.Dir(path), 0700); err != nil {
117106
slog.Error("failed to create log directory", "error", err)
118107
} else {

pkg/slogoslog/handler_darwin.go

Lines changed: 0 additions & 196 deletions
This file was deleted.

pkg/slogoslog/handler_other.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)