mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 10:48:15 +08:00
do not check event saved in db or not when get event log by eventID
This commit is contained in:
parent
6ac930d7d6
commit
4647510877
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user