aboutsummaryrefslogtreecommitdiff
path: root/common/src/main/java/at
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2015-07-17 11:41:14 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2015-07-17 11:41:14 +0200
commit59dee0f36a25d0c5f19d5d5d5652c3d919956cde (patch)
tree3c2927f5a4a2511b7c403dd592f64fab079f4919 /common/src/main/java/at
parent2a5dc4175eeb29331b1af83b0e03fa965d447533 (diff)
parentb92da70a3071e1dbf910ee38ff4efbe61ecc8be6 (diff)
downloadmoa-id-spss-59dee0f36a25d0c5f19d5d5d5652c3d919956cde.tar.gz
moa-id-spss-59dee0f36a25d0c5f19d5d5d5652c3d919956cde.tar.bz2
moa-id-spss-59dee0f36a25d0c5f19d5d5d5652c3d919956cde.zip
Merge first STORK 2 changes
Conflicts: id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java pom.xml
Diffstat (limited to 'common/src/main/java/at')
-rw-r--r--common/src/main/java/at/gv/egovernment/moa/logging/Logger.java31
1 files changed, 22 insertions, 9 deletions
diff --git a/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java b/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java
index 265ad026d..7cb2e7daf 100644
--- a/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java
+++ b/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java
@@ -79,6 +79,19 @@ public class Logger {
}
/**
+ * Prepare the message for printing it as string.
+ * <p>Mainly introduce because the <code>message</code> might be <code>null</code>.
+ *
+ * @param message the message
+ * @return the string
+ */
+ private static String prepareMessage(Object message) {
+ if(null == message)
+ return "no message given";
+ return message.toString();
+ }
+
+ /**
* Test, if the trace log level is enabled.
*
* @return boolean <code>true</code>, if tracing output is enabled
@@ -108,7 +121,7 @@ public class Logger {
*/
public static void trace(Object message) {
org.slf4j.Logger logger = getLogger();
- logger.trace(message.toString());
+ logger.trace(prepareMessage(message));
}
/**
@@ -141,17 +154,17 @@ public class Logger {
*/
public static void debug(Object message) {
org.slf4j.Logger logger = getLogger();
- logger.debug(message.toString());
+ logger.debug(prepareMessage(message));
}
-
- /**
+
+/**
* Log an info message.
*
* @param message The message to log.
*/
public static void info(Object message) {
org.slf4j.Logger logger = getLogger();
- logger.info(message.toString());
+ logger.info(prepareMessage(message));
}
/**
@@ -161,7 +174,7 @@ public class Logger {
*/
public static void warn(Object message) {
org.slf4j.Logger logger = getLogger();
- logger.warn(message.toString());
+ logger.warn(prepareMessage(message));
}
/**
@@ -172,7 +185,7 @@ public class Logger {
*/
public static void warn(Object message, Throwable t) {
org.slf4j.Logger logger = getLogger();
- logger.warn(message.toString(), t);
+ logger.warn(prepareMessage(message), t);
}
/**
@@ -182,7 +195,7 @@ public class Logger {
*/
public static void error(Object message) {
org.slf4j.Logger logger = getLogger();
- logger.error(message.toString());
+ logger.error(prepareMessage(message));
}
/**
@@ -193,7 +206,7 @@ public class Logger {
*/
public static void error(Object message, Throwable t) {
org.slf4j.Logger logger = getLogger();
- logger.error(message.toString(), t);
+ logger.error(prepareMessage(message), t);
}
/**