Logging Web Interface
**Work in progress**
This commit is contained in:
1 parent
fa90dac953
commit
ea02452abc
5 files changed
+118
-12
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package DeviceDatabase
|
||||
|
||||
import (
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
)
|
||||
|
||||
func ReadCustom(timeRange, logLevel, logCategory, logImpact, logSeverity, logMessageName, logSender, logPage string) (events []LogDBEntry) {
|
||||
|
||||
//
|
||||
// TODO => Is currently stub
|
||||
//
|
||||
|
||||
query := logDBCollection.Find(bson.D{}).Sort(`-TimeUTC`).Limit(26)
|
||||
count := 26
|
||||
|
||||
if n, err := query.Count(); err == nil {
|
||||
count = n
|
||||
}
|
||||
|
||||
iter := query.Iter()
|
||||
entry := LogDBEntry{}
|
||||
pos := 0
|
||||
events = make([]LogDBEntry, count)
|
||||
|
||||
for iter.Next(&entry) {
|
||||
events[pos] = entry
|
||||
pos++
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
Reference in new issue
Block a user