Skip to content

jQuery.migrateWarningsTrace property to enable console traces #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
jQuery.migrateWarningsTrace property to enabled console.trace on warn…
…ings
  • Loading branch information
silentroach committed Jan 16, 2013
commit d75c66f85dd14e6789ae45ad40ec8307041c5d18
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ This plugin adds three properties to the `jQuery` object that can be used progra

`jQuery.migrateMute`: Set this property to `true` to prevent console warnings from being generated in the debugging version. The `jQuery.migrateWarnings` array is still maintained when this property is set, which allows programmatic inspection without console output.

`jQuery.migrateWarningsTrace`: Set this property to `true` to enable console traces.

`jQuery.migrateReset()`: This method clears the `jQuery.migrateWarnings` array and "forgets" the list of messages that have been seen already.

## Reporting problems
Expand Down
4 changes: 4 additions & 0 deletions src/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ jQuery.migrateWarnings = [];
// Set to true to prevent console output; migrateWarnings still maintained
// jQuery.migrateMute = false;

// Set to true to enable warnings traces
// jQuery.migrateWarningsTrace = false;

// Forget any warnings we've already given; public
jQuery.migrateReset = function() {
warnedAbout = {};
Expand All @@ -19,6 +22,7 @@ function migrateWarn( msg) {
jQuery.migrateWarnings.push( msg );
if ( window.console && console.warn && !jQuery.migrateMute ) {
console.warn( "JQMIGRATE: " + msg );
jQuery.migrateWarningsTrace && console.trace && console.trace();
}
}
}
Expand Down