Skip to content
Snippets Groups Projects
Commit c42f5836 authored by Rick Carback's avatar Rick Carback
Browse files

add debug info to the client outputs

parent ad325704
No related branches found
No related tags found
No related merge requests found
...@@ -87,10 +87,13 @@ func sessionInitialization() (*id.User, *api.Client) { ...@@ -87,10 +87,13 @@ func sessionInitialization() (*id.User, *api.Client) {
} }
// Verify the signature // Verify the signature
globals.Log.INFO.Println("Verifying NDF...")
ndfJSON := api.VerifyNDF(string(ndfBytes), ndfPubKey) ndfJSON := api.VerifyNDF(string(ndfBytes), ndfPubKey)
globals.Log.INFO.Printf("NDF Verified: %v", ndfJSON)
// Overwrite the network definition with any specified flags // Overwrite the network definition with any specified flags
overwriteNDF(ndfJSON) overwriteNDF(ndfJSON)
globals.Log.INFO.Printf("Overwrote NDF Vars: %v", ndfJSON)
//If no session file is passed initialize with RAM Storage //If no session file is passed initialize with RAM Storage
if sessionFile == "" { if sessionFile == "" {
...@@ -100,6 +103,7 @@ func sessionInitialization() (*id.User, *api.Client) { ...@@ -100,6 +103,7 @@ func sessionInitialization() (*id.User, *api.Client) {
err.Error()) err.Error())
return id.ZeroID, nil return id.ZeroID, nil
} }
globals.Log.INFO.Println("Initialized Ram Storage")
register = true register = true
} else { } else {
//If a session file is passed, check if it's valid //If a session file is passed, check if it's valid
...@@ -123,9 +127,12 @@ func sessionInitialization() (*id.User, *api.Client) { ...@@ -123,9 +127,12 @@ func sessionInitialization() (*id.User, *api.Client) {
globals.Log.ERROR.Printf("Could Not Initialize OS Storage: %s\n", err.Error()) globals.Log.ERROR.Printf("Could Not Initialize OS Storage: %s\n", err.Error())
return id.ZeroID, nil return id.ZeroID, nil
} }
globals.Log.INFO.Println("Initialized OS Storage")
} }
if noBlockingTransmission { if noBlockingTransmission {
globals.Log.INFO.Println("Disabling Blocking Transmissions")
client.DisableBlockingTransmission() client.DisableBlockingTransmission()
} }
...@@ -142,17 +149,21 @@ func sessionInitialization() (*id.User, *api.Client) { ...@@ -142,17 +149,21 @@ func sessionInitialization() (*id.User, *api.Client) {
} }
// Connect to gateways and reg server // Connect to gateways and reg server
globals.Log.INFO.Println("Connecting...")
err = client.Connect() err = client.Connect()
if err != nil { if err != nil {
globals.Log.FATAL.Panicf("Could not call connect on client: %+v", err) globals.Log.FATAL.Panicf("Could not call connect on client: %+v", err)
} }
globals.Log.INFO.Println("Connected!")
// Holds the User ID // Holds the User ID
var uid *id.User var uid *id.User
// Register a new user if requested // Register a new user if requested
if register { if register {
globals.Log.INFO.Println("Registering...")
regCode := registrationCode regCode := registrationCode
// If precanned user, use generated code instead // If precanned user, use generated code instead
if userId != 0 { if userId != 0 {
...@@ -176,6 +187,7 @@ func sessionInitialization() (*id.User, *api.Client) { ...@@ -176,6 +187,7 @@ func sessionInitialization() (*id.User, *api.Client) {
uid = id.NewUserFromUints(&[4]uint64{0, 0, 0, userId}) uid = id.NewUserFromUints(&[4]uint64{0, 0, 0, userId})
// clear userEmail if it was defined, since login was previously done // clear userEmail if it was defined, since login was previously done
userEmail = "" userEmail = ""
globals.Log.INFO.Println("Skipped Registration, user: %v", uid)
} }
// Log the user in, for now using the first gateway specified // Log the user in, for now using the first gateway specified
...@@ -185,6 +197,7 @@ func sessionInitialization() (*id.User, *api.Client) { ...@@ -185,6 +197,7 @@ func sessionInitialization() (*id.User, *api.Client) {
globals.Log.ERROR.Printf("Could Not Log In: %s\n", err) globals.Log.ERROR.Printf("Could Not Log In: %s\n", err)
return id.ZeroID, nil return id.ZeroID, nil
} }
globals.Log.INFO.Println("Logged In!")
return uid, client return uid, client
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment