2017 © Pedro PelĂĄez
 

library log

Small group of classes to build upon. Logs timestamps in code

image

mcknubb/log

Small group of classes to build upon. Logs timestamps in code

  • Monday, May 23, 2016
  • by lolas142
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

CLog

a logging class based on lydia/Clog

This class has no dependencies and can easily be implemented in any ANAX-baed framework., (*1)

Usage together with Anax-MVC

Installation

The first thing you have to do to use CLog is to add "mcknubb/log": "dev-master"to your composer.json file and then run composer to update and install. Once the package has been installed you have to add the logger to DI. This is done by adding this code to your "config_with_app.php"., (*2)

    $di->setShared('logger', function () {
        $logger = new \Mcknubb\Log\Clog();
        return $logger;
    });

Then all you have to do is add a timestamp whereever you want to see what happens. This example is from where we add the routes., (*3)

    public function add($rule, $action = null)
    {
        $this->di->logger->Timestamp(__CLASS__, __METHOD__, 'Adding route');
        //..
    }

Then to show the generated log you add "echo $app->logger->renderLog();" to the end of your file like so., (*4)

    // Render the response using theme engine.
    $app->theme->render();    
    echo $app->logger->renderLog();

Build Status Code Coverage Scrutinizer Code Quality, (*5)

The Versions

23/05 2016

dev-master

9999999-dev

Small group of classes to build upon. Logs timestamps in code

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Elias TÄngring

logger education

16/05 2016

v1.0

1.0.0.0

Small group of classes to build upon. Logs timestamps in code

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Elias TÄngring

logger education