mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-14 19:50:54 -05:00
1213709578
[web] migrate frontend logging to debugConsole GitOrigin-RevId: b03ff9030b03fff059738d2270bc4b4912e79f16
13 lines
404 B
TypeScript
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 }
|