Giter VIP home page Giter VIP logo

easy_log4r's Introduction

easy-log4r

easy-log4r is a quick and simple way to start using Log4r fast. It quickly and easily creates a default logger, as well as class and instance functions that can be used to access it. In addition, it also provides a simple way to disable logging, for whatever reason, without needing to actually remove or comment out the logging code you, hopefully, peppered through your code.

To get started simply put the following into your class and you’re good to go!

require 'easy-log4r'
include EasyLog4r::EasyLogger

This gives you two default outputs, one to stdout for all levels of logging, and one to stderr for the error and fatal levels of logging.

To disable logging you can ‘include EasyLog4r::NullLogger`. You don’t need to remove the EasyLogger you include to start logging, but you can if you want to.

The default logger is created using the base class’s name, so if you want to customize a particular logger’s outputters using an XML or YAML file, feel free to do so using the normal methods, remembering to give the logger the class’s name. (ex: ‘MyClass’)

That’s it! Quick, simple, easy logging using log4r.

New Features

0.1.0

You can now customize what outputters are used with easy_log4r! Excitement!

To do so, you must:

  1. Use whichever method of configuration you prefer, xml or yaml, and you add a ‘default` attribute to the given outputter.

  2. Include ‘require ’easy_log4r’‘ before you parse the configuration file. (This is so the monkey patches to Log4r’s base classes can take effect)

  3. Parse the configuration file! (You’re done!)

If you have no clue how to use a configuration file to edit Log4r, head over to github.com/Valarissa/easy_log4r/wiki/Log4r-Yaml-Configuration

Contributing to easy-log4r

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.

  • Fork the project.

  • Start a feature/bugfix branch.

  • Commit and push until you are happy with your contribution.

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2012 Lauren Voswinkel. See LICENSE.txt for further details.

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.