mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-05 03:34:41 +08:00
Don't truncate process log; more consistent output
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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{}
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user