diff --git a/README.md b/README.md index e07aa10..e4fb7d5 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,8 @@ slog.SetDefault(logger) opts := &devslog.Options{ MaxSlicePrintSize: 4, SortKeys: true, - TimeFormat: "[04:05]" + TimeFormat: "[04:05]", + DebugColor: devslog.Magenta, } logger := slog.New(devslog.NewHandler(os.Stdout, opts)) @@ -91,8 +92,12 @@ slog.SetDefault(logger) ``` ## Options -| Parameter | Description | Default | Value | -|-------------------|----------------------------------------------------------------|--------------|--------| -| MaxSlicePrintSize | Specifies the maximum number of elements to print for a slice. | 50 | uint | -| SortKeys | Determines if attributes should be sorted by keys. | false | bool | -| TimeFormat | Time format for timestamp. | "[15:04:05]" | string | +| Parameter | Description | Default | Value | +|-------------------|----------------------------------------------------------------|----------------|----------------------| +| MaxSlicePrintSize | Specifies the maximum number of elements to print for a slice. | 50 | uint | +| SortKeys | Determines if attributes should be sorted by keys. | false | bool | +| TimeFormat | Time format for timestamp. | "[15:04:05]" | string | +| DebugColor | Color for Debug level | devslog.Blue | devslog.Color (uint) | +| InfoColor | Color for Info level | devslog.Green | devslog.Color (uint) | +| WarnColor | Color for Warn level | devslog.Yellow | devslog.Color (uint) | +| ErrorColor | Color for Error level | devslog.Red | devslog.Color (uint) | diff --git a/devslog.go b/devslog.go index 6f62acb..b74c1ba 100644 --- a/devslog.go +++ b/devslog.go @@ -38,9 +38,16 @@ type Options struct { // Time format for timestamp, default format is "[15:04:05]" TimeFormat string + // Set color for Debug level, default: devslog.Blue DebugColor Color - InfoColor Color - WarnColor Color + + // Set color for Info level, default: devslog.Green + InfoColor Color + + // Set color for Warn level, default: devslog.Yellow + WarnColor Color + + // Set color for Error level, default: devslog.Red ErrorColor Color }