mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 16:23:39 -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 =>
|
__guard__(window.location != null ? window.location.search : undefined, x =>
|
||||||
x.match(/debug=true/)
|
x.match(/debug=true/)
|
||||||
) != null
|
) != null
|
||||||
|
var sl_console_last_log = null
|
||||||
window.sl_console = {
|
window.sl_console = {
|
||||||
log(...args) {
|
log(...args) {
|
||||||
if (sl_debugging) {
|
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 || []))
|
return console.log(...Array.from(args || []))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -346,7 +346,7 @@ define([
|
||||||
if (inflightOp == null && pendingOp == null) {
|
if (inflightOp == null && pendingOp == null) {
|
||||||
// there's nothing going on, this is ok.
|
// there's nothing going on, this is ok.
|
||||||
saved = true
|
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) {
|
} else if (inflightOp != null && inflightOp === this.oldInflightOp) {
|
||||||
// The same inflight op has been sitting unacked since we
|
// The same inflight op has been sitting unacked since we
|
||||||
// last checked, this is bad.
|
// last checked, this is bad.
|
||||||
|
|
|
@ -37,7 +37,6 @@ define(['base'], App =>
|
||||||
} else {
|
} else {
|
||||||
element.addClass('no-animate')
|
element.addClass('no-animate')
|
||||||
}
|
}
|
||||||
sl_console.log('LAYOUT')
|
|
||||||
if (scope.ui.reviewPanelOpen) {
|
if (scope.ui.reviewPanelOpen) {
|
||||||
PADDING = 8
|
PADDING = 8
|
||||||
TOOLBAR_HEIGHT = 38
|
TOOLBAR_HEIGHT = 38
|
||||||
|
|
|
@ -36,6 +36,7 @@ define(['base'], function(App) {
|
||||||
if (meta == null) {
|
if (meta == null) {
|
||||||
meta = {}
|
meta = {}
|
||||||
}
|
}
|
||||||
|
sl_console.log('event', type, meta)
|
||||||
this.recentEvents.push({ type, meta, date: new Date() })
|
this.recentEvents.push({ type, meta, date: new Date() })
|
||||||
if (this.recentEvents.length > 100) {
|
if (this.recentEvents.length > 100) {
|
||||||
return this.recentEvents.shift()
|
return this.recentEvents.shift()
|
||||||
|
|
Loading…
Reference in a new issue