@@ -95,52 +95,52 @@ public static Config getConfig() {
9595 return CONFIG ;
9696 }
9797
98- public static void v (final Object content ) {
99- log (V , sGlobalTag , content );
98+ public static void v (final Object ... contents ) {
99+ log (V , sGlobalTag , contents );
100100 }
101101
102- public static void v (final String tag , final Object content , final Object ... contents ) {
103- log (V , tag , content , contents );
102+ public static void vTag (final String tag , final Object ... contents ) {
103+ log (V , tag , contents );
104104 }
105105
106- public static void d (final Object content ) {
107- log (D , sGlobalTag , content );
106+ public static void d (final Object ... contents ) {
107+ log (D , sGlobalTag , contents );
108108 }
109109
110- public static void d (final String tag , final Object content , final Object ... contents ) {
111- log (D , tag , content , contents );
110+ public static void dTag (final String tag , final Object ... contents ) {
111+ log (D , tag , contents );
112112 }
113113
114- public static void i (final Object content ) {
115- log (I , sGlobalTag , content );
114+ public static void i (final Object ... contents ) {
115+ log (I , sGlobalTag , contents );
116116 }
117117
118- public static void i (final String tag , final Object content , final Object ... contents ) {
119- log (I , tag , content , contents );
118+ public static void iTag (final String tag , final Object ... contents ) {
119+ log (I , tag , contents );
120120 }
121121
122- public static void w (final Object content ) {
123- log (W , sGlobalTag , content );
122+ public static void w (final Object ... contents ) {
123+ log (W , sGlobalTag , contents );
124124 }
125125
126- public static void w (final String tag , final Object content , final Object ... contents ) {
127- log (W , tag , content , contents );
126+ public static void wTag (final String tag , final Object ... contents ) {
127+ log (W , tag , contents );
128128 }
129129
130- public static void e (final Object content ) {
131- log (E , sGlobalTag , content );
130+ public static void e (final Object ... contents ) {
131+ log (E , sGlobalTag , contents );
132132 }
133133
134- public static void e (final String tag , final Object content , final Object ... contents ) {
135- log (E , tag , content , contents );
134+ public static void eTag (final String tag , final Object ... contents ) {
135+ log (E , tag , contents );
136136 }
137137
138- public static void a (final Object content ) {
139- log (A , sGlobalTag , content );
138+ public static void a (final Object ... contents ) {
139+ log (A , sGlobalTag , contents );
140140 }
141141
142- public static void a (final String tag , final Object content , final Object ... contents ) {
143- log (A , tag , content , contents );
142+ public static void aTag (final String tag , final Object ... contents ) {
143+ log (A , tag , contents );
144144 }
145145
146146 public static void file (final Object content ) {
@@ -264,26 +264,30 @@ private static TagHead processTagAndHead(String tag) {
264264 }
265265
266266 private static String processBody (final int type , final Object ... contents ) {
267- String body ;
268- if (contents .length == 1 ) {
269- body = contents [0 ] == null ? NULL : contents [0 ].toString ();
270- if (type == JSON ) {
271- body = formatJson (body );
272- } else if (type == XML ) {
273- body = formatXml (body );
274- }
275- } else {
276- StringBuilder sb = new StringBuilder ();
277- int i = 0 ;
278- sb .append (generateArgLine (i ++, contents [0 ] == null ? NULL : contents [0 ].toString ()));
279- if (contents [1 ] == null ) {
280- sb .append (generateArgLine (i , NULL ));
267+ String body = NULL ;
268+ if (contents != null ) {
269+ if (contents .length == 1 ) {
270+ Object object = contents [0 ];
271+ if (object != null ) body = object .toString ();
272+ if (type == JSON ) {
273+ body = formatJson (body );
274+ } else if (type == XML ) {
275+ body = formatXml (body );
276+ }
281277 } else {
282- for (Object content : (Object []) contents [1 ]) {
283- sb .append (generateArgLine (i ++, content == null ? NULL : content .toString ()));
278+ StringBuilder sb = new StringBuilder ();
279+ for (int i = 0 , len = contents .length ; i < len ; ++i ) {
280+ Object content = contents [i ];
281+ sb .append (ARGS )
282+ .append ("[" )
283+ .append (i )
284+ .append ("]" )
285+ .append (" = " )
286+ .append (content == null ? NULL : content .toString ())
287+ .append (LINE_SEP );
284288 }
289+ body = sb .toString ();
285290 }
286- body = sb .toString ();
287291 }
288292 return body ;
289293 }
@@ -316,10 +320,6 @@ private static String formatXml(String xml) {
316320 return xml ;
317321 }
318322
319- private static String generateArgLine (int index , String content ) {
320- return ARGS + "[" + index + "]" + " = " + content + LINE_SEP ;
321- }
322-
323323 private static void print2Console (final int type , final String tag , final String [] head , final String msg ) {
324324 printBorder (type , tag , true );
325325 printHead (type , tag , head );
0 commit comments