MarionetteLabs/marionette.inspector — pull request #19 by jasonLaster (2014-10-24 21:00:44+00:00)
Title: Logging

Logging the inspector is by far the easiest way to figure out something is borked and undercover the real reason.

With that said, adding tons of logs can also be a pain.
1. we don't want to release the logs when we ship
2. too many logs can quickly swamp the console
3. logs can be a huge perf hog when they're printing to the screen

So... this PR goes to the drawing board and creates an awesome `Logger` tool for the inspector and improves the debug tool for the backboneAgent.

The PR is depndent on other PRs, so checkout the commit at the bottom to see it the one change.

---

#### Introducing the new Logger

```js
logger.log('ui', 'regionTree', data)
```

Logger takes a key, message, and data and formats in a nice way.

Inside the logger class, you can turn specific keys on for logging so you only see what you want to see. Also, all of the logs are saved to the logs hash so you can go back and do some queries agains tthe logs themselves or just print it out

```js
app.logger.printLogs('ui') // => prints all of the ui logs out
app.logger.logs.ui; // => returns all of the logs
```