-
Notifications
You must be signed in to change notification settings - Fork 1
Home
tagsole is an expansion of the traditional JavaScript console concept, to allow tagging in console operations, and providing a complete history and filtering plus simple globbing functionality. This can be useful for troubleshooting, or creating unit tests in medium to large JavaScript applications, by giving you more control over what is logged, and how you interact with the data.
Note: This does not override the console, it is a completely separate function; it does have the ability to call the console, and is compatible with most implementations; see the API section for details.
TODO: Simple example: using the "history" method
TODO: Example with a JS application that loads ajax, log before, success, error and show simple integration with both live code (for troubleshooting live issues) and mocked responses.
TODO: Show how to effectively use globbing on name-spaced example code
You can subscribe to several events within tagsole; simply use the addEventListener method.
tagsole.addEventListener("EVENT_NAME", function(...){...});
- output - catches anything that would go to the console, eg: log, warn, etc...
-
function(out)
, out is an object with the log - Example
-
` tagsole.addEventListener("output", function(out){ console.log("Added tag:", tag); }); '
- addtag - fires when a new tag is encountered, useful for outputting the order of tags, or sniffing when your code reaches a specific tag
-
function(tag, out)
, tag is a string with the new tag, and out is the output passed to it
-
TODO: