Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
658c404d
Commit
658c404d
authored
Jul 31, 2019
by
Rick Carback
Browse files
Options
Downloads
Patches
Plain Diff
Move login and set log levels to correct defaults
parent
2079f8fd
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/client.go
+1
-1
1 addition, 1 deletion
api/client.go
cmd/root.go
+12
-12
12 additions, 12 deletions
cmd/root.go
io/messaging.go
+1
-1
1 addition, 1 deletion
io/messaging.go
with
14 additions
and
14 deletions
api/client.go
+
1
−
1
View file @
658c404d
...
...
@@ -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,"
+
...
...
This diff is collapsed.
Click to expand it.
cmd/root.go
+
12
−
12
View file @
658c404d
...
...
@@ -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
.
Level
Warn
)
globals
.
Log
.
SetStdoutThreshold
(
jww
.
Level
Warn
)
globals
.
Log
.
SetLogThreshold
(
jww
.
Level
Info
)
globals
.
Log
.
SetStdoutThreshold
(
jww
.
Level
Info
)
}
if
viper
.
Get
(
"logPath"
)
!=
nil
{
// Create log file, overwrites if existing
...
...
This diff is collapsed.
Click to expand it.
io/messaging.go
+
1
−
1
View file @
658c404d
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment