|
|
|
@ -86,11 +86,10 @@ func main() { |
|
|
|
|
// Setup a logger to stdout and log file.
|
|
|
|
|
logFileName := fmt.Sprintf("./%v/%v.log", *logFolder, *port) |
|
|
|
|
h := log.MultiHandler( |
|
|
|
|
log.Must.FileHandler(logFileName, log.LogfmtFormat()), |
|
|
|
|
log.StdoutHandler, |
|
|
|
|
log.Must.NetHandler("tcp", ":3000", log.JSONFormat())) |
|
|
|
|
// In cases where you just want a stdout logger, use the following one instead.
|
|
|
|
|
// h := log.CallerFileHandler(log.StdoutHandler)
|
|
|
|
|
log.StdoutHandler, // Log to terminal
|
|
|
|
|
log.Must.FileHandler(logFileName, log.LogfmtFormat()), // Log to file
|
|
|
|
|
// log.Must.NetHandler("tcp", ":3000", log.JSONFormat()) // Log to remote
|
|
|
|
|
) |
|
|
|
|
log.Root().SetHandler(h) |
|
|
|
|
|
|
|
|
|
consensus := consensus.NewConsensus(*ip, *port, shardId, peers, leader) |
|
|
|
|