Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
corepkgv2
Commits
1633dcca
Commit
1633dcca
authored
5 years ago
by
Ajit Jagtap
Browse files
Options
Downloads
Plain Diff
Merge branch 'Roshanp-Cachechanges' into 'devbranch'
cache mdl get all items added See merge request
!69
parents
aa9f793f
7c47bde6
Branches
Branches containing commit
Tags
V3
Tags containing commit
1 merge request
!69
cache mdl get all items added
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cachemdl/cachemdl.go
+4
-0
cachemdl/cachemdl.go
loggermdl/loggerdefault.go
+28
-30
loggermdl/loggerdefault.go
with
32 additions
and
30 deletions
cachemdl/cachemdl.go
+
4
−
0
View file @
1633dcca
...
...
@@ -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
)
}
...
...
This diff is collapsed.
Click to expand it.
loggermdl/loggerdefault.go
+
28
−
30
View file @
1633dcca
...
...
@@ -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
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets