Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-userCenter
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujiebin
hilo-userCenter
Commits
0f76eaf8
Commit
0f76eaf8
authored
Dec 26, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:精简日志
parent
b6053ce9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
main.go
main.go
+4
-4
No files found.
main.go
View file @
0f76eaf8
...
...
@@ -89,7 +89,7 @@ var kasp = keepalive.ServerParameters{
}
func
(
s
*
server
)
Login
(
ctx
context
.
Context
,
in
*
userCenter
.
LoginMessage
)
(
*
userCenter
.
LoginMessageRsp
,
error
)
{
mylogrus
.
MyLog
.
Infof
(
"Received loginMsg: %s, from proxy %s, client %s
\n
"
,
in
.
Token
,
in
.
ProxyAddr
,
in
.
ClientAddr
)
//
mylogrus.MyLog.Infof("Received loginMsg: %s, from proxy %s, client %s\n", in.Token, in.ProxyAddr, in.ClientAddr)
var
loginStatus
uint32
=
common
.
Login_success
claim
,
err
:=
common
.
ParseToken
(
in
.
GetToken
())
...
...
@@ -106,7 +106,7 @@ func (s *server) Login(ctx context.Context, in *userCenter.LoginMessage) (*userC
// FIXME: 发现用户已经登录,要踢走旧连接
proxyAddr
:=
userManager
.
GetUser
(
claim
.
UserId
)
if
proxyAddr
!=
nil
{
mylogrus
.
MyLog
.
Infof
(
"%d has existing value %s"
,
claim
.
UserId
,
*
proxyAddr
)
//
mylogrus.MyLog.Infof("%d has existing value %s", claim.UserId, *proxyAddr)
kickChan
<-
KickChanMsg
{
userId
:
claim
.
UserId
,
proxyAddr
:
*
proxyAddr
,
...
...
@@ -127,7 +127,7 @@ func (s *server) Login(ctx context.Context, in *userCenter.LoginMessage) (*userC
}
else
{
mylogrus
.
MyLog
.
Errorf
(
"wrong user %d"
,
claim
.
UserId
)
}
mylogrus
.
MyLog
.
Infof
(
"adding user %d"
,
claim
.
UserId
)
//
mylogrus.MyLog.Infof("adding user %d", claim.UserId)
// save to redis
userManager
.
AddUser
(
claim
.
UserId
,
in
.
ProxyAddr
)
...
...
@@ -693,7 +693,7 @@ func main() {
func
kick
(
n
int
)
{
for
msg
:=
range
kickChan
{
mylogrus
.
MyLog
.
Infof
(
"handling kick in:%d,msg:%+v"
,
n
,
msg
)
//
mylogrus.MyLog.Infof("handling kick in:%d,msg:%+v", n, msg)
clientAddr
:=
termManager
.
GetTerminal
(
msg
.
userId
)
if
clientAddr
==
nil
{
//mylogrus.MyLog.Errorf("No terminal found for %d", msg.userId)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment