mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #1699 from sharelatex/bg-improve-logging
improve logging GitOrigin-RevId: 0d87db74c62aa5c887412250c26f5acccdf73acf
This commit is contained in:
parent
0eaf6db2d6
commit
d82f679fd7
4 changed files with 10 additions and 2 deletions
|
@ -98,9 +98,17 @@ define([
|
|||
__guard__(window.location != null ? window.location.search : undefined, x =>
|
||||
x.match(/debug=true/)
|
||||
) != null
|
||||
var sl_console_last_log = null
|
||||
window.sl_console = {
|
||||
log(...args) {
|
||||
if (sl_debugging) {
|
||||
sl_console_last_log = null
|
||||
return console.log(...Array.from(args || []))
|
||||
}
|
||||
},
|
||||
logOnce(...args) {
|
||||
if (sl_debugging && args[0] !== sl_console_last_log) {
|
||||
sl_console_last_log = args[0]
|
||||
return console.log(...Array.from(args || []))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -346,7 +346,7 @@ define([
|
|||
if (inflightOp == null && pendingOp == null) {
|
||||
// there's nothing going on, this is ok.
|
||||
saved = true
|
||||
sl_console.log('[pollSavedStatus] no inflight or pending ops')
|
||||
sl_console.logOnce('[pollSavedStatus] no inflight or pending ops')
|
||||
} else if (inflightOp != null && inflightOp === this.oldInflightOp) {
|
||||
// The same inflight op has been sitting unacked since we
|
||||
// last checked, this is bad.
|
||||
|
|
|
@ -37,7 +37,6 @@ define(['base'], App =>
|
|||
} else {
|
||||
element.addClass('no-animate')
|
||||
}
|
||||
sl_console.log('LAYOUT')
|
||||
if (scope.ui.reviewPanelOpen) {
|
||||
PADDING = 8
|
||||
TOOLBAR_HEIGHT = 38
|
||||
|
|
|
@ -36,6 +36,7 @@ define(['base'], function(App) {
|
|||
if (meta == null) {
|
||||
meta = {}
|
||||
}
|
||||
sl_console.log('event', type, meta)
|
||||
this.recentEvents.push({ type, meta, date: new Date() })
|
||||
if (this.recentEvents.length > 100) {
|
||||
return this.recentEvents.shift()
|
||||
|
|
Loading…
Reference in a new issue