From 35ccf06daeaf86176c1341dde4207c3b11653d7a Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Wed, 23 May 2018 10:03:11 +0200 Subject: Fix some recently broken embedded templates And add tests for them. Fixes #4757 --- deps/deps.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'deps') diff --git a/deps/deps.go b/deps/deps.go index 475d678a9..9a502b589 100644 --- a/deps/deps.go +++ b/deps/deps.go @@ -23,6 +23,9 @@ type Deps struct { // The logger to use. Log *jww.Notepad `json:"-"` + // Used to log errors that may repeat itself many times. + DistinctErrorLog *helpers.DistinctLogger + // The templates to use. This will usually implement the full tpl.TemplateHandler. Tmpl tpl.TemplateFinder `json:"-"` @@ -137,9 +140,12 @@ func New(cfg DepsCfg) (*Deps, error) { timeoutms = 3000 } + distinctErrorLogger := helpers.NewDistinctLogger(logger.ERROR) + d := &Deps{ Fs: fs, Log: logger, + DistinctErrorLog: distinctErrorLogger, templateProvider: cfg.TemplateProvider, translationProvider: cfg.TranslationProvider, WithTemplate: cfg.WithTemplate, -- cgit v1.2.3