Skip to content

Commit

Permalink
Fix log so that it writes to stderr and not log file (#277)
Browse files Browse the repository at this point in the history
* Create two seperate metrics - one with a watch type and the other without

* fix log level

* put config back
  • Loading branch information
annelau21 authored Jul 26, 2024
1 parent d7d425d commit ff085e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/sloop/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/salesforce/sloop/pkg/sloop/webserver"
)

const alsologtostderr = "alsologtostderr"
const logtostderr = "logtostderr"

func RealMain() error {
defer glog.Flush()
Expand Down Expand Up @@ -187,14 +187,14 @@ func RealMain() error {
}

// By default glog will not print anything to console, which can confuse users
// This will turn it on unless user sets it explicitly (with --alsologtostderr=false)
// This will turn it on unless user sets it explicitly (with --logtostderr=false)
func setupStdErrLogging() {
for _, arg := range os.Args[1:] {
if strings.Contains(arg, alsologtostderr) {
if strings.Contains(arg, logtostderr) {
return
}
}
err := flag.Set("alsologtostderr", "true")
err := flag.Set("logtostderr", "true")
if err != nil {
panic(err)
}
Expand Down

0 comments on commit ff085e8

Please sign in to comment.