implement structured logging

This commit is contained in:
Markus Muellner
2022-06-30 19:37:10 +02:00
committed by Benj Fassbind
parent 0c749922c9
commit 8e62195eb5
21 changed files with 558 additions and 54 deletions
+7 -1
View File
@@ -48,6 +48,7 @@ type AptlyContext struct {
publishedStorages map[string]aptly.PublishedStorage
dependencyOptions int
architecturesList []string
structuredLogging bool
// Debug features
fileCPUProfile *os.File
fileMemProfile *os.File
@@ -195,7 +196,7 @@ func (context *AptlyContext) Progress() aptly.Progress {
func (context *AptlyContext) _progress() aptly.Progress {
if context.progress == nil {
context.progress = console.NewProgress()
context.progress = console.NewProgress(context.structuredLogging)
context.progress.Start()
}
@@ -540,6 +541,11 @@ func (context *AptlyContext) GoContextHandleSignals() {
}()
}
// StructuredLogging allows to set the structuredLogging flag
func (context *AptlyContext) StructuredLogging(structuredLogging bool) {
context.structuredLogging = structuredLogging
}
// Shutdown shuts context down
func (context *AptlyContext) Shutdown() {
context.Lock()