Skip to content

Instantly share code, notes, and snippets.

@hotakasaito
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hotakasaito/2cd685bcaf527e5f7b20 to your computer and use it in GitHub Desktop.
Save hotakasaito/2cd685bcaf527e5f7b20 to your computer and use it in GitHub Desktop.
Celluloid::Loggerのerrorがthorのerrorに負ける ref: http://qiita.com/hotakasaito/items/3af13db980addab8152f
require 'thor'
require 'celluloid'
include Celluloid::Logger
Celluloid.logger = ::Logger.new("sample.log")
class SampleThor < Thor
desc "test", "sample"
def test
error "test"
end
end
SampleThor.start(ARGV)
Thor::Shell::Basic.class_eval do
def error(statement)
Celluloid.logger.error(statement) if Celluloid.logger
end
end
require 'thor'
require 'celluloid'
include Celluloid::Logger
Celluloid.logger = ::Logger.new("sample.log")
Thor::Shell::Basic.class_eval do
def error(statement)
Celluloid.logger.error(statement) if Celluloid.logger
end
end
class SampleThor < Thor
desc "test", "sample"
def test
error "test"
end
end
SampleThor.start(ARGV)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment