Don't truncate process log; more consistent output

This commit is contained in:
Matthew Holt
2015-11-05 17:01:08 -07:00
parent 2fb4810cdb
commit bcea5182c6
14 changed files with 23 additions and 24 deletions

View File

@ -122,7 +122,7 @@ func (md Markdown) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error
// if development is set, scan directory for file changes for links.
if cfg.Development {
if err := GenerateStatic(md, cfg); err != nil {
log.Println("On-demand generation error (markdown):", err)
log.Printf("[ERROR] markdown: on-demand site generation error: %v", err)
}
}

View File

@ -92,7 +92,7 @@ func (l *linkGen) generateLinks(md Markdown, cfg *Config) bool {
l.Unlock()
return false
} else if err != nil {
log.Println("Hash error (markdown):", err)
log.Printf("[ERROR] markdown: Hash error: %v", err)
}
cfg.Links = []PageLink{}

View File

@ -115,10 +115,9 @@ func (md Markdown) processTemplate(c *Config, requestPath string, tmpl []byte, m
// generate static page
if err = md.generatePage(c, requestPath, b.Bytes()); err != nil {
// if static page generation fails,
// nothing fatal, only log the error.
// TODO: Report this non-fatal error, but don't log it here
log.Println("Rendering error (markdown):", err)
// if static page generation fails, nothing fatal, only log the error.
// TODO: Report (return) this non-fatal error, but don't log it here?
log.Println("[ERROR] markdown: Render:", err)
}
return b.Bytes(), nil

View File

@ -14,7 +14,7 @@ const DefaultInterval = time.Second * 60
func Watch(md Markdown, c *Config, interval time.Duration) (stopChan chan struct{}) {
return TickerFunc(interval, func() {
if err := GenerateStatic(md, c); err != nil {
log.Println(err)
log.Printf("[ERROR] markdown: Re-generating static site: %v", err)
}
})
}