mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
@@ -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)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
@@ -17,10 +17,10 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/bep/logg"
|
||||
qt "github.com/frankban/quicktest"
|
||||
"github.com/gohugoio/hugo/hugolib"
|
||||
"github.com/gohugoio/hugo/resources/resource_transformers/tocss/dartsass"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
)
|
||||
|
||||
func TestTransformIncludePaths(t *testing.T) {
|
||||
@@ -288,11 +288,11 @@ T1: {{ $r.Content }}
|
||||
T: t,
|
||||
TxtarString: files,
|
||||
NeedsOsFS: true,
|
||||
LogLevel: jww.LevelInfo,
|
||||
LogLevel: logg.LevelInfo,
|
||||
}).Build()
|
||||
|
||||
b.AssertLogMatches(`WARN.*Dart Sass: foo`)
|
||||
b.AssertLogMatches(`INFO.*Dart Sass: .*assets.*main.scss:1:0: bar`)
|
||||
b.AssertLogMatches(`Dart Sass: foo`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:1:0: bar`)
|
||||
|
||||
}
|
||||
|
||||
@@ -513,20 +513,20 @@ T1: {{ $r.Content }}
|
||||
T: t,
|
||||
TxtarString: files,
|
||||
NeedsOsFS: true,
|
||||
LogLevel: jww.LevelInfo,
|
||||
LogLevel: logg.LevelInfo,
|
||||
}).Build()
|
||||
|
||||
b.AssertLogMatches(`INFO.*Dart Sass: .*assets.*main.scss:3:0: color`)
|
||||
b.AssertLogMatches(`INFO.*Dart Sass: .*assets.*main.scss:4:0: color`)
|
||||
b.AssertLogMatches(`INFO.*Dart Sass: .*assets.*main.scss:5:0: color`)
|
||||
b.AssertLogMatches(`INFO.*Dart Sass: .*assets.*main.scss:6:0: number`)
|
||||
b.AssertLogMatches(`INFO.*Dart Sass: .*assets.*main.scss:7:0: number`)
|
||||
b.AssertLogMatches(`INFO.*Dart Sass: .*assets.*main.scss:8:0: number`)
|
||||
b.AssertLogMatches(`INFO.*Dart Sass: .*assets.*main.scss:9:0: string`)
|
||||
b.AssertLogMatches(`INFO.*Dart Sass: .*assets.*main.scss:10:0: string`)
|
||||
b.AssertLogMatches(`INFO.*Dart Sass: .*assets.*main.scss:11:0: string`)
|
||||
b.AssertLogMatches(`INFO.*Dart Sass: .*assets.*main.scss:12:0: number`)
|
||||
b.AssertLogMatches(`INFO.*Dart Sass: .*assets.*main.scss:13:0: number`)
|
||||
b.AssertLogMatches(`INFO.*Dart Sass: .*assets.*main.scss:14:0: number`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:3:0: color`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:4:0: color`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:5:0: color`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:6:0: number`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:7:0: number`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:8:0: number`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:9:0: string`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:10:0: string`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:11:0: string`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:12:0: number`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:13:0: number`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:14:0: number`)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user