View Javadoc

1   package net.grinderscript.dotnet.scriptengine;
2   
3   import org.slf4j.Logger;
4   import org.slf4j.LoggerFactory;
5   
6   import system.Exception;
7   import system.Type;
8   import grinderscript.net.core.IGrinderLogger;
9   
10  public class DotNetLoggerBridge implements IGrinderLogger {
11  
12  	private final Logger logger = LoggerFactory
13  			.getLogger(DotNetLoggerBridge.class);
14  
15  	private final Logger underlying;
16  
17  	public DotNetLoggerBridge(Logger underlyingLogger) {
18  		logger.trace("ctor: Enter, underlyingLogger = {}", underlyingLogger);
19  		this.underlying = underlyingLogger;
20  		logger.trace("ctor: Exit");
21  	}
22  
23  	public DotNetLoggerBridge(String name) {
24  		this(LoggerFactory.getLogger(name));
25  	}
26  
27  	public DotNetLoggerBridge(Type nameType) {
28  		this(nameType.getFullName());
29  	}
30  
31  	@Override
32  	public void Debug(String msg) {
33  		underlying.debug(msg);
34  	}
35  
36  	@Override
37  	public void Debug(String msg, Exception ex) {
38  		underlying.debug(msg, ex);
39  	}
40  
41  	@Override
42  	public void Error(String msg) {
43  		underlying.error(msg);
44  	}
45  
46  	@Override
47  	public void Error(String msg, Exception ex) {
48  		underlying.error(msg, ex);
49  	}
50  
51  	@Override
52  	public void Info(String msg) {
53  		underlying.info(msg);
54  	}
55  
56  	@Override
57  	public void Info(String msg, Exception ex) {
58  		underlying.info(msg, ex);
59  	}
60  
61  	@Override
62  	public boolean isDebugEnabled() {
63  		return underlying.isDebugEnabled();
64  	}
65  
66  	@Override
67  	public boolean isErrorEnabled() {
68  		return underlying.isErrorEnabled();
69  	}
70  
71  	@Override
72  	public boolean isInfoEnabled() {
73  		return underlying.isInfoEnabled();
74  	}
75  
76  	@Override
77  	public boolean isTraceEnabled() {
78  		return underlying.isTraceEnabled();
79  	}
80  
81  	@Override
82  	public boolean isWarnEnabled() {
83  		return underlying.isWarnEnabled();
84  	}
85  
86  	@Override
87  	public void Trace(String msg) {
88  		underlying.trace(msg);
89  	}
90  
91  	@Override
92  	public void Trace(String msg, Exception ex) {
93  		underlying.trace(msg, ex);
94  	}
95  
96  	@Override
97  	public void Warn(String msg) {
98  		underlying.warn(msg);
99  	}
100 
101 	@Override
102 	public void Warn(String msg, Exception ex) {
103 		underlying.warn(msg, ex);
104 	}
105 
106 	Logger getUnderlying() {
107 		return underlying;
108 	}
109 }