Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stump

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stump

  • 2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Stump

Code Climate Build Status Dependency Status Gem Version

Stump is a minimal wrapper around the basic ruby logger that provides logging to a log file in addition to STDOUT - something which is for some reason rather hard to do for rack-based applications not using Rails. It also provides an access_log which you can write to STDOUT and (if you wish) a log file.

Why call it Stump? It's like a small (tree) log, get it? Get it?

Usage

# Gemfile
gem 'stump'

# configuration file for your rack-based application
require 'stump'

logger = Stump::Logger.new
use Stump::AccessLog, logger

Example

The following example demonstrates usage of stumpin a vanilla, minimal sinatra application. You can literally copy this code and run the example in less than a minute.

# Gemfile
source 'https://rubygems.org'

gem 'sinatra'
gem 'stump'

# hi.rb
require 'sinatra'
require 'stump'

logger = Stump::Logger.new "tmp/log.log"
logger.level = Logger::DEBUG
use Stump::AccessLog, logger

get '/hi' do
  logger.debug 'hello'
  'What came first - the cat or the internet?'
end

Run bundle and ruby hi.rb, point your brower to localhost:4567/hi and witness the magic.

Issues

"Hey, it's not working!"

This can totally happen, so just open up an issue and I'll get right on it!

License

Copyright (c) @nicovhi, released under the MIT License.

FAQs

Package last updated on 15 Apr 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc