2 * Copyright (C) 2011 Openismus GmbH
4 * This file is part of GWT-Glom.
6 * GWT-Glom is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
11 * GWT-Glom is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with GWT-Glom. If not, see <http://www.gnu.org/licenses/>.
20 package org.glom.web.server;
23 * A class that wraps methods in com.allen_sauer.gwt.log.client.Log to add the calling method name from the servlet to
29 public static void fatal(String message, Throwable e) {
30 com.allen_sauer.gwt.log.client.Log.fatal(getServletMethodName() + message, e);
33 public static void fatal(String message) {
34 com.allen_sauer.gwt.log.client.Log.fatal(getServletMethodName() + message);
37 public static void fatal(String documentID, String tableName, String message, Throwable e) {
38 com.allen_sauer.gwt.log.client.Log.fatal(getServletMethodName() + documentID + " - " + tableName + ": "
42 public static void fatal(String documentID, String tableName, String message) {
43 com.allen_sauer.gwt.log.client.Log.fatal(getServletMethodName() + documentID + " - " + tableName + ": "
47 public static void fatal(String documentID, String message, Throwable e) {
48 com.allen_sauer.gwt.log.client.Log.fatal(getServletMethodName() + documentID + ": " + message, e);
51 public static void fatal(String documentID, String message) {
52 com.allen_sauer.gwt.log.client.Log.fatal(getServletMethodName() + documentID + ": " + message);
56 public static void error(String message, Throwable e) {
57 com.allen_sauer.gwt.log.client.Log.error(getServletMethodName() + message, e);
60 public static void error(String message) {
61 com.allen_sauer.gwt.log.client.Log.error(getServletMethodName() + message);
64 public static void error(String documentID, String tableName, String message, Throwable e) {
65 com.allen_sauer.gwt.log.client.Log.error(getServletMethodName() + documentID + " - " + tableName + ": "
69 public static void error(String documentID, String tableName, String message) {
70 com.allen_sauer.gwt.log.client.Log.error(getServletMethodName() + documentID + " - " + tableName + ": "
74 public static void error(String documentID, String message, Throwable e) {
75 com.allen_sauer.gwt.log.client.Log.error(getServletMethodName() + documentID + ": " + message, e);
78 public static void error(String documentID, String message) {
79 com.allen_sauer.gwt.log.client.Log.error(getServletMethodName() + documentID + ": " + message);
83 public static void warn(String message, Throwable e) {
84 com.allen_sauer.gwt.log.client.Log.fatal(getServletMethodName() + message, e);
87 public static void warn(String message) {
88 com.allen_sauer.gwt.log.client.Log.warn(getServletMethodName() + message);
91 public static void warn(String documentID, String tableName, String message, Throwable e) {
92 com.allen_sauer.gwt.log.client.Log.warn(getServletMethodName() + documentID + " - " + tableName + ": "
96 public static void warn(String documentID, String tableName, String message) {
97 com.allen_sauer.gwt.log.client.Log.warn(getServletMethodName() + documentID + " - " + tableName + ": "
101 public static void warn(String documentID, String message, Throwable e) {
102 com.allen_sauer.gwt.log.client.Log.warn(getServletMethodName() + documentID + ": " + message, e);
105 public static void warn(String documentID, String message) {
106 com.allen_sauer.gwt.log.client.Log.warn(getServletMethodName() + documentID + ": " + message);
110 public static void info(String message, Throwable e) {
111 com.allen_sauer.gwt.log.client.Log.info(getServletMethodName() + message, e);
114 public static void info(String message) {
115 com.allen_sauer.gwt.log.client.Log.info(getServletMethodName() + message);
118 public static void info(String documentID, String tableName, String message, Throwable e) {
119 com.allen_sauer.gwt.log.client.Log.info(getServletMethodName() + documentID + " - " + tableName + ": "
123 public static void info(String documentID, String tableName, String message) {
124 com.allen_sauer.gwt.log.client.Log.info(getServletMethodName() + documentID + " - " + tableName + ": "
128 public static void info(String documentID, String message, Throwable e) {
129 com.allen_sauer.gwt.log.client.Log.info(getServletMethodName() + documentID + ": " + message, e);
132 public static void info(String documentID, String message) {
133 com.allen_sauer.gwt.log.client.Log.info(getServletMethodName() + documentID + ": " + message);
137 private static String getServletMethodName() {
138 StackTraceElement[] stackTraces = Thread.currentThread().getStackTrace();
139 if (stackTraces.length > 3 && "org.glom.web.server.OnlineGlomServiceImpl".equals(stackTraces[3].getClassName()))
140 return stackTraces[3].getMethodName() + " - ";