1
2
3
4
5
6
7
8
9
10 package ch.qos.logback.core.status;
11
12 import ch.qos.logback.core.Context;
13
14 public class StatusUtil {
15
16 static public void addStatus(Context context, Status status) {
17 if (context == null) {
18 return;
19 }
20 StatusManager sm = context.getStatusManager();
21 if (sm != null) {
22 sm.add(status);
23 }
24 }
25
26 static public void addInfo(Context context, Object caller, String msg) {
27 addStatus(context, new InfoStatus(msg, caller));
28 }
29
30 static public void addWarn(Context context, Object caller, String msg) {
31 addStatus(context, new WarnStatus(msg, caller));
32 }
33
34 static public void addError(Context context, Object caller, String msg,
35 Throwable t) {
36 addStatus(context, new ErrorStatus(msg, caller, t));
37 }
38 }