Skip to content

Commit

Permalink
fix: #117 Logs should not use colors code by defaut under windows OS
Browse files Browse the repository at this point in the history
  • Loading branch information
simulot committed Jan 4, 2024
1 parent a742e92 commit bc2ac5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release notes

## Release

### fix: Logs should not use colors code by default under windows OS #117
Most of windows terminals are still not able to understand ANSI colors sequences.


## Release 0.9.6

### feat: control archived Google photos
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"os"
"os/signal"
"runtime"
"strings"

"github.com/simulot/immich-go/cmdduplicate"
Expand Down Expand Up @@ -89,7 +90,7 @@ func Run(ctx context.Context, log *logger.Log) (*logger.Log, error) {
flag.StringVar(&app.API, "api", "", "Immich api endpoint (http://container_ip:3301)")
flag.StringVar(&app.Key, "key", "", "API Key")
flag.StringVar(&app.DeviceUUID, "device-uuid", deviceID, "Set a device UUID")
flag.BoolFunc("no-colors-log", "Disable colors on logs", myflag.BoolFlagFn(&app.NoLogColors, false))
flag.BoolFunc("no-colors-log", "Disable colors on logs", myflag.BoolFlagFn(&app.NoLogColors, runtime.GOOS == "windows"))
flag.StringVar(&app.LogLevel, "log-level", "ok", "Log level (Error|Warning|OK|Info), default OK")
flag.StringVar(&app.LogFile, "log-file", "", "Write log messages into the file")
flag.BoolFunc("api-trace", "enable api call traces", myflag.BoolFlagFn(&app.ApiTrace, false))
Expand Down

0 comments on commit bc2ac5e

Please # to comment.