mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 18:15:42 +01:00
Merge pull request #530 from oxisto/slog
Added support for structured logging in `csaf_aggregator`
This commit is contained in:
commit
617deb4c17
23 changed files with 135 additions and 91 deletions
|
|
@ -11,10 +11,12 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
|
||||
|
||||
"github.com/gofrs/flock"
|
||||
)
|
||||
|
||||
|
|
@ -44,8 +46,9 @@ func lock(lockFile *string, fn func() error) error {
|
|||
|
||||
func main() {
|
||||
_, cfg, err := parseArgsConfig()
|
||||
options.ErrorCheck(err)
|
||||
options.ErrorCheck(cfg.prepare())
|
||||
p := processor{cfg: cfg}
|
||||
options.ErrorCheck(lock(cfg.LockFile, p.process))
|
||||
cfg.prepareLogging()
|
||||
options.ErrorCheckStructured(err)
|
||||
options.ErrorCheckStructured(cfg.prepare())
|
||||
p := processor{cfg: cfg, log: slog.Default()}
|
||||
options.ErrorCheckStructured(lock(cfg.LockFile, p.process))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue