Skip to content

Instantly share code, notes, and snippets.

@kares
kares / talkaholic_logger.rb
Last active August 29, 2015 13:57
Silencing a Rails.logger is (still) not thread-safe ... these initializers will try it's best to avoid your loggers being silenced (and more)! Must have for JRuby.
# put this under **#{Rails.root}/config/initializers** directory
# `silence` is like Chuck Norris you can't kill it, this biuty got yet again
# re-invented in Rails 4 right after Logger#silence got deprecated in 3.2 :)
begin
require 'active_support/logger'
require 'active_support/logger_silence'
ActiveSupport::Logger.silencer = false # silence simply yields
# if 'active_support/core_ext/logger' is loaded
/**
* An example to illustrate the CyclicBarrier in java.util.concurrent package.
* Here we are creating a barrier to an entry for a coding session.
* A minimum of three programmers are necessary to start the coding session.
*/
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
public class CodingDojo {