Skip to content

Instantly share code, notes, and snippets.

@erikreagan
Created June 16, 2011 22:17
Show Gist options
  • Save erikreagan/1030428 to your computer and use it in GitHub Desktop.
Save erikreagan/1030428 to your computer and use it in GitHub Desktop.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$plugin_info = array(
'pi_name' => 'Log Me',
'pi_version' => '1.0.0',
'pi_author' => 'Erik Reagan',
'pi_author_url' => 'http://focuslabllc.com',
'pi_description' => 'Sample template logging',
'pi_usage' => ''
);
class Log_me {
public $return_data = "";
// Support for pre 2.1.3 builds
public function Log_me() { $this->__construct(); }
/**
* Constructor
*
* Default function when a plugin doesn't have
* a third parameter in the tag
*/
public function __construct()
{
$this->EE =& get_instance();
$this->_log_item('Log Me: See! This was easy!');
$this->_log_item('Look, ma! I\'m indented.', 2);
$this->return_data = 'Done.';
}
// End function __construct()
/**
* Write items to template debugging log
*
* @param string String to log
* @param int Tab indention
* @access private
* @return void
*/
private function _log_item($string = FALSE, $indent = 1)
{
if ($string)
{
$tab = str_repeat('&nbsp;', 7 * $indent);
$this->EE->TMPL->log_item($tab . '- ' . $string);
}
}
// End function _log_item()
}
// End class Log_me
/* End of file pi.log_me.php */
/* Location: ./system/expressionengine/third_party/log_me/pi.log_me.php */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment