Yet another logging framework
Perl6
Latest commit 27d27c4 Dec 20, 2016 @jonathanstowe Fix for lexical use
Permalink
Failed to load latest commit information.
lib Replace the samewith for performance reasons Sep 26, 2016
t Fix for lexical use Dec 20, 2016
.gitignore Add precomp Mar 26, 2016
.travis.yml Don't test dependencies Sep 28, 2016
Documentation.md Add Documentation as markdown Mar 29, 2016
LICENCE
META6.json Up version Sep 26, 2016
README.md rename LICENCE as en_GB May 30, 2016

README.md

Lumberjack

A simple logging framework.

Build Status

Synopsis

use Lumberjack;

# Output to $*ERR by default - in colour!
Lumberjack.dispatchers.append: Lumberjack::Dispatcher::Console.new(:colours);

class MyClass does Lumberjack::Logger {
	method start() {
       self.log-info("Starting ...");
       ...
   }

   method do-stuff() {
      self.log-debug("Doing stuff ...");
      ...
      if $something-went-wrong {
         self.log-error("Something went wrong");
      }
   }
   method stop() {
       ...
       self.log-info("Stopped.");
   }
}

MyClass.log-level = Lumberjack::Debug;

Descriptiom

This is more of a sketch for a logging framework, or perhaps even a logging framework framework. It provides the minimum interface that classes can consume a role to provide themselves logging facilities and set a class wide logging level and have the messages delivered to dispatchers which can do what they want with the messages and specify the levels of messages that they want to handle.

It doesn't mandate any particular configuration format as the setup is entirely programmatic, I foresee that people providing their own higher level configuration driven things on top of this.

I'm sure this doesn't yet have all the features to support all the requirements people, but it is released with the basic interface complete so it can actually be used.

The approach taken reflects a patten that I have found useful in large object oriented programmes, where having the logging methods on a class means that you have the means to make log messages wherever you have an instance of the class without having to obtain a separate logger object.

There are a couple of simple log dispatchers included which should get you started, but I would envisage that more useful ones may be provided as separate modules, though they are sufficiently simple to implement you can provide your own as required.

Installation

Assuming you have a working Rakudo perl 6 installation you should be able to install this directly with panda:

panda install Lumberjack

Or if you have the source code locally:

panda install .

I haven't tested it myself, but I see no reason that you shouldn't be able to install this with "zef" or indeed any other similarly capable package management tool that may come along.

Support

This is quite experimental and subject to change in the way it is implemented, however I would like to keep the basic interface fairly stable and simple. You are encouraged to create your own log dispatchers and high level configuration modules to work with it.

However if it is missing a basic functionality you need that can't be provided by some extension and would be useful to others please let me know. And of course if you find that it has some unanticipated bug I'd also like to know.

Reports, requests, suggestions and patches can be sent to https://github.com/jonathanstowe/Lumberjack/issues

Licence and Copyright

This is free software, please see the LICENCE file for full description.

© Jonathan Stowe 2016