0N/A/*
6321N/A * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage com.sun.media.sound;
0N/A
0N/A/**
0N/A * Printer allows you to set up global debugging status and print
0N/A * messages accordingly.
0N/A *
0N/A * @author David Rivas
0N/A * @author Kara Kytle
0N/A */
6321N/Afinal class Printer {
0N/A
0N/A static final boolean err = false;
0N/A static final boolean debug = false;
0N/A static final boolean trace = false;
0N/A static final boolean verbose = false;
0N/A static final boolean release = false;
0N/A
0N/A static final boolean SHOW_THREADID = false;
0N/A static final boolean SHOW_TIMESTAMP = false;
0N/A
0N/A /*static void setErrorPrint(boolean on) {
0N/A
0N/A err = on;
0N/A }
0N/A
0N/A static void setDebugPrint(boolean on) {
0N/A
0N/A debug = on;
0N/A }
0N/A
0N/A static void setTracePrint(boolean on) {
0N/A
0N/A trace = on;
0N/A }
0N/A
0N/A static void setVerbosePrint(boolean on) {
0N/A
0N/A verbose = on;
0N/A }
0N/A
0N/A static void setReleasePrint(boolean on) {
0N/A
0N/A release = on;
0N/A }*/
0N/A
6321N/A /**
6321N/A * Suppresses default constructor, ensuring non-instantiability.
6321N/A */
6321N/A private Printer() {
6321N/A }
6321N/A
0N/A public static void err(String str) {
0N/A
0N/A if (err)
0N/A println(str);
0N/A }
0N/A
0N/A public static void debug(String str) {
0N/A
0N/A if (debug)
0N/A println(str);
0N/A }
0N/A
0N/A public static void trace(String str) {
0N/A
0N/A if (trace)
0N/A println(str);
0N/A }
0N/A
0N/A public static void verbose(String str) {
0N/A
0N/A if (verbose)
0N/A println(str);
0N/A }
0N/A
0N/A public static void release(String str) {
0N/A
0N/A if (release)
0N/A println(str);
0N/A }
0N/A
0N/A private static long startTime = 0;
0N/A
0N/A public static void println(String s) {
0N/A String prepend = "";
0N/A if (SHOW_THREADID) {
0N/A prepend = "thread " + Thread.currentThread().getId() + " " + prepend;
0N/A }
0N/A if (SHOW_TIMESTAMP) {
0N/A if (startTime == 0) {
0N/A startTime = System.nanoTime() / 1000000l;
0N/A }
0N/A prepend = prepend + ((System.nanoTime()/1000000l) - startTime) + "millis: ";
0N/A }
0N/A System.out.println(prepend + s);
0N/A }
0N/A
0N/A public static void println() {
0N/A System.out.println();
0N/A }
0N/A
0N/A}