Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package 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
perxis
perxis-go
Commits
2e4998de
Commit
2e4998de
authored
1 year ago
by
Semyon Krestyaninov
Browse files
Options
Downloads
Patches
Plain Diff
fix typo
parent
0071ecea
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
log/zap/core.go
+2
-2
2 additions, 2 deletions
log/zap/core.go
log/zap/core_test.go
+2
-2
2 additions, 2 deletions
log/zap/core_test.go
log/zap/example_test.go
+4
-4
4 additions, 4 deletions
log/zap/example_test.go
with
8 additions
and
8 deletions
log/zap/core.go
+
2
−
2
View file @
2e4998de
...
@@ -72,8 +72,8 @@ func (core *Core) getEntry(entry zapcore.Entry, fields []zapcore.Field) *log.Ent
...
@@ -72,8 +72,8 @@ func (core *Core) getEntry(entry zapcore.Entry, fields []zapcore.Field) *log.Ent
ent
.
Category
,
_
=
enc
.
Fields
[
"category"
]
.
(
string
)
ent
.
Category
,
_
=
enc
.
Fields
[
"category"
]
.
(
string
)
ent
.
Component
,
_
=
enc
.
Fields
[
"component"
]
.
(
string
)
ent
.
Component
,
_
=
enc
.
Fields
[
"component"
]
.
(
string
)
ent
.
Event
,
_
=
enc
.
Fields
[
"event"
]
.
(
string
)
ent
.
Event
,
_
=
enc
.
Fields
[
"event"
]
.
(
string
)
ent
.
ObjectID
,
_
=
enc
.
Fields
[
"object
_id
"
]
.
(
*
oid
.
ObjectId
)
ent
.
ObjectID
,
_
=
enc
.
Fields
[
"object"
]
.
(
*
oid
.
ObjectId
)
ent
.
CallerID
,
_
=
enc
.
Fields
[
"caller
_id
"
]
.
(
*
oid
.
ObjectId
)
ent
.
CallerID
,
_
=
enc
.
Fields
[
"caller"
]
.
(
*
oid
.
ObjectId
)
ent
.
Attr
=
enc
.
Fields
[
"attr"
]
ent
.
Attr
=
enc
.
Fields
[
"attr"
]
if
tags
,
ok
:=
enc
.
Fields
[
"tags"
]
.
([]
any
);
ok
{
if
tags
,
ok
:=
enc
.
Fields
[
"tags"
]
.
([]
any
);
ok
{
...
...
This diff is collapsed.
Click to expand it.
log/zap/core_test.go
+
2
−
2
View file @
2e4998de
...
@@ -33,8 +33,8 @@ func TestCore_getEntry(t *testing.T) {
...
@@ -33,8 +33,8 @@ func TestCore_getEntry(t *testing.T) {
Category
(
"create"
),
Category
(
"create"
),
Component
(
"Items.Service"
),
Component
(
"Items.Service"
),
Event
(
"Items.Create"
),
Event
(
"Items.Create"
),
Object
ID
(
"/spaces/WPNN/envs/9VGP/cols/GxNv/items/W0fl"
),
Object
(
"/spaces/WPNN/envs/9VGP/cols/GxNv/items/W0fl"
),
Caller
ID
(
"/users/PHVz"
),
Caller
(
"/users/PHVz"
),
Attr
(
"any"
),
Attr
(
"any"
),
Tags
(
"tag1"
,
"tag2"
,
"tag3"
),
Tags
(
"tag1"
,
"tag2"
,
"tag3"
),
},
},
...
...
This diff is collapsed.
Click to expand it.
log/zap/example_test.go
+
4
−
4
View file @
2e4998de
...
@@ -75,16 +75,16 @@ func TestExample(t *testing.T) {
...
@@ -75,16 +75,16 @@ func TestExample(t *testing.T) {
// Отправка лога при создании item
// Отправка лога при создании item
logger
.
Info
(
"Successfully created"
,
logger
.
Info
(
"Successfully created"
,
Event
(
items
.
EventCreateItem
),
Event
(
items
.
EventCreateItem
),
Object
ID
(
item
),
Object
(
item
),
Caller
ID
FromContext
(
ctx
),
CallerFromContext
(
ctx
),
Tags
(
"tag1"
,
"tag2"
,
"tag3"
),
Tags
(
"tag1"
,
"tag2"
,
"tag3"
),
)
)
// Отправка лога при обновлении item
// Отправка лога при обновлении item
logger
.
Warn
(
"Successfully updated"
,
logger
.
Warn
(
"Successfully updated"
,
Event
(
items
.
EventUpdateItem
),
Event
(
items
.
EventUpdateItem
),
Object
ID
(
item
),
Object
(
item
),
Caller
ID
FromContext
(
ctx
),
CallerFromContext
(
ctx
),
Attr
(
map
[
string
]
map
[
string
]
any
{
"title"
:
{
"old"
:
"old title"
,
"new"
:
"new title"
}}),
Attr
(
map
[
string
]
map
[
string
]
any
{
"title"
:
{
"old"
:
"old title"
,
"new"
:
"new title"
}}),
)
)
}
}
...
...
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