Skip to content

lordcoste/profiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Profiler

A PHP 5.3 profiler based off of Laravel 3's Anbu.

Installation

Installing profiler is simple. First, you'll need to add the package to the require attribute of your composer.json file.

{
    "require": {
        "loic-sharma/profiler": "1.0.*"
    },
}

Installing Using Laravel 4

To enable te profiler in Laravel 4 you will need to register the Service Provider and the Facade.

  1. Add Profiler\ProfilerServiceProvider to the list of service providers in app/config/app.php
  2. Add 'Profiler' => 'Profiler\Facades\Profiler', to the list of class aliases in app/config/app.php

And voila! You can use the profiler.

Profiler::logDebug($object);

Profiler::startTimer('testLogging');

Profiler::logInfo('Hello World!');
Profiler::logNotice('Some event occurred.');
Profiler::logWarning('Careful: some warning.');
Profiler::logError('Runtime error.');
Profiler::logCritical('This needs to be fixed now!');
Profiler::logEmergency('The website is down right now.');

Profiler::endTimer('testLoggin');

Installing For Your Own Project

Add the following to your code:

$profiler = new Profiler\Profiler(new Profiler\Logger\Logger);

You can now use the profiler to your heart's content.

$profiler->startTimer('testLogging');

$profiler->log->debug($object);

$profiler->log->info('Hello World!');
$profiler->log->notice('Some event occurred.');
$profiler->log->warning('Careful: some warning.');
$profiler->log->error('Runtime error.');
$profiler->log->critical('This needs to be fixed now!');
$profiler->log->emergency('The website is down right now.');

$profiler->endTimer('testLogging');

echo $profiler;

Copyright and License

Profiler was written by Loic Sharma. Profiler is released under the 2-clause BSD License. See the LICENSE file for details.

Copyright 2012 Loic Sharma

About

A PHP 5.3 profiler based off of Laravel 3's Anbu.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 76.7%
  • JavaScript 23.3%