Skip to content
Snippets Groups Projects
Commit e616ef7f authored by ko_oler's avatar ko_oler
Browse files

исправление метода ToMap

parent 1ea01c44
No related branches found
No related tags found
No related merge requests found
...@@ -103,7 +103,7 @@ func (e *Entry) ToMap() map[string]any { ...@@ -103,7 +103,7 @@ func (e *Entry) ToMap() map[string]any {
res := map[string]any{ res := map[string]any{
"id": e.ID, "id": e.ID,
"timestamp": e.Timestamp, "timestamp": e.Timestamp,
"log_level": e.Level, "level": e.Level,
"message": e.Message, "message": e.Message,
"category": e.Category, "category": e.Category,
"component": e.Component, "component": e.Component,
......
...@@ -42,7 +42,7 @@ func TestEntry_ToMap(t *testing.T) { ...@@ -42,7 +42,7 @@ func TestEntry_ToMap(t *testing.T) {
nil, nil,
nil, nil,
}, },
map[string]interface{}{"caller": map[string]interface{}{"type": "user", "user_id": "<user_id>"}, "caller_id": "/users/<user_id>", "category": "", "component": "", "event": "", "id": "1", "log_level": Level(0), "message": "message", "object": map[string]interface{}{"env_id": "<env_id>", "space_id": "<space_id>", "type": "environment"}, "object_id": "/spaces/<space_id>/envs/<env_id>", "timestamp": time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC)}, map[string]interface{}{"caller": map[string]interface{}{"type": "user", "user_id": "<user_id>"}, "caller_id": "/users/<user_id>", "category": "", "component": "", "event": "", "id": "1", "level": Level(0), "message": "message", "object": map[string]interface{}{"env_id": "<env_id>", "space_id": "<space_id>", "type": "environment"}, "object_id": "/spaces/<space_id>/envs/<env_id>", "timestamp": time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC)},
}, },
} }
for _, tt := range tests { for _, tt := range tests {
......
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