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

change loggers to not write debug logs to a file. #1323

Merged
merged 1 commit into from Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions log/log.go
Expand Up @@ -53,7 +53,7 @@ var AppLog Log
func init() {
// create a basic temp os.Stdout logger
// This logger is used until the app calls InitSpacemeshLoggingSystem().
AppLog = New(mainLoggerName, "", "")
AppLog = NewDefault(mainLoggerName)
}

// DebugMode sets log debug level
Expand Down Expand Up @@ -130,7 +130,7 @@ func getFileWriter(dataFolderPath, logFileName string) io.Writer {

// InitSpacemeshLoggingSystem initializes app logging system.
func InitSpacemeshLoggingSystem(dataFolderPath string, logFileName string) {
AppLog = New(mainLoggerName, dataFolderPath, logFileName)
AppLog = NewDefault(mainLoggerName)
}

// public wrappers abstracting away logging lib impl
Expand Down
6 changes: 3 additions & 3 deletions p2p/node/localnode.go
Expand Up @@ -96,7 +96,7 @@ func newLocalNodeWithKeys(pubKey p2pcrypto.PublicKey, privKey p2pcrypto.PrivateK
}

if !persist {
n.Log = log.New(n.ID.String(), "", "")
n.Log = log.NewDefault(n.ID.String())
return n, nil
}

Expand All @@ -105,13 +105,13 @@ func newLocalNodeWithKeys(pubKey p2pcrypto.PublicKey, privKey p2pcrypto.PrivateK
return nil, err
}

nodeDir, err := filesystem.EnsureNodeDataDirectory(dataDir, n.ID.String())
_, err = filesystem.EnsureNodeDataDirectory(dataDir, n.ID.String())
if err != nil {
return nil, err
}

// persistent logging
n.Log = log.New(n.ID.String(), nodeDir, "node.log")
n.Log = log.NewDefault(n.ID.String())

n.Info("Local node identity >> %v", n.PublicKey().String())

Expand Down