Skip to content

Creative-Themes/wp-js-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published