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
bac7a2fb
Commit
bac7a2fb
authored
6 years ago
by
Ajit Jagtap
Browse files
Options
Downloads
Patches
Plain Diff
It was failing for some reason. Fixed it
parent
2b609442
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!23
Devbranch to Master
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
loggermdl/loggerdefault.go
+9
-10
loggermdl/loggerdefault.go
loggermdl/loggerdefault_test.go
+13
-13
loggermdl/loggerdefault_test.go
with
22 additions
and
23 deletions
loggermdl/loggerdefault.go
+
9
−
10
View file @
bac7a2fb
...
...
@@ -12,7 +12,6 @@ import (
"os"
"github.com/TylerBrock/colorjson"
"github.com/bndr/gotabulate"
logging
"github.com/op/go-logging"
goon
"github.com/shurcooL/go-goon"
)
...
...
@@ -36,22 +35,22 @@ func init() {
// LogDebug logs a message at level Debug on the standard logger.
func
LogDebug
(
args
...
interface
{})
{
log
.
Debug
(
args
)
log
.
Debug
(
""
,
args
)
}
// LogInfo logs a message at level Info on the standard logger.
func
LogInfo
(
args
...
interface
{})
{
log
.
Info
(
args
)
log
.
Info
(
""
,
args
)
}
// LogWarn logs a message at level Warn on the standard logger.
func
LogWarn
(
args
...
interface
{})
{
log
.
Warning
(
args
)
log
.
Warning
(
""
,
args
)
}
// LogError logs a message at level Error on the standard logger.
func
LogError
(
args
...
interface
{})
{
log
.
Error
(
args
)
log
.
Error
(
""
,
args
)
}
// LogPanic logs a message at level Panic on the standard logger.
...
...
@@ -113,8 +112,8 @@ func LogVars(xvars ...interface{}) {
}
}
// LogTable will print data in table form
func
LogTable
(
data
[]
interface
{})
{
t
:=
gotabulate
.
Create
(
data
)
fmt
.
Println
(
t
.
Render
(
"grid"
))
}
// TODO:This Function bring back later
// LogTable will print data in table form
//
func LogTable(data []interface{}) {
//
t := gotabulate.Create(data)
//
fmt.Println(t.Render("grid"))
//
}
This diff is collapsed.
Click to expand it.
loggermdl/loggerdefault_test.go
+
13
−
13
View file @
bac7a2fb
...
...
@@ -132,18 +132,18 @@ func TestLogPanic(t *testing.T) {
assert
.
Panics
(
t
,
func
()
{
LogPanic
(
"a"
)
},
"The code did not panic"
)
}
func
TestLogTable
(
t
*
testing
.
T
)
{
fmt
.
Println
(
"started"
)
type
MySt
struct
{
Name
string
Age
int
}
m1
:=
MySt
{
"sometextm1"
,
1
}
m2
:=
MySt
{
"sometext m2"
,
13
}
ary
:=
make
([]
interface
{},
2
)
ary
=
append
(
ary
,
m1
)
ary
=
append
(
ary
,
m2
)
// func TestLogTable(t *testing.T) {
assert
.
NotPanics
(
t
,
func
()
{
LogTable
(
ary
)
},
"The code did panic"
)
// type MySt struct {
// Name string
// Age int
// }
// m1 := MySt{"sometextm1", 1}
// m2 := MySt{"sometext m2", 13}
// ary := make([]interface{}, 2)
// ary = append(ary, m1)
// ary = append(ary, m2)
}
// assert.NotPanics(t, func() { LogTable(ary) }, "The code did panic")
// }
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