mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Merge branch 'trunk' into PCP-3170-add-es-lint-and-testing-library-for-js-code
This commit is contained in:
commit
4c05e7c2bd
34 changed files with 1094 additions and 450 deletions
|
@ -1,6 +1,7 @@
|
|||
export function log(message, level = 'info') {
|
||||
const wpDebug = window.wc_ppcp_axo?.wp_debug;
|
||||
const endpoint = window.wc_ppcp_axo?.ajax?.frontend_logger?.endpoint;
|
||||
if(!endpoint) {
|
||||
if (!endpoint) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -15,12 +16,14 @@ export function log(message, level = 'info') {
|
|||
}
|
||||
})
|
||||
}).then(() => {
|
||||
switch (level) {
|
||||
case 'error':
|
||||
console.error(`[AXO] ${message}`);
|
||||
break;
|
||||
default:
|
||||
console.log(`[AXO] ${message}`);
|
||||
if (wpDebug) {
|
||||
switch (level) {
|
||||
case 'error':
|
||||
console.error(`[AXO] ${message}`);
|
||||
break;
|
||||
default:
|
||||
console.log(`[AXO] ${message}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue