Skip to content

Commit

Permalink
Fix terminal check for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
OstlerDev committed Sep 12, 2024
1 parent f963be9 commit fc8af95
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
9 changes: 7 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
module github.com/azer/logger
module github.com/oipwg/go-azer-logger

require github.com/azer/is-terminal v1.0.0
go 1.22.6

require (
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // indirect
)
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
github.com/azer/is-terminal v1.0.0 h1:COvj8jmg2xMz0CqHn4Uu8X1m7Dmzmu0CpciBaLtJQBg=
github.com/azer/is-terminal v1.0.0/go.mod h1:5geuIpRQvdv6g/Q1MwXHbmNUlFLg8QcheGk4dZOmxQU=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
4 changes: 2 additions & 2 deletions standard-output.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package logger
import (
"encoding/json"
"fmt"
"github.com/azer/is-terminal"
"golang.org/x/term"
"os"
"strings"
"time"
)

func NewStandardOutput(file *os.File) OutputWriter {
var writer = StandardWriter{
ColorsEnabled: isterminal.IsTerminal(int(file.Fd())),
ColorsEnabled: term.IsTerminal(int(file.Fd())),
Target: file,
}

Expand Down

0 comments on commit fc8af95

Please sign in to comment.