Route console diagnostics and stage progress through native reporting
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
package logging
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log/slog"
|
||||
"os"
|
||||
)
|
||||
|
||||
// NewLogger creates a text slog logger.
|
||||
func NewLogger(out io.Writer, level slog.Level) *slog.Logger {
|
||||
if out == nil {
|
||||
out = os.Stderr
|
||||
}
|
||||
|
||||
handler := slog.NewTextHandler(out, &slog.HandlerOptions{Level: level})
|
||||
return slog.New(handler)
|
||||
// Reporter receives operation diagnostics and work progress. Implementations own
|
||||
// delivery and visibility; reporting does not change domain execution policy.
|
||||
type Reporter interface {
|
||||
Info(message string, fields ...any)
|
||||
Warn(message string, fields ...any)
|
||||
Debug(message string, fields ...any)
|
||||
Progress(message string, fields ...any)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user