Removed log prefixing again
It caused issues with our line number tracking in the browser developer tools and I don't see any way to avoid this considering that we can't adjust the arguments supplied to console.log without in fact wrapping it :/
This commit is contained in:
parent
38a5da1c35
commit
ce4cf38547
1 changed files with 0 additions and 29 deletions
|
|
@ -7,35 +7,6 @@ $(function() {
|
|||
|
||||
//~~ Logging setup
|
||||
|
||||
var logFormats = {
|
||||
trace: "color: grey",
|
||||
debug: "color: blue",
|
||||
warn: "color: red",
|
||||
error: "color: red; font-weight: bold"
|
||||
};
|
||||
|
||||
var origLogFactory = log.methodFactory;
|
||||
log.methodFactory = function(methodName, logLevel, loggerName) {
|
||||
var rawMethod = origLogFactory(methodName, logLevel, loggerName);
|
||||
var format = logFormats[methodName];
|
||||
var level = _.padRight(methodName.toUpperCase(), 5, " ");
|
||||
|
||||
return function() {
|
||||
var newArgs;
|
||||
if (format && (OctoPrint.coreui.browser.chrome || OctoPrint.coreui.browser.firefox)) {
|
||||
newArgs = ["%c[" + level + "]", format];
|
||||
} else {
|
||||
newArgs = ["[" + level + "]"];
|
||||
}
|
||||
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
newArgs.push(arguments[i]);
|
||||
}
|
||||
|
||||
return rawMethod.apply(null, newArgs);
|
||||
}
|
||||
};
|
||||
|
||||
log.setLevel(CONFIG_DEBUG ? log.levels.DEBUG : log.levels.INFO);
|
||||
|
||||
//~~ OctoPrint client setup
|
||||
|
|
|
|||
Loading…
Reference in a new issue