Skip to content

Commit

Permalink
component replace console.warn with log.warn
Browse files Browse the repository at this point in the history
  • Loading branch information
jparez committed Jan 16, 2025
1 parent bd78626 commit d7b5743
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/plugins/util/components.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
const log = require('loglevel');

/**
* Factory function to create a custom switch button.
Expand Down Expand Up @@ -125,7 +126,7 @@ const slider = (() => {

const setValue = (newValue, triggerOnChange = false) => {
if (isNaN(newValue) || newValue < min || newValue > max) {
console.warn('`value` must be within the range defined by `min` and `max`.');
log.warn('`value` must be within the range defined by `min` and `max`.');
return;
}

Expand Down Expand Up @@ -205,7 +206,7 @@ const textInput = (() => {

const setValue = (newValue, triggerOnChange = false) => {
if (regexFilter && !regexFilter.test(newValue)) {
console.warn('Invalid value:', newValue);
log.warn('Invalid value:', newValue);
return;
}

Expand Down Expand Up @@ -371,7 +372,7 @@ const dropdownSelect = (() => {
&& typeof item.value !== 'undefined' && item.element && item.element instanceof HTMLElement) {
optionDiv.appendChild(item.element);
} else {
console.warn('Invalid item. Need at least props element and value. Item', item);
log.warn('Invalid item. Need at least props element and value. Item', item);
return;
}

Expand Down

0 comments on commit d7b5743

Please sign in to comment.