Skip to content
Snippets Groups Projects
Commit 2e4998de authored by Semyon Krestyaninov's avatar Semyon Krestyaninov
Browse files

fix typo

parent 0071ecea
No related branches found
No related tags found
No related merge requests found
...@@ -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 {
......
...@@ -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"),
ObjectID("/spaces/WPNN/envs/9VGP/cols/GxNv/items/W0fl"), Object("/spaces/WPNN/envs/9VGP/cols/GxNv/items/W0fl"),
CallerID("/users/PHVz"), Caller("/users/PHVz"),
Attr("any"), Attr("any"),
Tags("tag1", "tag2", "tag3"), Tags("tag1", "tag2", "tag3"),
}, },
......
...@@ -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),
ObjectID(item), Object(item),
CallerIDFromContext(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),
ObjectID(item), Object(item),
CallerIDFromContext(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"}}),
) )
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment