
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
= Debug Log
This is a simple RubyGem that provides a more convenient and powerful way of doing debug printouts than using puts or a logger directly.
== Usage
Require the gem. If you are using Bundler, add this to your Gemfile:
gem 'debug_log', '~> version known to work'
Now you can do debug printouts like this:
my_list = [:a, :b, :c] my_number = 5 debug.log("at the end of bar", "my_number", "my_list.size")
The first argument to the log method is a comment and the following arguments are Ruby expression that will be evaluated. Here is an example of what the output can look like:
DebugLog | at the end of bar | my_number="5" (Fixnum), my_list.size="3" (Fixnum) | /Users/peter/tmp/debug-example.rb:7:in `foo'
By default the logger will log to stdout, but you can change that through the configuration options:
DebugLog.logger = lambda { |message| Rails.logger.info(message) } DebugLog.stdout = false # defaults to true DebugLog.enabled = false # defaults to true
== Credit
The approach to patching the binding object was taken from Niclas Nilssons presentation "The Ruby advantage - metaprogramming and DSLs" at Nordic Ruby 2010. Niclas has packaged up his own solution to debug printouts in his {dp gem}[https://github.com/niclasnilsson/dp].
FAQs
Unknown package
We found that debug_log 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
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.