Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Site updated at 2013-04-02 15:05:28 UTC
- Loading branch information
1 parent
e13e81b
commit 19eb9a7
Showing
17 changed files
with
141 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Override Console | ||
|
||
In production, We can easily capture console messages. And not only that, we can manage which type of message we want to capture. | ||
|
||
Lets override console in a single line. | ||
|
||
window.console = debuggify.Logger.get('console'); | ||
|
||
// We can console object to report errors | ||
console.info('Yay! I can collect console messages') | ||
console.log('Yay! I can collect console messages'); | ||
console.warn('Yay! I can collect console messages'); | ||
console.error('Yay! I can collect console messages'); | ||
|
||
|
||
This will send all types of messages to the server. But collecting info and log is not important so to limit it to receive only warn and error messages | ||
|
||
|
||
window.console.setLevel(2); | ||
|
||
|
||
Calling `setLevel` will only send messages which are greater than and equal to mentioned level. | ||
|
||
We can also use selFlag to enable / disable any specific level. | ||
|
||
// Disable info messages | ||
window.console.setFlag('info', false); | ||
|
||
// Enable info messages | ||
window.console.setFlag('info', false); | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.