Commit 1633dcca authored by Ajit Jagtap's avatar Ajit Jagtap
Browse files

Merge branch 'Roshanp-Cachechanges' into 'devbranch'

cache mdl get all items added

See merge request !69
parents aa9f793f 7c47bde6
Branches
Tags V3
1 merge request!69cache mdl get all items added
Showing with 32 additions and 30 deletions
......@@ -90,6 +90,10 @@ func (fastCacheHelper *FastCacheHelper) Get(key string) (interface{}, bool) {
return fastCacheHelper.FastCache.Get(key)
}
func (fastCacheHelper *FastCacheHelper) GetItems() map[string]cache.Item {
return fastCacheHelper.FastCache.Items()
}
func (fastCacheHelper *FastCacheHelper) SetNoExpiration(key string, object interface{}) {
fastCacheHelper.FastCache.Set(key, object, cache.NoExpiration)
}
......
......@@ -7,11 +7,9 @@
package loggermdl
import (
"encoding/json"
"fmt"
"os"
"github.com/TylerBrock/colorjson"
logging "github.com/op/go-logging"
goon "github.com/shurcooL/go-goon"
)
......@@ -58,42 +56,42 @@ func LogPanic(args ...interface{}) {
log.Panic(args)
}
// LogJSONObject Format string
func LogJSONObject(pobj interface{}) {
jsonByte, _ := json.Marshal(pobj)
var objnew map[string]interface{}
json.Unmarshal(jsonByte, &objnew)
// // LogJSONObject Format string
// func LogJSONObject(pobj interface{}) {
// jsonByte, _ := json.Marshal(pobj)
// var objnew map[string]interface{}
// json.Unmarshal(jsonByte, &objnew)
f := colorjson.NewFormatter()
f.Indent = 2
// f := colorjson.NewFormatter()
// f.Indent = 2
s, _ := f.Marshal(objnew)
fmt.Println(string(s))
}
// s, _ := f.Marshal(objnew)
// fmt.Println(string(s))
// }
// LogJSONByte Format string
func LogJSONByte(pobj []byte) {
var objnew map[string]interface{}
json.Unmarshal(pobj, &objnew)
// // LogJSONByte Format string
// func LogJSONByte(pobj []byte) {
// var objnew map[string]interface{}
// json.Unmarshal(pobj, &objnew)
f := colorjson.NewFormatter()
f.Indent = 2
// f := colorjson.NewFormatter()
// f.Indent = 2
s, _ := f.Marshal(objnew)
fmt.Println(string(s))
}
// s, _ := f.Marshal(objnew)
// fmt.Println(string(s))
// }
// LogJSONString Format string
func LogJSONString(str string) {
var objnew map[string]interface{}
json.Unmarshal([]byte(str), &objnew)
// // LogJSONString Format string
// func LogJSONString(str string) {
// var objnew map[string]interface{}
// json.Unmarshal([]byte(str), &objnew)
f := colorjson.NewFormatter()
f.Indent = 2
// f := colorjson.NewFormatter()
// f.Indent = 2
s, _ := f.Marshal(objnew)
fmt.Println(string(s))
}
// s, _ := f.Marshal(objnew)
// fmt.Println(string(s))
// }
// LogHRStart can end line with <<<
func LogHRStart() {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment