Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
feat(logger): log level, targets and enable
Browse files Browse the repository at this point in the history
  • Loading branch information
kehiy committed Jul 9, 2024
1 parent 8766d7c commit bf5caee
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ devtools:
go install mvdan.cc/gofumpt@latest

## Building
build:
build-cli:
go build -o ./build/ttrace ./cmd/main.go

### Testing
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func DefaultConfig() *Config {
Port: "7070",
},
Log: Log{
Targets: []string{"console", "file"},
Targets: []string{"file", "console"},
Level: "debug",
Colorful: true,
Compress: true,
Expand Down
5 changes: 3 additions & 2 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ server:
port: "7070"

log:
enabled: true
path: log.ttrace
targets: [file, console]
targets:
- file
- console
level: debug
colorful: true
compress: true
Expand Down
2 changes: 0 additions & 2 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ func TestDefaultConfig(t *testing.T) {
defaultYaml = strings.ReplaceAll(defaultYaml, "\n\n", "\n")
defaultFunctionStr = strings.ReplaceAll(defaultFunctionStr, "\n\n", "\n")

// fmt.Println(defaultFunction)
// fmt.Println(defaultYaml)
assert.Equal(t, defaultFunctionStr, defaultYaml)
}

Expand Down

0 comments on commit bf5caee

Please sign in to comment.