Git Product home page Git Product logo

kevoree-log's Introduction

kevoree-log

Minimal and efficient logger library for the JVM

####This project aims at offering a very low overhead log library for intensive usage inside a JVM.

###Why performance of logging is so important ?

By definition a logging library aims at offering a way to track execution step of a software, for debuggin, or simply to track execution history. Logging library is intensively used in Java program without regarding the performance impact. Logging activity can take up to 20 or 30% percent of the total execution time of a Java program. This, because the IF statement to decide or not to print the message, cost by itself a method call or create a message String object which will be garbaged immeditely.

Martin Fowler in it's blog Fowler Blog already speaks about this problem. For example using an common SLF4J API can perform 70 method calls befor printing a simple message on the output stream. Using a Logback backend make this stack call even deeper.

We believe that standard is important, and API like SLF4J is very important for production usage of code. However in many case, we aren't ready paid so this price (for example in Android application) because log performance has direct impact on user experience.

This very death (to ?) simple library aims at offering a generic way to perfom log with a few overhead and ability to remove debug log at compile like any C++ application.

Last version : 1

How to use it :

Simply include the dependency from Maven repository as

    <dependency>
        <groupId>org.kevoree.log</groupId>
        <artifactId>org.kevoree.log</artifactId>
        <version>REPLACE_LOG_VERSION</version>
    </dependency>

Then you can directly use it in your Java code :

org.kevoree.Log.info("My important message");

or

static import org.kevoree.Log;
info("My important Message");

In addition you can use SLF4J lazy string formatting strategy (up to 5 arguments max) :

info("Hello {} from {}",obj1,obj2);

##If you already use SLF4J API?

Can to seamless migrate from SLF4J , just include our compatibility layer without depend on SLF4J API (which is included).

    <dependency>
        <groupId>org.kevoree.log</groupId>
        <artifactId>org.kevoree.log.compat.slf4j</artifactId>
        <version>REPLACE_LOG_VERSION</version>
    </dependency>

Don't hesite to give us any feedback, or new idea to improve this API.

kevoree-log's People

Contributors

dukeboard avatar gnain avatar

Watchers

 avatar James Cloos avatar

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.