This repository was archived by the owner on Mar 14, 2019. It is now read-only.
File tree 2 files changed +9
-2
lines changed
src/main/scala/com/github/zhongl/housemd
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -158,13 +158,16 @@ class DetailWriter(writer: BufferedWriter) {
158
158
val thread = " [" + context.thread.getName + " ]"
159
159
val thisObject = if (context.thisObject == null ) " null" else context.thisObject.toString
160
160
val method = context.className + " ." + context.methodName
161
- val arguments = context.arguments.mkString(" [" , " " , " ]" )
161
+ val arguments = context.arguments.mkString(" [" + ObjUtils .parameterSeparator, ObjUtils .parameterSeparator , " ]" )
162
162
val resultOrExcption = context.resultOrException match {
163
163
case Some (x) => ObjUtils .toString(x)
164
164
case None if context.isVoidReturn => " void"
165
165
case None => " null"
166
166
}
167
- val line = (started :: elapse :: thread :: thisObject :: method :: arguments :: resultOrExcption :: Nil )
167
+
168
+ val argumentsAndResult = " Arguments: " + arguments + ObjUtils .parameterSeparator + " Result: " + resultOrExcption
169
+
170
+ val line = (started :: elapse :: thread :: thisObject :: method :: argumentsAndResult :: Nil )
168
171
.mkString(" " )
169
172
writer.write(line)
170
173
writer.newLine()
Original file line number Diff line number Diff line change @@ -7,16 +7,20 @@ import com.cedarsoftware.util.io.JsonWriter
7
7
*/
8
8
object ObjUtils {
9
9
val jsonFormater = (ref : AnyRef ) => JsonWriter .objectToJson(ref)
10
+
10
11
val toStringFormater = (ref : AnyRef ) => Option (ref).getOrElse(" null" ).toString
11
12
12
13
var formatter = toStringFormater
14
+ var parameterSeparator : String = " "
13
15
14
16
def useJsonFormat () = {
15
17
formatter = jsonFormater
18
+ parameterSeparator = " \n "
16
19
}
17
20
18
21
def useToStringFormat () = {
19
22
formatter = toStringFormater
23
+ parameterSeparator = " "
20
24
}
21
25
22
26
def toString (obj : AnyRef ) = {
You can’t perform that action at this time.
0 commit comments