tracesrv/tracecompiler/src/com.nokia.tracecompiler/src/com/nokia/tracecompiler/TraceCompilerLogger.java
changeset 56 aa2539c91954
parent 41 838cdffd57ce
equal deleted inserted replaced
54:a151135b0cf9 56:aa2539c91954
       
     1 /*
       
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:
       
    15  *
       
    16  * Simple Logger
       
    17  *
       
    18  */
       
    19 package com.nokia.tracecompiler;
       
    20 
       
    21 
       
    22 
       
    23 /**
       
    24  * Simple logger for errors warnings and infos
       
    25  *
       
    26  */
       
    27 public class TraceCompilerLogger {
       
    28 
       
    29 	/**
       
    30 	 * Prints errors message to STDERR.
       
    31 	 * 
       
    32 	 * @param msg
       
    33 	 *            the message
       
    34 	 */
       
    35 	static public void printError(String msg) {
       
    36 		if (msg != null) {
       
    37 			System.err.println(Messages.getString("TraceCompilerLogger.errorPrefix") + msg); //$NON-NLS-1$
       
    38 			System.err.flush();
       
    39 		}
       
    40 	}
       
    41 	
       
    42 	/**
       
    43 	 * Prints warning message to STDERR.
       
    44 	 * @param msg
       
    45 	 */
       
    46 	static public void printWarning(String msg) {
       
    47 			System.err.println(Messages.getString("TraceCompilerLogger.warningPrefix") + msg); //$NON-NLS-1$
       
    48 			System.err.flush();
       
    49 	}
       
    50 
       
    51 	/**
       
    52 	 * Prints warning message to STDOUT if verbose is on.
       
    53 	 * @param msg
       
    54 	 */
       
    55 	static public void printInfo(String msg) {
       
    56 		if (TraceCompilerGlobals.isVebose()) {
       
    57 			System.out.println(Messages.getString("TraceCompilerLogger.infoPrefix") + msg); //$NON-NLS-1$
       
    58 			System.out.flush();
       
    59 		}
       
    60 	}
       
    61 	
       
    62 	/**
       
    63 	 * Prints warning message to STDOUT.
       
    64 	 * @param msg
       
    65 	 */
       
    66 	static public void printMessage(String msg) {
       
    67 			System.out.println(msg);
       
    68 			System.out.flush();
       
    69 	}
       
    70 }