ChromePhp Class Reference

## Public Member Functions

| addSetting ($key, $value)
| addSettings (array $settings)
| getSetting ($key)

## Static Public Member Functions

static | getInstance ()
static | log ()
static | warn ()
static | error ()
static | group ()
static | info ()
static | groupCollapsed ()
static | groupEnd ()
static | table ()

## Data Fields

const | VERSION = '4.1.0'
const | HEADER_NAME = 'X-ChromeLogger-Data'
const | BACKTRACE_LEVEL = 'backtrace_level'
const | LOG = 'log'
const | WARN = 'warn'
const | ERROR = 'error'
const | GROUP = 'group'
const | INFO = 'info'
const | GROUP_END = 'groupEnd'
const | GROUP_COLLAPSED = 'groupCollapsed'
const | TABLE = 'table'

## Protected Member Functions

| _convert ($object)
| _getPropertyKey (ReflectionProperty $property)
| _addRow (array $logs, $backtrace, $type)
| _writeHeader ($data)
| _encode ($data)

## Static Protected Member Functions

static | _log ($type, array $args)

## Protected Attributes

| $_php_version
| $_timestamp
| $_json
| $_backtraces = array()
| $_error_triggered = false
| $_settings
| $_processed = array()

## Static Protected Attributes

static | $_instance

## Member Function Documentation

## _addRow()

_addRow | ( | array | $logs,
|  |  | $backtrace,
|  |  | $type
| ) |  |

protected

## _convert()

_convert | ( |  | $object | ) |

protected

converts an object to a better format for logging

Parameters

  Object |

Returns
  array

## _encode()

_encode | ( |  | $data | ) |

protected

encodes the data to be sent along with the request

Parameters

  array | $data |

Returns
  string

## _getPropertyKey()

_getPropertyKey | ( | ReflectionProperty | $property | ) |

protected

takes a reflection property and returns a nicely formatted key of the property name

Parameters

  ReflectionProperty |

Returns
  string

## _log()

static _log | ( |  | $type,
|  | array | $args
| ) |  |

staticprotected

internal logging call

Parameters

  string | $type |

Returns
  void

## _writeHeader()

_writeHeader | ( |  | $data | ) |

protected

## addSetting()

addSetting | ( |  | $key,
|  |  | $value
| ) |  |

adds a setting

Parameters

  string | key
  mixed | value

Returns
  void

## addSettings()

addSettings | ( | array | $settings | ) |

add ability to set multiple settings in one call

Parameters

  array | $settings |

Returns
  void

## error()

static error | ( |  | ) |

static

logs an error to the console

Parameters

  mixed | $data,... | unlimited OPTIONAL number of additional logs [...]

Returns
  void

## getInstance()

static getInstance | ( |  | ) |

static

gets instance of this class

Returns
  ChromePhp

## getSetting()

getSetting | ( |  | $key | ) |

gets a setting

Parameters

  string | key

Returns
  mixed

## group()

static group | ( |  | ) |

static

sends a group log

Parameters

  string | value

## groupCollapsed()

static groupCollapsed | ( |  | ) |

static

sends a collapsed group log

Parameters

  string | value

## groupEnd()

static groupEnd | ( |  | ) |

static

ends a group log

Parameters

  string | value

## info()

static info | ( |  | ) |

static

sends an info log

Parameters

  mixed | $data,... | unlimited OPTIONAL number of additional logs [...]

Returns
  void

## log()

static log | ( |  | ) |

static

logs a variable to the console

Parameters

  mixed | $data,... | unlimited OPTIONAL number of additional logs [...]

Returns
  void

## table()

static table | ( |  | ) |

static

sends a table log

Parameters

  string | value

## warn()

static warn | ( |  | ) |

static

logs a warning to the console

Parameters

  mixed | $data,... | unlimited OPTIONAL number of additional logs [...]

Returns
  void

## Field Documentation

## $_backtraces

$_backtraces = array()

protected

## $_error_triggered

$_error_triggered = false

protected

## $_instance

$_instance

staticprotected

## $_json

$_json

protected

Initial value:
= array(
'version' => self::VERSION,
'columns' => array('log', 'backtrace', 'type'),
'rows' => array()
)

## $_php_version

$_php_version

protected

## $_processed

$_processed = array()

protected

## $_settings

$_settings

protected

Initial value:
= array(
self::BACKTRACE_LEVEL => 1
)

## $_timestamp

$_timestamp

protected

## BACKTRACE_LEVEL

const BACKTRACE_LEVEL = 'backtrace_level'

## ERROR

const ERROR = 'error'

## GROUP

const GROUP = 'group'

## GROUP_COLLAPSED

const GROUP_COLLAPSED = 'groupCollapsed'

## GROUP_END

const GROUP_END = 'groupEnd'

## HEADER_NAME

const HEADER_NAME = 'X-ChromeLogger-Data'

## INFO

const INFO = 'info'

## LOG

const LOG = 'log'

## TABLE

const TABLE = 'table'

## VERSION

const VERSION = '4.1.0'

## WARN

const WARN = 'warn'

The documentation for this class was generated from the following file:

- application/views/ChromePhp.php