Skip to content
Snippets Groups Projects
Commit 0cb42c57 authored by Pavel Antonov's avatar Pavel Antonov :asterisk:
Browse files

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

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