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.
This commit is contained in:
@@ -2,7 +2,6 @@ package journal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
|
||||
"git.golem15.com/golem15/sm-journal-plugin/models"
|
||||
"git.golem15.com/golem15/summercms/modules/backpack"
|
||||
@@ -31,7 +30,7 @@ func settingsSearchEnabled(ctx context.Context, db *gorm.DB) bool {
|
||||
var on bool
|
||||
err := db.WithContext(ctx).Raw(`SELECT search_use_typesense FROM golem15_journal_settings WHERE id = 1`).Scan(&on).Error
|
||||
if err != nil {
|
||||
slog.Default().Warn("journal: search_use_typesense read failed; treating as off", "err", err)
|
||||
pluginLog.Warn("journal: search_use_typesense read failed; treating as off", "err", err)
|
||||
return false
|
||||
}
|
||||
return on
|
||||
|
||||
Reference in New Issue
Block a user