canteen/logger

This package is abandoned and no longer maintained. No replacement package was suggested.

Using PHP to trace and debug code on a website

1.0.1 2013-10-12 00:00 UTC

This package is not auto-updated.

Last update: 2020-01-19 17:48:43 UTC


README

#Canteen Logger

A visual display of logs from within your PHP code. Add this to any dynamic PHP page to see a list of all your debug, trace, info, warning, and error statements. For documentation of the codebase, please see Canteen Logger docs.

##Installation

Install is available using Composer.

composer require canteen/logger dev-master

Including using the Composer autoloader in your index.

require 'vendor/autoload.php';

##Setup

use Canteen\Logger;
Logger.init();

At the very end of your PHP code, echo the Logger contents within the body of your document. Such as:

echo Logger::instance()->render();

##Usage

Here are some examples of usage:

// Most general trace statement
trace('Logger setup!');

// You can pass arrays or objects to the trace output
info(array(10, 100, 1000));

There are five different log levels function that come with Logger. These are in order from least to most severe. Statements are color coded in the output trace window depending on the method called.

  • trace()
  • debug()
  • info()
  • warning()
  • error()

###Rebuild Documentation

This library is auto-documented using YUIDoc. To install YUIDoc, run sudo npm install yuidocjs. Also, this requires the project CanteenTheme be checked-out along-side this repository. To rebuild the docs, run the ant task from the command-line.

ant docs

##License##

Copyright (c) 2013 Matt Karl

Released under the MIT License.