Skip to content

Commit

Permalink
remove github.com/Altinity/clickhouse-backup/v2/ from logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Aug 8, 2024
1 parent 270e0ed commit 38e6973
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/clickhouse-backup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
stdlog "log"
"os"
"strconv"
"strings"

"github.com/rs/zerolog"
Expand All @@ -27,6 +28,10 @@ var (
func main() {
zerolog.TimeFieldFormat = zerolog.TimeFormatUnixMs
zerolog.ErrorStackMarshaler = pkgerrors.MarshalStack
// Customize the caller format to remove the prefix
zerolog.CallerMarshalFunc = func(pc uintptr, file string, line int) string {
return strings.TrimPrefix(file, "github.com/Altinity/clickhouse-backup/v2/") + ":" + strconv.Itoa(line)
}
consoleWriter := zerolog.ConsoleWriter{Out: os.Stderr, NoColor: true, TimeFormat: "2006-01-02 15:04:05.000"}
//diodeWriter := diode.NewWriter(consoleWriter, 4096, 10*time.Millisecond, func(missed int) {
// fmt.Printf("Logger Dropped %d messages", missed)
Expand Down

0 comments on commit 38e6973

Please sign in to comment.