overleaf/services/web/frontend/js/utils/debugging.ts
Jakob Ackermann 1213709578 Merge pull request #14980 from overleaf/jpa-debug-console
[web] migrate frontend logging to debugConsole

GitOrigin-RevId: b03ff9030b03fff059738d2270bc4b4912e79f16
2023-09-28 08:04:12 +00:00

13 lines
404 B
TypeScript

/* eslint-disable no-console */
type DebugConsole = {
debug(...data: any[]): void
log(...data: any[]): void
warn(...data: any[]): void
error(...data: any[]): void
}
export const debugging =
new URLSearchParams(window.location.search).get('debug') === 'true'
export const debugConsole: DebugConsole = debugging
? console
: { debug() {}, log() {}, warn: console.warn, error: console.error }