Skip to content
Snippets Groups Projects
Commit 3e87b5fd authored by Alex Petraky's avatar Alex Petraky :basketball_player_tone1: Committed by Pavel Antonov
Browse files

Изменено название и значение констант событий в logging_middleware для коллекций

parent eea78cb4
No related branches found
No related tags found
No related merge requests found
package collections
const (
EventCollectionCreate = "collection_create"
EventCollectionUpdate = "collection_update"
EventCollectionDelete = "collection_delete"
EventCollectionSetSchema = "collection_set_schema"
EventCreate = "collection.create"
EventUpdate = "collection.update"
EventDelete = "collection.delete"
EventSetSchema = "collection.set_schema"
)
......@@ -31,7 +31,7 @@ func (m *loggingMiddleware) Create(ctx context.Context, collection *collections.
}
logger := m.logger.With(
logzap.CallerFromContext(ctx, spaceID),
logzap.Event(collections.EventCollectionCreate),
logzap.Event(collections.EventCreate),
)
created, err = m.next.Create(ctx, collection)
......@@ -47,7 +47,7 @@ func (m *loggingMiddleware) Create(ctx context.Context, collection *collections.
func (m *loggingMiddleware) Delete(ctx context.Context, spaceId string, envId string, collectionId string) (err error) {
logger := m.logger.With(
logzap.CallerFromContext(ctx, spaceId),
logzap.Event(collections.EventCollectionDelete),
logzap.Event(collections.EventDelete),
logzap.Object(id.NewCollectionId(spaceId, envId, collectionId)),
)
......@@ -92,7 +92,7 @@ func (m *loggingMiddleware) List(ctx context.Context, spaceId string, envId stri
func (m *loggingMiddleware) SetSchema(ctx context.Context, spaceId string, envId string, collectionId string, schema *schema.Schema) (err error) {
logger := m.logger.With(
logzap.CallerFromContext(ctx, spaceId),
logzap.Event(collections.EventCollectionSetSchema),
logzap.Event(collections.EventSetSchema),
logzap.Object(id.NewCollectionId(spaceId, envId, collectionId)),
)
......@@ -128,7 +128,7 @@ func (m *loggingMiddleware) Update(ctx context.Context, coll *collections.Collec
}
logger := m.logger.With(
logzap.CallerFromContext(ctx, spaceID),
logzap.Event(collections.EventCollectionUpdate),
logzap.Event(collections.EventUpdate),
logzap.Object(coll),
)
......
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