mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 16:54:15 -04:00
Startup notification (#250)
Stop the caddy message and start our own init notifications. Log the version of CoreDNS when starting up. Fix all middleware's setup functions so that return the error prefixed with *which* middleware was failing; leads to better debuggable errors when starting up.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
@@ -52,4 +54,8 @@ func (f HandlerFunc) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.
|
||||
return f(ctx, w, r)
|
||||
}
|
||||
|
||||
// Error returns err with 'middleware/name: ' prefixed to it.
|
||||
func Error(name string, err error) error { return fmt.Errorf("%s/%s: %s", "middleware", name, err) }
|
||||
|
||||
// Namespace is the namespace used for the metrics.
|
||||
const Namespace = "coredns"
|
||||
|
||||
Reference in New Issue
Block a user