Skip to content

Commit

Permalink
fix: implements flushes in all writer
Browse files Browse the repository at this point in the history
  • Loading branch information
damianopetrungaro committed Jan 29, 2023
1 parent 678a55c commit 909b21c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
unit-test:
strategy:
matrix:
go-version: [ 1.16.x, 1.17.x, 1.18.x ]
go-version: [ 1.16.x, 1.17.x, 1.18.x, 1.19.x ]

name: Unit test
runs-on: ubuntu-latest
Expand Down
52 changes: 0 additions & 52 deletions .idea/workspace.xml

This file was deleted.

10 changes: 10 additions & 0 deletions writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ func (m *LeveledWriter) Write(msg []byte) (int, error) {
return m.Default.Write(msg)
}

// Flush flushes the data
func (m *LeveledWriter) Flush() error {
return m.Default.Flush()
}

// DeduplicatorWriter is a Writer which deduplicate fields with the same name
type DeduplicatorWriter struct {
Default Writer
Expand Down Expand Up @@ -183,6 +188,11 @@ func (m *DeduplicatorWriter) Write(msg []byte) (int, error) {
return m.Default.Write(msg)
}

// Flush flushes the data
func (m *DeduplicatorWriter) Flush() error {
return m.Default.Flush()
}

// MultiWriter is a Writer which based on the log level will write to a writer
// It also uses a Default one for the Write method
// as well as supporting the case when the Writer is not found in the Level map
Expand Down

0 comments on commit 909b21c

Please sign in to comment.