Comments (2)
Here is simple code to make things work with slf4j
com.btr.proxy.util.Logger.setBackend( new com.btr.proxy.util.Logger.LogBackEnd() {
@Override
public boolean isLogginEnabled(LogLevel level) {
switch( level ) {
case INFO: return log.isInfoEnabled();
case DEBUG: return log.isDebugEnabled();
case ERROR: return log.isErrorEnabled();
case TRACE: return log.isTraceEnabled();
case WARNING: return log.isWarnEnabled();
}
return false;
}
@Override
public void log(Class<?> clazz, LogLevel level, String msg, Object ... params ) {
msg = msg.replace( "{0}", "{}" ).replace( "{1}", "{}" );
switch( level ) {
case INFO: log.info( msg, params ); break;
case DEBUG: log.debug( msg, params ); break;
case ERROR: log.error( msg, params ); break;
case TRACE: log.trace( msg, params ); break;
case WARNING: log.warn( msg, params ); break;
}
}
});
Original comment by [email protected]
on 19 Jul 2010 at 9:39
from proxy-vole.
Hello ryantxu
I'm aware of slf4j and use it internally for all my projects. But I made the
decision to have only minimum external dependencies to make it straight forward
to add proxy-vole to any project. Yes many projects are using slf4j but also
many use log4j or java logging and they would have to include another logging
api (slf4j) and then use an adapter.
My intention is that if someone really needs logging in proxy-vole then he can
write a simple adapter for his preferred logging API with only a view lines of
code as you can see in your example.
Thank you a lot for your input and for your example code. I think other people
can use that as starting point if they have a similar need but I will not
include it into the offical release to make sure that proxy-vole stays light
weight.
Have fun,
- Rossi
Original comment by [email protected]
on 21 Jul 2010 at 7:24
- Changed state: WontFix
- Added labels: Type-Enhancement
- Removed labels: Type-Defect
from proxy-vole.
Related Issues (20)
- OSX: proxy-vole ignores PAC proxy settings HOT 8
- Return of myIpAddress will treated by JavaxPacScriptParser as an object with following side effects. HOT 1
- proxy-vole is selecting bluetooth interface in OS/X 10.8 HOT 5
- The proxy selector is taking long time after updating windows ( in windows7 ) HOT 2
- Invalid java.io.tmpdir will cause NullPointerException in static initializer which leads to ExceptionInInitializerError HOT 1
- NullPointerException when PAC file not available HOT 3
- Improper logic to reload PAC file HOT 2
- ProxyListFallbackSelector returns a proxy rather than DIRECT when asked the proxy for the proxy.
- Local bypass in IE is ignored if additional whitelist-entries are defined HOT 1
- UnsatisfiedLinkError HOT 1
- DefaultWhiteListParser cannot handle www.*.com
- ProxySearch using default is giving erroneous proxy HOT 1
- Improvement in proxy fallback selection
- shExpMatch for IP address HOT 3
- Apache Httpclient 4 - not reading proxy settings from proxy-vole HOT 2
- Cannot detect Linux EVN_VAR IPv6 proxy
- JavaProxySearchStrategy only enabled with HTTP system properties given HOT 1
- Security-Exception with PAC script in Java 8
- SOCKS implementation is wrong
- NPE in IEProxySearchStrategy.getProxySelector()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxy-vole.