1
|
1 /* Utils -- general utility classes for scaler servlet
|
|
2
|
|
3 Digital Image Library servlet components
|
|
4
|
|
5 Copyright (C) 2001, 2002 Robert Casties (robcast@mail.berlios.de)
|
|
6
|
|
7 This program is free software; you can redistribute it and/or modify it
|
|
8 under the terms of the GNU General Public License as published by the
|
|
9 Free Software Foundation; either version 2 of the License, or (at your
|
|
10 option) any later version.
|
|
11
|
|
12 Please read license.txt for the full details. A copy of the GPL
|
|
13 may be found at http://www.gnu.org/copyleft/lgpl.html
|
|
14
|
|
15 You should have received a copy of the GNU General Public License
|
|
16 along with this program; if not, write to the Free Software
|
|
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
18
|
|
19 */
|
|
20
|
|
21 package digilib;
|
|
22
|
|
23 public class Utils {
|
|
24
|
|
25 public Utils() {
|
|
26 }
|
|
27
|
|
28 public Utils(int dbg) {
|
|
29 debugLevel = dbg;
|
|
30 }
|
|
31
|
|
32 /**
|
|
33 * Debugging help
|
|
34 * dprintln(1, "blabla");
|
|
35 * will be printed on stdout if debug >= 1
|
|
36 */
|
|
37 public static int debugLevel = 10;
|
|
38 public static void dprintln(int dbg, String s) {
|
|
39 if (debugLevel >= dbg) {
|
|
40 String ind = "";
|
|
41 // indent by debuglevel
|
|
42 for (int i = 0; i < dbg; i++) {
|
|
43 ind += " ";
|
|
44 }
|
|
45 System.out.println(ind+s);
|
|
46 }
|
|
47 }
|
|
48 }
|