Last change
on this file since 77 was
77,
checked in by psniegowski, 11 years ago
|
Add new java codebase.
|
File size:
609 bytes
|
Line | |
---|
1 | package com.framsticks.communication.util; |
---|
2 | |
---|
3 | import com.framsticks.communication.StateCallback; |
---|
4 | import org.apache.log4j.Logger; |
---|
5 | import org.apache.log4j.Priority; |
---|
6 | |
---|
7 | /** |
---|
8 | * @author Piotr Sniegowski |
---|
9 | */ |
---|
10 | public class LoggingStateCallback extends StateCallback { |
---|
11 | |
---|
12 | protected final Logger logger; |
---|
13 | protected final String message; |
---|
14 | |
---|
15 | public LoggingStateCallback(Logger logger, String message) { |
---|
16 | this.logger = logger; |
---|
17 | this.message = message; |
---|
18 | } |
---|
19 | |
---|
20 | @Override |
---|
21 | public void call(Exception e) { |
---|
22 | if (e != null) { |
---|
23 | logger.error("failed to " + message + " with " + e); |
---|
24 | return; |
---|
25 | } |
---|
26 | logger.debug(message); |
---|
27 | } |
---|
28 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.