Update logging behavior

This commit is contained in:
Tom Wiesing 2022-12-01 12:42:04 +01:00
parent 3b78b06fff
commit 6f1ba24761
No known key found for this signature in database
28 changed files with 176 additions and 137 deletions

View file

@ -13,6 +13,7 @@ import (
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/instances"
"github.com/FAU-CDI/wisski-distillery/pkg/lazy"
"github.com/FAU-CDI/wisski-distillery/pkg/logging"
)
type Resolver struct {
@ -45,13 +46,13 @@ func (resolver *Resolver) Handler(ctx context.Context, route string, progress io
domainName := resolver.Config.DefaultDomain
if domainName != "" {
fallback.Data[fmt.Sprintf("^https?://(.*)\\.%s", regexp.QuoteMeta(domainName))] = fmt.Sprintf("https://$1.%s", domainName)
fmt.Fprintf(progress, "registering default domain %s\n", domainName)
logging.ProgressF(progress, ctx, "registering default domain %s\n", domainName)
}
// handle the extra domains!
for _, domain := range resolver.Config.SelfExtraDomains {
fallback.Data[fmt.Sprintf("^https?://(.*)\\.%s", regexp.QuoteMeta(domain))] = fmt.Sprintf("https://$1.%s", domainName)
fmt.Fprintf(progress, "registering legacy domain %s\n", domain)
logging.ProgressF(progress, ctx, "registering legacy domain %s\n", domain)
}
// start updating prefixes