Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix log path #28

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions cmd/grumble/grumble.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import (
"flag"
"fmt"
"log"
"mumble.info/grumble/pkg/blobstore"
"mumble.info/grumble/pkg/logtarget"
"os"
"path/filepath"
"regexp"
"strings"

"mumble.info/grumble/pkg/blobstore"
"mumble.info/grumble/pkg/logtarget"
)

var servers map[int64]*Server
Expand All @@ -35,6 +37,13 @@ func main() {
}
dataDir.Close()

// check that LogPath isn't using default data dir
// where DataDir itself is not using the default
if !strings.HasPrefix(Args.DataDir, defaultDataDir()) &&
strings.HasPrefix(Args.LogPath, defaultDataDir()) {
Args.LogPath = filepath.Join(Args.DataDir, "grumble.log")
}

// Set up logging
err = logtarget.Target.OpenFile(Args.LogPath)
if err != nil {
Expand Down