0.0
No commit activity in last 3 years
No release in over 3 years
Full featured logger for use in RubyMotion apps.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

Motion::Lager 🍺

Full featured logger for use in RubyMotion apps.

Installation

Add this line to your application's Gemfile:

gem 'motion-lager'

And then execute:

$ bundle

Usage

  1. Initialize an instance of the logger. Tip: assign it to a global (like $log) for easy access anywhere in your app.

    logger = Motion::Lager.new(level: 'debug') # default
  2. Next, call a log level method and pass the message or object that you'd like to log. Log level methods are: debug, info (or log), warn, and error. You can also specify the name of a color if you'd like to override the default text color for that log level. You can also specify the background color as the third argument.

    logger.debug 'My debug message'
    logger.debug my_object # pretty print objects
    logger.debug 'Success!', :green
    logger.warn 'Warning: Black on Yellow!', :black, :yellow

Color Options

Color Options

Note: Actual color may vary depending on console preferences. Example from Terminal app:

Example of Terminal Color Preferences

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request