[![Gem Version](https://badge.fury.io/rb/delogger.svg)](https://badge.fury.io/rb/delogger) # Delogger Make your browser console beautiful. This gem is a work in progress. ![Demo](/images/demo.png?raw=true) ## Installation Add this line to your application's Gemfile: ```ruby gem 'delogger' ``` And then execute: $ bundle Or install it yourself as: $ gem install delogger Add this to your `application.js`: ``` //= require delogger ``` And `application.css`: ``` *= require delogger ``` ## Usage These methods work similarly to `console.log`, but they support [formatting](#formatting): - `DeLogger.debug` - `DeLogger.warn` - `DeLogger.error` By default, DeLogger is **disabled**. To enable it, use `DeLogger.enable()`. You can disable it again using `DeLogger.disable()`. ## Logging levels DeLogger has three logging levels: `debug`, `warn` and `error`. Level can be set using `DeLogger.level` (default is `debug`). (TODO) ## Formatting DeLogger supports string formatting. Syntax: `"(my text).class1.class2"`. Classes are specific for the logger and are not being fetched from stylesheets. Supported classes: `badge`, `debug`, `warn`, `error`, `bold`, `italic`. See also: [color classes](#color-classes). Example: ```js DeLogger.log("(MyClass#myMethod).badge", "(@akxcv).badge.warn", "(bold).bold", { foo: 'bar' }) ``` ![Example output](/images/example.png?raw=true) TODO ## Color classes DeLogger supports following color classes (both for badges and normal text): - `.blue` - `.orange` - `.red` - `.green` - `.cyan` - `.yellow` - `.gray` - `.brown` - `.purple` - `.pink` ## Adding custom / overriding existing styles All styles are declared in a stylesheet and thus are easily extensible. See [`assets/stylesheets/delogger.scss`](assets/stylesheets/delogger.scss). At the moment, only these attributes are supported: `margin-left`, `color`, `background-color`, `border-radius`, `padding`, `font-weight`, `font-style`. ## Development TODO ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/akxcv/delogger. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).