Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Commit 8f40c6b

Browse files
Separate logger initiation (#43)
* minor fix Signed-off-by: Ayman <[email protected]> * clean up Signed-off-by: Ayman <[email protected]> * revert Signed-off-by: Ayman <[email protected]> * clean up Signed-off-by: Ayman <[email protected]> * clean up Signed-off-by: Ayman <[email protected]> Co-authored-by: Ayman <[email protected]>
1 parent 277ab66 commit 8f40c6b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cmd/git/git.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,6 @@ func (j *DSGit) Init(ctx *shared.Ctx) (err error) {
760760
j.AddPublisher(&datalakeClient)
761761
}
762762
j.AddLogger(ctx)
763-
j.createStructuredLogger(ctx)
764763
return
765764
}
766765

@@ -2602,6 +2601,7 @@ func main() {
26022601
ctx shared.Ctx
26032602
git DSGit
26042603
)
2604+
git.initStructuredLogger()
26052605
err := git.Init(&ctx)
26062606
if err != nil {
26072607
git.log.WithFields(logrus.Fields{"operation": "main"}).Errorf("Error: %+v", err)
@@ -2622,7 +2622,7 @@ func main() {
26222622
}
26232623

26242624
// createStructuredLogger...
2625-
func (j *DSGit) createStructuredLogger(ctx *shared.Ctx) {
2625+
func (j *DSGit) initStructuredLogger() {
26262626
logrus.SetFormatter(&logrus.JSONFormatter{})
26272627
log := logrus.WithFields(
26282628
logrus.Fields{
@@ -2631,7 +2631,6 @@ func (j *DSGit) createStructuredLogger(ctx *shared.Ctx) {
26312631
"version": build.Version,
26322632
"service": build.AppName,
26332633
"endpoint": j.URL,
2634-
"project": ctx.Project,
26352634
})
26362635
j.log = log
26372636
}

0 commit comments

Comments
 (0)