Skip to content

Commit 02c3301

Browse files
committed
Move logging to console when debug is enabled into separate function
1 parent 3933cb4 commit 02c3301

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/raven.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,9 +681,7 @@ function makeRequest(data) {
681681
function isSetup() {
682682
if (!hasJSON) return false; // needs JSON support
683683
if (!globalServer) {
684-
if (window.console && console.error && Raven.debug) {
685-
console.error("Error: Raven has not been configured.");
686-
}
684+
logDebug('error', 'Error: Raven has not been configured.');
687685
return false;
688686
}
689687
return true;
@@ -720,6 +718,12 @@ function uuid4() {
720718
});
721719
}
722720

721+
function logDebug(level, message) {
722+
if (window.console && console[level] && Raven.debug) {
723+
console[level](message);
724+
}
725+
}
726+
723727
function afterLoad() {
724728
// Attempt to initialize Raven on load
725729
var RavenConfig = window.RavenConfig;

0 commit comments

Comments
 (0)