
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
= clog ("color log")
Little Ruby On Rails debugging gem for writing colorized output to log file.
Because clog is all about color
{here's a blog posting with color pictures}[http://kswope.com/2010/08/23/clog-colorful-ruby-on-rails-debug-statements]
== Usage
gem install clog
Rails 2x, in environment.rb
Rails::Initializer.run do |config| config.gem 'clog' end
If you want to change the defaults in environment.rb you might have to require the gem:
Rails::Initializer.run do |config|
config.gem 'clog'
require 'clog'
Clog.colors(:black, yellow)
end
Rails 3x, in Gemfile
gem "clog"
You change the defaults in environment.rb just like rails 2x
=== No argument outputs a "flag"
clog
=== Single argument
clog var
=== Tagged argument First argument must be a symbol, which it outputs before second argument.
clog :var, var
{:one=>1, :two=>2, :three=>3}.each do |k,v| clog k, v end
=== Multiple arguments
Will output each on its own line.
clog Object.new, Kernel, RUBY_VERSION, :a_symbol
=== Changing color Clog.colors(background, forground=white)
Choices- :black, :red, :green, :yellow, :blue, :magenta, :cyan, :white
Clog.colors(:blue) Clog.colors(:black, yellow)
Default is red background, white foreground.
=== Max width
clog figures out when its appropriate to place additional information (line number, calling method, etc) on the right of the output or below it on the next line. Think of maxwidth as representing the width of your terminal window. The default is 150
Clog.maxwidth(100)
=== Changes
version 0.2.0 now outputs during testing (not to log but to shell)
version 0.2.1 does the opposite of the above line. Tests now have too much formatting and output, so lets log to test.log if we're running in a rails env
== Copyright
Copyright (c) 2010 Kevin Swope. See LICENSE for details.
FAQs
Unknown package
We found that clog demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.