GithubHelp home page GithubHelp logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.