Skip to content

Commit

Permalink
Make checker for grafana happy by not calling console.log()
Browse files Browse the repository at this point in the history
  • Loading branch information
ekacnet committed Aug 17, 2024
1 parent 386e367 commit 9436742
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/CubismPanelHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ export const zoomCallbackGen = (
): cubism.zoomCallback => {
const f = (start: number, end: number, selection: cubism.d3Selection) => {
if (options.links.length === 0) {
console.log("Can't do any zoom, there is no links to zoom to");
log_debug("Can't do any zoom, there is no links to zoom to");
return;
}
log_debug(`Doing a zoom from point ${start} to point ${end}`);

if (options.links.length > 1) {
console.log('There is more than one link, linked to this graph, will pick the first one');
log_debug('There is more than one link, linked to this graph, will pick the first one');
}
let link = options.links[0].url;
isString(link);
Expand Down
5 changes: 3 additions & 2 deletions src/misc_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ export function enableDebug(): void {
export function log_debug(message?: any, ...optionalParams: any[]): void {
// Set it to true to enable debugging
if (debug) {
let destination = console;
if (optionalParams.length > 0) {
return console.log(message, optionalParams.join(' '));
return destination.log(message, optionalParams.join(' '));
} else {
return console.log(message);
return destination.log(message);
}
}
}

0 comments on commit 9436742

Please sign in to comment.