summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--options.go4
-rw-r--r--templates.go10
2 files changed, 6 insertions, 8 deletions
diff --git a/options.go b/options.go
index 3f4146f..a047f0c 100644
--- a/options.go
+++ b/options.go
@@ -16,10 +16,10 @@ func Base(s string) Option {
}
}
-func Logger(f func(...interface{})) Option {
+func Debug(f func(...interface{})) Option {
return func(t *Templates) error {
log = f
- log("logger set")
+ log("debugging templates")
return nil
}
}
diff --git a/templates.go b/templates.go
index b55da5d..711b4cb 100644
--- a/templates.go
+++ b/templates.go
@@ -48,7 +48,7 @@ func New(opts ...Option) (*Templates, error) {
}
}
for i, m := range out.mappings {
- log("reading templates from", m.Source, "with extensions", m.Extensions)
+ log("templates: reading from", m.Source, "with extensions", m.Extensions)
if err := readTemplates(out.base, &m); err != nil {
return nil, err
}
@@ -84,17 +84,15 @@ func readTemplates(base string, m *Mapping) error {
src := filepath.Join(base, m.Source)
return filepath.Walk(src, func(path string, info os.FileInfo, err error) error {
if err != nil {
- log("failed", err)
+ log("templates: failed to read", err)
return err
}
if info.IsDir() {
return nil
}
- log("considering", path)
- log("root", m.Source)
+ log("templates: considering", path)
varName, _ := filepath.Rel(src, path)
- log("varName", varName)
if !validSuffix(path, m.Extensions) {
return nil
}
@@ -103,7 +101,7 @@ func readTemplates(base string, m *Mapping) error {
if err != nil {
return err
}
- log("found template", varName)
+ log("templates: found", varName)
return nil
})
}