feat: console help, examples and named loggers (SummerCMS v0.4.0)
Every command gets long help and examples, descriptions in imperative sentence case, and a warn-only TestCommandsDocumented over bonfire.CheckDocs. The plugin logs through a diary component logger instead of the process default logger. Requires SummerCMS v0.4.0; command names and flags unchanged. user:token:create and user:token:list gain --json, user:backfill-handles a progress bar; planning IDs leave the descriptions.
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -99,7 +98,7 @@ func EndRequestSession(ctx context.Context, app *backpack.App, w http.ResponseWr
|
||||
if app != nil && app.Config != nil {
|
||||
loaded, err := bouncer.LoadCookieConfig(app.Config)
|
||||
if err != nil {
|
||||
slog.Default().Warn("golem15.user: end session: cookie config", "err", err)
|
||||
pluginLog.Warn("golem15.user: end session: cookie config", "err", err)
|
||||
} else {
|
||||
cfg = loaded
|
||||
}
|
||||
@@ -126,7 +125,7 @@ func revokeSessionToken(ctx context.Context, app *backpack.App, raw string) {
|
||||
return
|
||||
}
|
||||
if err := bl.Add(ctx, jti, exp, time.Now()); err != nil {
|
||||
slog.Default().Warn("golem15.user: end session: blacklist token", "err", err)
|
||||
pluginLog.Warn("golem15.user: end session: blacklist token", "err", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user