summaryrefslogtreecommitdiff
path: root/cmd/gotosocial/common.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-12-12 18:00:20 +0100
committerLibravatar GitHub <noreply@github.com>2021-12-12 18:00:20 +0100
commitc111b239f7d102ac24a79fbef420af46dfec66f9 (patch)
tree813f5c4501a6e5048fb2922e099ce92d35b33b14 /cmd/gotosocial/common.go
parentadd systemd service example to packaging (#342) (diff)
downloadgotosocial-c111b239f7d102ac24a79fbef420af46dfec66f9.tar.xz
Add optional syslog logrus hook (#343)
* add optional syslog logrus hook * document syslog
Diffstat (limited to 'cmd/gotosocial/common.go')
-rw-r--r--cmd/gotosocial/common.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/cmd/gotosocial/common.go b/cmd/gotosocial/common.go
index 7b5a42652..3f4b12613 100644
--- a/cmd/gotosocial/common.go
+++ b/cmd/gotosocial/common.go
@@ -23,7 +23,6 @@ import (
"fmt"
"github.com/spf13/cobra"
- "github.com/spf13/viper"
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/log"
@@ -52,12 +51,8 @@ func preRun(cmd *cobra.Command) error {
// The idea here is to take a GTSAction and run it with the given
// context, after initializing any last-minute things like loggers etc.
func run(ctx context.Context, action action.GTSAction) error {
- // if log level has been set...
- if logLevel := viper.GetString(config.Keys.LogLevel); logLevel != "" {
- // then try to initialize the logger to that level
- if err := log.Initialize(logLevel); err != nil {
- return fmt.Errorf("error initializing log: %s", err)
- }
+ if err := log.Initialize(); err != nil {
+ return fmt.Errorf("error initializing log: %s", err)
}
return action(ctx)