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

refactor example_test.go

parent 917eede9
No related branches found
No related tags found
No related merge requests found
......@@ -56,11 +56,12 @@ func TestExample(t *testing.T) {
ws := &BufferedWriteSyncer{Service: service}
logger := zap.New(NewCore(ws))
// Пример отправки логов для сервиса Items
{
logger := logger.With(Component("Items"))
ctx := auth.WithPrincipal(context.Background(), &auth.Anonymous{})
// Отправка лога при создании item
logger.Info("Successfully created",
Event(items.EventCreateItem),
Object(items.NewItem("WPNN", "9VGP", "GxNv", "W0fl", nil, nil)),
......@@ -68,6 +69,7 @@ func TestExample(t *testing.T) {
Tags("tag1", "tag2", "tag3"),
)
// Отправка лога при обновлении item
logger.Warn("Successfully updated",
Event(items.EventUpdateItem),
Object(items.NewItem("WPNN", "9VGP", "GxNv", "cmV2cw", nil, nil)),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment