1.0.4 • Published 7 years ago

ct-wp-js-log v1.0.4

Weekly downloads
7
License
ISC
Repository
github
Last release
7 years ago

Synopsis

A simple way of doing logging on the JavaScript side in WordPress.

Code Example

log = require('ct-wp-js-log');
log('simple log');
log.log('another one');
log.error('error log');

Motivation

We wanted a very simple way of doing logs, while checking for the WP_DEBUG global variable. And we got this as a result.

Installation

Don't forget to localize your server side WP_DEBUG constant.

if (defined('WP_DEBUG')) {
	wp_localize_script(
		'your-handle',
		'WP_DEBUG',
		array('debug' => true)
	);
}

License

MIT

npm.io

1.0.4

7 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago