This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
CPLog
Description
CPLog consists of a generic logging facility along with logging “providers” for browsers as well as command line tools.
Log Levels
The log levels are (in order): “fatal”, “error”, “warn”, “info”, “debug”, “trace”
Log Providers
- CPLogPopup – For browsers, pops up an interactive log display with numerous options. This is the recommended provider for browsers.
- CPLogConsole – For browsers with a window.console object (Firefox, Safari, Chrome, Opera?), prints to console.error, console.warn, etc.
- CPLogAlert – For browsers, brings up an alert (blocking execution). Allows you to cancel all future CPLogAlerts until reloading application.
*CPLogPrint – For command line applications, prints to stdout. Currently colorizes the logs (red for “fatal”, yellow for “error”, etc)
Registering log providers
To register a logging provider, call one of the following functions
- CPLogRegister(aProvider, aMaxLevel) // registers for log levels up to a max level (passed in as a string) or all log levels if no max is provided.
- CPLogRegisterRange(aProvider, aMinLevel, aMaxLevel) // registers for for a range of log levels (passed in as strings)
- CPLogRegisterSingle(aProvider, aLevel) // registers for a single log level
For example, to register CPLogPopup for all log levels:
CPLogRegister(CPLogPopup);
Writing your own provider
The interface for log providers is very simple: CPLogPrint(aMessage, aLevel, aTitle)






