diff --git a/api/client.go b/api/client.go index af7c54c1f8c8c475141f6aab19862de87f1c6ebf..746ddbd3a9664c2f7423ab9c0d931ed3cb87914c 100644 --- a/api/client.go +++ b/api/client.go @@ -105,7 +105,7 @@ func VerifyNDF(ndfString, ndfPub string) *ndf.NetworkDefinition { // is created // returns a new Client object, and an error if it fails func NewClient(s globals.Storage, loc string, ndfJSON *ndf.NetworkDefinition) (*Client, error) { - globals.Log.INFO.Printf("NDF: %+v\n", ndfJSON) + globals.Log.DEBUG.Printf("NDF: %+v\n", ndfJSON) var store globals.Storage if s == nil { globals.Log.INFO.Printf("No storage provided," + diff --git a/cmd/root.go b/cmd/root.go index 9418aa09a7f1bcd16c6e8c75d8bcc69b88317f3c..027a7fa99bf08224618e4ef2f29565434289da6c 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -189,15 +189,6 @@ func sessionInitialization() (*id.User, *api.Client) { globals.Log.INFO.Printf("Skipped Registration, user: %v", uid) } - // Log the user in, for now using the first gateway specified - // This will also register the user email with UDB - _, err = client.Login(uid) - if err != nil { - globals.Log.ERROR.Printf("Could Not Log In: %s\n", err) - return id.ZeroID, nil - } - globals.Log.INFO.Println("Logged In!") - return uid, client } @@ -366,6 +357,15 @@ var rootCmd = &cobra.Command{ client.Listen(id.ZeroID, int32(cmixproto.Type_NO_TYPE), &fallback) + // Log the user in, for now using the first gateway specified + // This will also register the user email with UDB + globals.Log.INFO.Println("Logging in...") + _, err := client.Login(userID) + if err != nil { + globals.Log.FATAL.Panicf("Could Not Log In: %s\n", err) + } + globals.Log.INFO.Println("Logged In!") + // Do calculation for dummy messages if the flag is set if dummyFrequency != 0 { dummyPeriod = time.Nanosecond * @@ -464,7 +464,7 @@ var rootCmd = &cobra.Command{ } //Logout - err := client.Logout() + err = client.Logout() if err != nil { globals.Log.ERROR.Printf("Could not logout: %s\n", err.Error()) @@ -596,8 +596,8 @@ func initLog() { globals.Log.SetStdoutThreshold(jww.LevelDebug) globals.Log.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds) } else { - globals.Log.SetLogThreshold(jww.LevelWarn) - globals.Log.SetStdoutThreshold(jww.LevelWarn) + globals.Log.SetLogThreshold(jww.LevelInfo) + globals.Log.SetStdoutThreshold(jww.LevelInfo) } if viper.Get("logPath") != nil { // Create log file, overwrites if existing diff --git a/io/messaging.go b/io/messaging.go index 74694176bbe677dfdbca8c6bdec426e1de87e186..f770b4f8e22acca71d0dfba9ac67a55628f47b80 100644 --- a/io/messaging.go +++ b/io/messaging.go @@ -367,7 +367,7 @@ func (m *Messaging) receiveMessagesFromGateway(session user.Session, return nil } - globals.Log.INFO.Printf("Checking novelty of %v messages", len(messages.IDs)) + globals.Log.DEBUG.Printf("Checking novelty of %v messages", len(messages.IDs)) results := make([]*format.Message, 0, len(messages.IDs)) for _, messageID := range messages.IDs {