kayahr / console-shim

Browser console compatibility shim for legacy JavaScript engines
MIT License
86 stars 16 forks source link

console-shim

Description

This small shim implements or completes window.console on browsers which have no or incomplete console support. The goal is to be able to use the console in JavaScript applications without having to worry about JavaScript errors which might occur if a browser does not provide a native console or has an incomplete console implementation.

If no native console is present and an other logging facility is available (like log4javascript, which is currently the only supported alternate logging facility) then the emulated console is linked to this logging facility. If no alternative logging facility is found then a dummy console is emulated which silently ignores all logging attempts.

Implemented functions

This section lists the actions done by this shim if a specific console feature is not supported by the browser.

License

Copyright (c) 2011-2012 Klaus Reimer k@ailis.de

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Reporting problems

If you have any problems with console-shim or find bugs in the software then please create an issue.