mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 13:34:23 +01:00
refactor: central logger (#1692)
This commit is contained in:
1 parent
b022d1c856
commit
ab38a46986
18 files changed
+191
-138
No files matched your search
@@ -4,15 +4,11 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/zricethezav/gitleaks/v8/cmd"
|
||||
"github.com/zricethezav/gitleaks/v8/logging"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// send all logs to stdout
|
||||
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
|
||||
|
||||
// this block sets up a go routine to listen for an interrupt signal
|
||||
// which will immediately exit gitleaks
|
||||
stopChan := make(chan os.Signal, 1)
|
||||
@@ -24,5 +20,5 @@ func main() {
|
||||
|
||||
func listenForInterrupt(stopScan chan os.Signal) {
|
||||
<-stopScan
|
||||
log.Fatal().Msg("Interrupt signal received. Exiting...")
|
||||
logging.Fatal().Msg("Interrupt signal received. Exiting...")
|
||||
}
|
||||
Reference in new issue
Block a user