123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /*
- * Sonar Runner - API
- * Copyright (C) 2011 SonarSource
- * dev@sonar.codehaus.org
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
- package org.sonar.runner;
-
- final class Logs {
- private Logs() {
- }
-
- private static boolean debugEnabled = false;
-
- public static void setDebugEnabled(boolean debugEnabled) {
- Logs.debugEnabled = debugEnabled;
- }
-
- public static boolean isDebugEnabled() {
- return debugEnabled;
- }
-
- static void debug(String message) {
- if (isDebugEnabled()) {
- System.out.println("DEBUG: " + message);
- }
- }
-
- static void info(String message) {
- System.out.println("INFO: " + message);
- }
-
- static void warn(String message) {
- System.out.println("WARN: " + message);
- }
-
- static void error(String message) {
- System.err.println("ERROR: " + message);
- }
-
- static void error(String message, Throwable t) {
- System.err.println("ERROR: " + message);
- if (t != null) {
- t.printStackTrace(System.err);
- }
- }
- }
|