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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
8c2061c1
Commit
8c2061c1
authored
1 year ago
by
Alena Petraki
Browse files
Options
Downloads
Patches
Plain Diff
Рефакторинг
parent
b53c1a71
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
zap/field.go
+2
-4
2 additions, 4 deletions
zap/field.go
with
2 additions
and
4 deletions
zap/field.go
+
2
−
4
View file @
8c2061c1
...
...
@@ -29,15 +29,13 @@ func Event(event string) zap.Field {
// Object возвращает поле и устанавливает передаваемый аргумент в качестве идентификатора объекта в формате ObjectId.
// Поддерживает типы в формате ObjectId: id.Descriptor, string, map[string]any, системные объекты.
func
Object
(
v
any
)
zap
.
Field
{
oid
,
_
:=
id
.
NewObjectId
(
v
)
return
zap
.
Reflect
(
"object"
,
oid
)
return
zap
.
Reflect
(
"object"
,
id
.
MustObjectId
(
v
))
}
// Caller возвращает поле и устанавливает передаваемый аргумент в качестве "вызывающего" в формате ObjectId.
// Поддерживает типы в формате ObjectId: id.Descriptor, string, map[string]any, системные объекты.
func
Caller
(
v
any
)
zap
.
Field
{
oid
,
_
:=
id
.
NewObjectId
(
v
)
return
zap
.
Reflect
(
"caller"
,
oid
)
return
zap
.
Reflect
(
"caller"
,
id
.
MustObjectId
(
v
))
}
// CallerFromContext извлекает auth.Principal из контекста и устанавливает его в качестве "вызывающего" в формате Object.
...
...
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