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
eeec06b7
Commit
eeec06b7
authored
5 months ago
by
Somnath Ghorpade
Browse files
Options
Downloads
Patches
Plain Diff
Resolved conflicts.
parent
5413cd94
Branches
SG_Conflict_resolved
1 merge request
!297
Resolved conflicts.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
loggermdl/loggerdefault.go
+1
-1
loggermdl/loggerdefault.go
loggermdl/loggerdefault_test.go
+38
-39
loggermdl/loggerdefault_test.go
with
39 additions
and
40 deletions
loggermdl/loggerdefault.go
+
1
−
1
View file @
eeec06b7
...
...
@@ -54,7 +54,7 @@ func LogError(args ...interface{}) {
// LogPanic logs a message at level Panic on the standard logger.
func
LogPanic
(
args
...
interface
{})
{
log
.
Panic
(
args
)
log
.
Panic
(
args
...
)
}
// // LogJSONObject Format string
...
...
This diff is collapsed.
Click to expand it.
loggermdl/loggerdefault_test.go
+
38
−
39
View file @
eeec06b7
...
...
@@ -4,7 +4,6 @@
package
loggermdl
import
(
"encoding/json"
"fmt"
"testing"
...
...
@@ -46,56 +45,56 @@ func ExampleLogDebug() {
//Output:
//
}
func
TestLogJSONString
(
t
*
testing
.
T
)
{
a
:=
`{"Age": 1,"Name": "sometext"}`
//
func TestLogJSONString(t *testing.T) {
//
a := `{"Age": 1,"Name": "sometext"}`
assert
.
NotPanics
(
t
,
func
()
{
LogJSONString
(
a
)
},
"The code did panic"
)
//
assert.NotPanics(t, func() { LogJSONString(a) }, "The code did panic")
//Output2:
// {
// "Age": 1,
// "Name": "sometext"
// }
}
//
//Output2:
//
// {
//
// "Age": 1,
//
// "Name": "sometext"
//
// }
//
}
func
ExampleLogHREnd
()
{
LogHREnd
()
//Output:
//<<<<<<<<<<<<<<<<<<<<<<<
}
func
TestLogJSONObject
(
t
*
testing
.
T
)
{
type
MySt
struct
{
Name
string
Age
int
}
m
:=
MySt
{
"sometext"
,
1
}
// jsonUnmarshal(json.Marshal(m), &m)
assert
.
NotPanics
(
t
,
func
()
{
LogJSONObject
(
m
)
},
"The code did panic"
)
//Output1:
//{
// "Age": 1,
// "Name": "sometext"
//}
}
//
func TestLogJSONObject(t *testing.T) {
//
type MySt struct {
//
Name string
//
Age int
//
}
//
m := MySt{"sometext", 1}
//
// jsonUnmarshal(json.Marshal(m), &m)
//
assert.NotPanics(t, func() { LogJSONObject(m) }, "The code did panic")
//
//Output1:
//
//{
//
// "Age": 1,
//
// "Name": "sometext"
//
//}
//
}
func
TestLogJSONByte
(
t
*
testing
.
T
)
{
// func ExampleLogJSONByte() {
//
func TestLogJSONByte(t *testing.T) { // func ExampleLogJSONByte() {
type
MySt
struct
{
Name
string
Age
int
}
m
:=
MySt
{
"sometext"
,
1
}
a
,
_
:=
json
.
Marshal
(
m
)
//
type MySt struct {
//
Name string
//
Age int
//
}
//
m := MySt{"sometext", 1}
//
a, _ := json.Marshal(m)
assert
.
NotPanics
(
t
,
func
()
{
LogJSONByte
(
a
)
},
"The code did panic"
)
//Output1:
// {
// "Age": 1,
// "Name": "sometext"
// }
//
assert.NotPanics(t, func() { LogJSONByte(a) }, "The code did panic")
//
//Output1:
//
// {
//
// "Age": 1,
//
// "Name": "sometext"
//
// }
}
//
}
func
ExampleLogHRStart
()
{
LogHRStart
()
//Output:
...
...
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