Giter Site home page Giter Site logo

logger's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

logger's Issues

Different implementation

Hey. I like the idea.

I was thinking about priorities such as syslog uses.

So I came with an alternative implementation that will accept the level as first argument:

$logger = logger("prod.log", LOG_ERR);

// This won't be logged
$logger(LOG_DEBUG, "The value %f should be %s", 123.1, '123');

// This will
$logger(LOG_CRIT, "The application is unavailable");

This way is more restrict as it has not a free condition. The condition is fixed that the given level should be lower than the one given when created. But restricting this is not big deal and it's preferred (in my opinion) to allow easy to use.

Now there is one function for all possible logging needs, which I like it more as I can pass it from one side to another as a single parameter.

Implementation can be found here: https://gist.github.com/jm42/ac120fbdb5379c5c0b36

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.