From 54205d8787693df0b74e649f25060595118ba018 Mon Sep 17 00:00:00 2001 From: i-norden Date: Mon, 10 Oct 2022 13:44:46 -0500 Subject: [PATCH] conform capitalization in logWithCommand logs --- cmd/root.go | 12 ++++++------ cmd/serve.go | 14 +++++++------- cmd/stats.go | 6 +++--- cmd/util.go | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 7b03351..ae60671 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -304,11 +304,11 @@ func getConfig(nodeInfo node.Info) (interfaces.Config, error) { if err != nil { return nil, err } - logWithCommand.Infof("configuring service for database type: %s", dbType) + logWithCommand.Infof("Configuring service for database type: %s", dbType) var indexerConfig interfaces.Config switch dbType { case shared.FILE: - logWithCommand.Info("starting in sql file writing mode") + logWithCommand.Info("Starting in sql file writing mode") fileModeStr := viper.GetString("database.fileMode") fileMode, err := file.ResolveFileMode(fileModeStr) @@ -318,12 +318,12 @@ func getConfig(nodeInfo node.Info) (interfaces.Config, error) { filePathStr := viper.GetString("database.filePath") if fileMode == file.SQL && filePathStr == "" { - logWithCommand.Fatal("when operating in sql file writing mode a file path must be provided") + logWithCommand.Fatal("When operating in sql file writing mode a file path must be provided") } fileCsvDirStr := viper.GetString("database.fileCsvDir") if fileMode == file.CSV && fileCsvDirStr == "" { - logWithCommand.Fatal("when operating in csv file writing mode a directory path must be provided") + logWithCommand.Fatal("When operating in csv file writing mode a directory path must be provided") } indexerConfig = file.Config{ @@ -332,7 +332,7 @@ func getConfig(nodeInfo node.Info) (interfaces.Config, error) { FilePath: filePathStr, } case shared.DUMP: - logWithCommand.Info("starting in data dump mode") + logWithCommand.Info("Starting in data dump mode") dumpDstStr := viper.GetString("database.dumpDestination") dumpDst, err := dump.ResolveDumpType(dumpDstStr) if err != nil { @@ -349,7 +349,7 @@ func getConfig(nodeInfo node.Info) (interfaces.Config, error) { return nil, fmt.Errorf("unrecognized dump destination: %s", dumpDst) } case shared.POSTGRES: - logWithCommand.Info("starting in postgres mode") + logWithCommand.Info("Starting in postgres mode") driverTypeStr := viper.GetString("database.driver") driverType, err := postgres.ResolveDriverType(driverTypeStr) if err != nil { diff --git a/cmd/serve.go b/cmd/serve.go index c0e6068..6ba7b7d 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -68,12 +68,12 @@ func serve() { // report latest block info header, err := reader.GetLatestHeader() if err != nil { - logWithCommand.Fatalf("unable to determine latest header height and hash: %s", err.Error()) + logWithCommand.Fatalf("Unable to determine latest header height and hash: %s", err.Error()) } if header.Number == nil { - logWithCommand.Fatal("latest header found in levelDB has a nil block height") + logWithCommand.Fatal("Latest header found in levelDB has a nil block height") } - logWithCommand.Infof("latest block found in the levelDB\r\nheight: %s, hash: %s", header.Number.String(), header.Hash().Hex()) + logWithCommand.Infof("Latest block found in the levelDB\r\nheight: %s, hash: %s", header.Number.String(), header.Hash().Hex()) statediffService, err := createStateDiffService(reader, chainConf, nodeInfo) if err != nil { @@ -94,7 +94,7 @@ func serve() { if viper.GetBool("prerun.only") { parallel := viper.GetBool("prerun.parallel") if err := statediffService.Run(nil, parallel); err != nil { - logWithCommand.Fatal("unable to perform prerun: %v", err) + logWithCommand.Fatal("Unable to perform prerun: %v", err) } return } @@ -124,17 +124,17 @@ func startServers(serv sd.StateDiffService) error { ipcPath := viper.GetString("server.ipcPath") httpPath := viper.GetString("server.httpPath") if ipcPath == "" && httpPath == "" { - logWithCommand.Fatal("need an ipc path and/or an http path") + logWithCommand.Fatal("Need an ipc path and/or an http path") } if ipcPath != "" { - logWithCommand.Info("starting up IPC server") + logWithCommand.Info("Starting up IPC server") _, _, err := srpc.StartIPCEndpoint(ipcPath, serv.APIs()) if err != nil { return err } } if httpPath != "" { - logWithCommand.Info("starting up HTTP server") + logWithCommand.Info("Starting up HTTP server") _, err := srpc.StartHTTPEndpoint(httpPath, serv.APIs(), []string{"statediff"}, nil, []string{"*"}, rpc.HTTPTimeouts{}) if err != nil { return err diff --git a/cmd/stats.go b/cmd/stats.go index b4bd04a..abf91f7 100644 --- a/cmd/stats.go +++ b/cmd/stats.go @@ -45,10 +45,10 @@ func stats() { header, err := reader.GetLatestHeader() if err != nil { - logWithCommand.Fatalf("unable to determine latest header height and hash: %s", err.Error()) + logWithCommand.Fatalf("Unable to determine latest header height and hash: %s", err.Error()) } if header.Number == nil { - logWithCommand.Fatal("latest header found in levelDB has a nil block height") + logWithCommand.Fatal("Latest header found in levelDB has a nil block height") } - logWithCommand.Infof("latest block found in the levelDB\r\nheight: %s, hash: %s", header.Number.String(), header.Hash().Hex()) + logWithCommand.Infof("Latest block found in the levelDB\r\nheight: %s, hash: %s", header.Number.String(), header.Hash().Hex()) } diff --git a/cmd/util.go b/cmd/util.go index ad1c814..a906a64 100644 --- a/cmd/util.go +++ b/cmd/util.go @@ -120,7 +120,7 @@ func instantiateLevelDBReader() (sd.Reader, *params.ChainConfig, node.Info) { } if err != nil { - logWithCommand.Fatalf("unable to instantiate chain config: %s", err.Error()) + logWithCommand.Fatalf("Unable to instantiate chain config: %s", err.Error()) } // create LevelDB reader @@ -140,7 +140,7 @@ func instantiateLevelDBReader() (sd.Reader, *params.ChainConfig, node.Info) { } reader, err := sd.NewLvlDBReader(readerConf) if err != nil { - logWithCommand.Fatalf("unable to instantiate levelDB reader: %s", err.Error()) + logWithCommand.Fatalf("Unable to instantiate levelDB reader: %s", err.Error()) } return reader, chainConf, nodeInfo }