Changeset 633 for trunk/java-utils/src/main/java/de/ugoe
- Timestamp:
- 08/27/12 15:17:00 (12 years ago)
- Location:
- trunk/java-utils/src/main/java/de/ugoe/cs/util/console
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/java-utils/src/main/java/de/ugoe/cs/util/console/Console.java
r250 r633 3 3 import java.util.Collection; 4 4 import java.util.LinkedHashSet; 5 import java.util.logging.Level; 5 6 6 7 import de.ugoe.cs.util.StringTools; … … 413 414 * <p> 414 415 * Sends a debug message to all observers containing the message that was 415 * passed to this function. 416 * passed to this function. The default log {@link Level} is {@link Level#INFO}. 416 417 * </p> 417 418 * … … 419 420 * message that is send to the observers 420 421 */ 422 @Deprecated 421 423 public static void trace(String traceMsg) { 422 424 for (ITraceListener observer : theInstance.traceListener) { 423 observer.traceMsg(traceMsg); 424 } 425 observer.traceMsg(traceMsg, Level.INFO); 426 } 427 } 428 429 /** 430 * 431 * <p> 432 * Sends a debug message to all trace listeners containing the message that was passed to this function. 433 * </p> 434 * 435 * @param traceMsg message that is send to the trace listener 436 * @param logLevel log level of the message 437 */ 438 public static void trace(String traceMsg, Level logLevel) { 439 for( ITraceListener observer : theInstance.traceListener) { 440 observer.traceMsg(traceMsg, logLevel); 441 } 425 442 } 426 443 … … 429 446 * Sends a debug message to all observers containing the message that was 430 447 * passed to this function and adds an {@link StringTools#ENDLINE} to the 431 * message. 448 * message. The default log {@link Level} is {@link Level#INFO}. 432 449 * </p> 433 450 * … … 435 452 * message that is send to the observers 436 453 */ 454 @Deprecated 437 455 public static void traceln(String traceMsg) { 438 456 for (ITraceListener observer : theInstance.traceListener) { 439 observer.traceMsg(traceMsg + StringTools.ENDLINE); 440 } 457 observer.traceMsg(traceMsg + StringTools.ENDLINE, Level.INFO); 458 } 459 } 460 461 /** 462 * <p> 463 * Sends a debug message to all observers containing the message that was 464 * passed to this function and adds an {@link StringTools#ENDLINE} to the 465 * message. 466 * </p> 467 * 468 * @param traceMsg message that is send to the observers 469 * @param logLevel log levle of the message 470 */ 471 public static void traceln(String traceMsg, Level logLevel) { 472 for( ITraceListener observer : theInstance.traceListener) { 473 observer.traceMsg(traceMsg + StringTools.ENDLINE, logLevel); 474 } 441 475 } 442 476 -
trunk/java-utils/src/main/java/de/ugoe/cs/util/console/TextConsole.java
r312 r633 3 3 import java.io.IOException; 4 4 import java.nio.charset.Charset; 5 import java.util.logging.Level; 5 6 6 7 import de.ugoe.cs.util.console.listener.IErrorListener; … … 82 83 */ 83 84 @Override 84 public void traceMsg(String traceMessage ) {85 public void traceMsg(String traceMessage, Level level) { 85 86 if (debugMode) { 86 System.out.print( traceMessage);87 System.out.print("[" + level.toString() + "] " + traceMessage); 87 88 } 88 89 } -
trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/ITraceListener.java
r223 r633 1 1 package de.ugoe.cs.util.console.listener; 2 3 import java.util.logging.Level; 2 4 3 5 import de.ugoe.cs.util.console.Console; … … 18 20 * 19 21 * @param traceMessage 20 * error message 22 * trace message 23 * @param level 24 * trace level 21 25 */ 22 public void traceMsg(String traceMessage );26 public void traceMsg(String traceMessage, Level level); 23 27 }
Note: See TracChangeset
for help on using the changeset viewer.