do not check event saved in db or not when get event log by eventID

This commit is contained in:
凡羊羊 2019-10-12 16:55:36 +08:00
parent 6ac930d7d6
commit 4647510877
2 changed files with 13 additions and 7 deletions

View File

@ -142,10 +142,6 @@ func (l *LogAction) GetLogInstance(serviceID string) (string, error) {
//GetLevelLog 获取指定操作的操作日志
func (l *LogAction) GetLevelLog(eventID string, level string) (*api_model.DataLog, error) {
_, err := db.GetManager().ServiceEventDao().GetEventByEventID(eventID)
if err != nil {
return nil, err
}
messageList, err := l.eventdb.GetMessages(eventID, level)
if err != nil {
return nil, err

View File

@ -20,13 +20,14 @@ package handler
import (
"fmt"
api_db "github.com/goodrain/rainbond/api/db"
api_model "github.com/goodrain/rainbond/api/model"
"github.com/goodrain/rainbond/cmd/api/option"
"os/exec"
"testing"
"time"
api_db "github.com/goodrain/rainbond/api/db"
api_model "github.com/goodrain/rainbond/api/model"
"github.com/goodrain/rainbond/cmd/api/option"
"github.com/Sirupsen/logrus"
)
@ -44,6 +45,15 @@ func TestEmessage(t *testing.T) {
fmt.Printf("end.\n")
}
func TestGetLevelLog(t *testing.T) {
l := CreateLogManager([]string{"http://192.168.2.172:2379"})
messageList, err := l.eventdb.GetMessages("df07f2b579364cf791137d33aceb89be", "debug")
if err != nil {
t.Fatal(err)
}
t.Log(messageList)
}
func getLevelLog(eventID string, level string) (*api_model.DataLog, error) {
//messages, err := db.GetManager().EventLogDao().GetEventLogMessages(eventID)
//if err != nil {