view servlet/src/digilib/Utils.java @ 53:1e80635e3f8c

13.8.2002 - [different files] : roc - changed all hardcoded occurrences of /docuserver/digitallibrary to work relative or take the path from the request URL. Introduced a variable baseURL to hold the URL path (up to digilib.jsp etc.). Now it should be possible to install digilib in other directories. - removed xerces.jar. It seems not necessary any more (JDK 1.3.1, Tomcat 4.0.4)
author robcast
date Thu, 15 Aug 2002 23:40:15 +0200
parents 0ff3ede32060
children 8d9a0abf3626
line wrap: on
line source

/*  Utils -- general utility classes for scaler servlet

  Digital Image Library servlet components

  Copyright (C) 2001, 2002 Robert Casties (robcast@mail.berlios.de)

  This program is free software; you can redistribute  it and/or modify it
  under  the terms of  the GNU General  Public License as published by the
  Free Software Foundation;  either version 2 of the  License, or (at your
  option) any later version.
   
  Please read license.txt for the full details. A copy of the GPL
  may be found at http://www.gnu.org/copyleft/lgpl.html

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/

package digilib;

public class Utils {

  public Utils() {
  }

  public Utils(int dbg) {
    debugLevel = dbg;
  }

  /**
   *  Debugging help
   *    dprintln(1, "blabla");
   *    will be printed on stdout if debug >= 1
   */
  public static int debugLevel = 10;
  public static void dprintln(int dbg, String s) {
    if (debugLevel >= dbg) {
      String ind = "";
      // indent by debuglevel
      for (int i = 0; i < dbg; i++) {
        ind += "  ";
      }
      System.out.println(ind+s);
    }
  }
}