Replace the old log setup, with structured logging etc.

Fixes #11124
This commit is contained in:
Bjørn Erik Pedersen
2023-06-16 08:17:42 +02:00
parent 0e79446586
commit 7c9fada778
80 changed files with 1273 additions and 1082 deletions

View File

@@ -58,6 +58,8 @@ func New(fs *filesystems.SourceFilesystem, rs *resources.Spec) (*Client, error)
transpiler *godartsass.Transpiler
transpilerv1 *godartsassv1.Transpiler
err error
infol = rs.Logger.InfoCommand("Dart Sass")
warnl = rs.Logger.WarnCommand("Dart Sass")
)
if hugo.IsDartSassV2() {
@@ -68,10 +70,10 @@ func New(fs *filesystems.SourceFilesystem, rs *resources.Spec) (*Client, error)
switch event.Type {
case godartsass.LogEventTypeDebug:
// Log as Info for now, we may adjust this if it gets too chatty.
rs.Logger.Infof("Dart Sass: %s", message)
infol.Logf(message)
default:
// The rest are either deprecations or @warn statements.
rs.Logger.Warnf("Dart Sass: %s", message)
warnl.Logf(message)
}
},
})
@@ -84,10 +86,10 @@ func New(fs *filesystems.SourceFilesystem, rs *resources.Spec) (*Client, error)
switch event.Type {
case godartsassv1.LogEventTypeDebug:
// Log as Info for now, we may adjust this if it gets too chatty.
rs.Logger.Infof("Dart Sass: %s", message)
infol.Logf(message)
default:
// The rest are either deprecations or @warn statements.
rs.Logger.Warnf("Dart Sass: %s", message)
warnl.Logf(message)
}
},
})