Main Page | Packages | Class List | File List | Class Members

Utils.java

Go to the documentation of this file.
00001 /*************************************************************************
00002  *                                                                       *
00003  * Voce                                                                  *
00004  * Copyright (C) 2005                                                    *
00005  * Tyler Streeter  tylerstreeter@gmail.com                               *
00006  * All rights reserved.                                                  *
00007  * Web: voce.sourceforge.net                                             *
00008  *                                                                       *
00009  * This library is free software; you can redistribute it and/or         *
00010  * modify it under the terms of EITHER:                                  *
00011  *   (1) The GNU Lesser General Public License as published by the Free  *
00012  *       Software Foundation; either version 2.1 of the License, or (at  *
00013  *       your option) any later version. The text of the GNU Lesser      *
00014  *       General Public License is included with this library in the     *
00015  *       file license-LGPL.txt.                                          *
00016  *   (2) The BSD-style license that is included with this library in     *
00017  *       the file license-BSD.txt.                                       *
00018  *                                                                       *
00019  * This library is distributed in the hope that it will be useful,       *
00020  * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files    *
00022  * license-LGPL.txt and license-BSD.txt for more details.                *
00023  *                                                                       *
00024  *************************************************************************/
00025 
00026 package voce;
00027 
00030 public class Utils
00031 {
00032         private static boolean mPrintDebug = false;
00033 
00036         static public void log(String msgType, String msg)
00037         {
00038                 // If we're ignoring debug messages and this one is a debug 
00039                 // message, return.
00040                 if (!mPrintDebug && msgType.equals("debug"))
00041                 {
00042                         return;
00043                 }
00044 
00045                 String finalMessage = "[Voce";
00046 
00047                 if (!msgType.equals(""))
00048                 {
00049                         finalMessage = finalMessage + " " + msgType;
00050                 }
00051 
00052                 finalMessage = finalMessage + "] " + msg;
00053                 System.out.println(finalMessage);
00054                 System.out.flush();
00055         }
00056         
00059         static public void setPrintDebug(boolean printDebug)
00060         {
00061                 mPrintDebug = printDebug;
00062         }
00063 }

Generated on Wed Aug 3 16:25:01 2005 for Voce Java API by  doxygen 1.4.1