2017 © Pedro Peláez
 

library clog

A small class for logging information about classes and methods

image

jejd14/clog

A small class for logging information about classes and methods

  • Sunday, May 10, 2015
  • by JesperJohnsson
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Scrutinizer Code Quality Code Coverage Build Status License, (*1)

CLog

About

A small class for logging information about classes and methods, (*2)

PHP Version

PHP >= 5.4.0
Tested on Anax-MVC >= 2.0.4

Introduction

Instantiate an object of CLog:, (*3)

$newClog = new \jejd14\clog\Clog();

Or instantiate an object of CLog as a shared service within the Anax framework:, (*4)

$di->setShared('log', function() {
    $log = new \jejd14\clog\CLog();
    return $log;
});

Methods

  1. timestamp ( $domain, $where, $comment = null) - Log a event with a time.
  2. timestampAsTable () - Print all timestamps to a table.
  3. pageLoadTime() - Print page per load time.
  4. memoryPeak() - Print memory peak.

Calling of Methods

To properly use the method timestamp listed above you can call it as follows (Assuming you've set the service as a shared service in your frontcontroller), (*5)

Inside a class that extends/implements/uses \Anax\DI\TInjectionAware:, (*6)

$this->di->log->timestamp(__CLASS__, __METHOD__, "A breif comment");

In your frontcontroller:, (*7)

$app->log->timestamp(__CLASS__, __METHOD__, "A breif comment");

CLASS and METHOD are magic constants in PHP., (*8)

To get all the timestamps as a table:, (*9)

$table = $app->log->timestampAsTable();

Composer

You can add clog to your composer.json file like this., (*10)

"require": {
  "jejd14/clog": "dev-master"
 }

License

MIT, (*11)

The Versions

10/05 2015

dev-master

9999999-dev

A small class for logging information about classes and methods

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Jesper Johnsson

debug logging