5353 * printed to stdout.
5454 */
5555public class Tracer implements Runnable {
56- private static boolean property (String property ){
56+ private static boolean property (String property ) {
5757 return Boolean .parseBoolean (System .getProperty (
5858 "com.rabbitmq.tools.Tracer." + property ));
5959 }
@@ -76,16 +76,16 @@ private static boolean property(String property){
7676 final static int MAX_TIME_BETWEEN_FLUSHES = 1000 ;
7777 final static Object FLUSH = new Object ();
7878
79- private static class AsyncLogger extends Thread {
79+ private static class AsyncLogger extends Thread {
8080 final PrintStream ps ;
8181 final BlockingQueue <Object > queue = new ArrayBlockingQueue <Object >(LOG_QUEUE_SIZE , true );
82- AsyncLogger (PrintStream ps ){
82+ AsyncLogger (PrintStream ps ) {
8383 this .ps = new PrintStream (new BufferedOutputStream (ps , BUFFER_SIZE ), false );
8484 start ();
8585
86- new Thread (){
87- @ Override public void run (){
88- while (true ){
86+ new Thread () {
87+ @ Override public void run () {
88+ while (true ) {
8989 try {
9090 Thread .sleep (MAX_TIME_BETWEEN_FLUSHES );
9191 queue .add (FLUSH );
@@ -96,25 +96,25 @@ private static class AsyncLogger extends Thread{
9696 }.start ();
9797 }
9898
99- void printMessage (String message ){
99+ void printMessage (String message ) {
100100 ps .println (message );
101101 }
102102
103- @ Override public void run (){
103+ @ Override public void run () {
104104 try {
105- while (true ){
105+ while (true ) {
106106 Object message = queue .take ();
107107 if (message == FLUSH ) ps .flush ();
108108 else printMessage ((String )message );
109109 }
110- } catch (InterruptedException interrupt ){
110+ } catch (InterruptedException interrupt ) {
111111 }
112112 }
113113
114- void log (String message ){
114+ void log (String message ) {
115115 try {
116116 queue .put (message );
117- } catch (InterruptedException ex ){
117+ } catch (InterruptedException ex ) {
118118 throw new RuntimeException (ex );
119119 }
120120 }
@@ -211,12 +211,12 @@ public void run() {
211211 }
212212 }
213213
214- public void log (String message ){
214+ public void log (String message ) {
215215 logger .log ("" + System .currentTimeMillis () + ": conn#"
216216 + id + " " + message );
217217 }
218218
219- public void logException (Exception e ){
219+ public void logException (Exception e ) {
220220 log ("uncaught " + Utility .makeStackTrace (e ));
221221 }
222222
@@ -277,7 +277,7 @@ public void doFrame() throws IOException {
277277
278278 if (f != null ) {
279279
280- if (SILENT_MODE ){
280+ if (SILENT_MODE ) {
281281 f .writeTo (o );
282282 return ;
283283 }
@@ -300,7 +300,7 @@ public void doFrame() throws IOException {
300300 }
301301 } else {
302302 AMQCommand .Assembler c = assemblers .get (f .channel );
303- if (c == null ){
303+ if (c == null ) {
304304 c = AMQCommand .newAssembler ();
305305 assemblers .put (f .channel , c );
306306 }
0 commit comments