\CGExtensionslogger

An abstract class to assist with logging. An instance of this class will typically be passed into a functional class to assist with logging and debugging.

This class can also handle displaying progress.

Summary

Methods
Properties
Constants
__construct()
advance()
done()
get_percent_complete()
reset()
debug()
verbose()
info()
warning()
error()
fatal()
display_progress()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(int $total_steps)

Constructor

Parameters

int $total_steps

advance()

advance()

Advance the progress meter.

done()

done() : bool

Test if the operation is complete.

Returns

bool

get_percent_complete()

get_percent_complete() : float

Get the progress as a percentage.

Returns

float —

A value between 0 and 100

reset()

reset()

Reset the progress meter

debug()

debug(string $str)

Display a debug message.

Parameters

string $str

The message to display.

verbose()

verbose(string $str)

Display a verbose message.

Typically some flag in the derived class would indicate if these should be actually output.

Parameters

string $str

The message to display.

info()

info(string $str)

Display an information message

Parameters

string $str

The message to display.

warning()

warning(string $str)

Displa a warning message

Parameters

string $str

The message to display.

error()

error(string $str)

Displa an error message

Parameters

string $str

The message to display.

fatal()

fatal(string $str)

Displa a fatal message.

Parameters

string $str

The message to display.

display_progress()

display_progress(float $percent)

Displa the current progress

Parameters

float $percent

The progress percentage.