Skip to content

Commit b950203

Browse files
author
mgeipel
committed
fixed #36
ObjectExceptionLogger depricated
1 parent 8819cc3 commit b950203

File tree

2 files changed

+62
-61
lines changed

2 files changed

+62
-61
lines changed

src/main/java/org/culturegraph/mf/stream/pipe/ObjectExceptionLogger.java

Lines changed: 61 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -13,63 +13,64 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.culturegraph.mf.stream.pipe;
17-
18-
import org.culturegraph.mf.framework.DefaultObjectPipe;
19-
import org.culturegraph.mf.framework.ObjectReceiver;
20-
import org.culturegraph.mf.framework.annotations.Description;
21-
import org.culturegraph.mf.framework.annotations.In;
22-
import org.culturegraph.mf.framework.annotations.Out;
23-
import org.slf4j.Logger;
24-
import org.slf4j.LoggerFactory;
25-
26-
27-
/**
28-
* Logs the string representation of every object.
29-
*
30-
* @param <T> object type
31-
*
32-
* @author Christoph Böhme
33-
*
34-
*/
35-
@Description("logs objects with the toString method")
36-
@In(Object.class)
37-
@Out(Object.class)
38-
public final class ObjectExceptionLogger<T>
39-
extends DefaultObjectPipe<T, ObjectReceiver<T>> {
40-
41-
private static final Logger LOG = LoggerFactory.getLogger(ObjectExceptionLogger.class);
42-
43-
private final String logPrefix;
44-
45-
public ObjectExceptionLogger() {
46-
this("");
47-
}
48-
49-
public ObjectExceptionLogger(final String logPrefix) {
50-
super();
51-
this.logPrefix = logPrefix;
52-
}
53-
54-
@Override
55-
public void process(final T obj) {
56-
57-
try{
58-
getReceiver().process(obj);
59-
}catch(Exception e){
60-
LOG.error(logPrefix, e);
61-
}
62-
63-
}
64-
65-
@Override
66-
protected void onResetStream() {
67-
LOG.debug("{}resetStream", logPrefix);
68-
}
69-
70-
@Override
71-
protected void onCloseStream() {
72-
LOG.debug("{}closeStream", logPrefix);
73-
}
74-
75-
}
16+
package org.culturegraph.mf.stream.pipe;
17+
18+
import org.culturegraph.mf.framework.DefaultObjectPipe;
19+
import org.culturegraph.mf.framework.ObjectReceiver;
20+
import org.culturegraph.mf.framework.annotations.Description;
21+
import org.culturegraph.mf.framework.annotations.In;
22+
import org.culturegraph.mf.framework.annotations.Out;
23+
import org.slf4j.Logger;
24+
import org.slf4j.LoggerFactory;
25+
26+
27+
/**
28+
* Logs the string representation of every object.
29+
*
30+
* @param <T> object type
31+
* @deprecated use {@link ObjectExceptionLogger} instead.
32+
* @author Christoph Böhme
33+
*
34+
*/
35+
@Description("logs objects with the toString method")
36+
@In(Object.class)
37+
@Out(Object.class)
38+
@Deprecated
39+
public final class ObjectExceptionLogger<T>
40+
extends DefaultObjectPipe<T, ObjectReceiver<T>> {
41+
42+
private static final Logger LOG = LoggerFactory.getLogger(ObjectExceptionLogger.class);
43+
44+
private final String logPrefix;
45+
46+
public ObjectExceptionLogger() {
47+
this("");
48+
}
49+
50+
public ObjectExceptionLogger(final String logPrefix) {
51+
super();
52+
this.logPrefix = logPrefix;
53+
}
54+
55+
@Override
56+
public void process(final T obj) {
57+
58+
try{
59+
getReceiver().process(obj);
60+
}catch(Exception e){
61+
LOG.error(logPrefix, e);
62+
}
63+
64+
}
65+
66+
@Override
67+
protected void onResetStream() {
68+
LOG.debug("{}resetStream", logPrefix);
69+
}
70+
71+
@Override
72+
protected void onCloseStream() {
73+
LOG.debug("{}closeStream", logPrefix);
74+
}
75+
76+
}

src/main/resources/flux-commands.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ write org.culturegraph.mf.stream.sink.ObjectWriter
4545
log-stream org.culturegraph.mf.stream.pipe.StreamLogger
4646
log-object org.culturegraph.mf.stream.pipe.ObjectLogger
4747
log-time org.culturegraph.mf.stream.pipe.ObjectTimer
48-
catch-exceptions org.culturegraph.mf.stream.pipe.ObjectExceptionCatcher
48+
#catch-exceptions org.culturegraph.mf.stream.pipe.ObjectExceptionCatcher (dublicate entry)
4949
decouple org.culturegraph.mf.stream.pipe.ObjectPipeDecoupler
5050

5151
change-id org.culturegraph.mf.stream.pipe.IdChangePipe

0 commit comments

Comments
 (0)