logify-0.2.0/0000755000175100017500000000000012733020064012022 5ustar mmollmmolllogify-0.2.0/spec/0000755000175100017500000000000012733020064012754 5ustar mmollmmolllogify-0.2.0/spec/unit/0000755000175100017500000000000012733020064013733 5ustar mmollmmolllogify-0.2.0/spec/unit/logify_spec.rb0000644000175100017500000000345412733020064016571 0ustar mmollmmollrequire 'spec_helper' module Logify describe do before { Logify.reset! } describe '.level & .level=' do it 'defaults to WARN' do expect(Logify.level).to eq(Logger::WARN) end it 'uses the level set in the main thread' do Logify.level = :fatal Thread.new { Logify.level = :warn }.join expect(Logify.level).to eq(Logger::FATAL) end it 'uses the level set in the current thread' do Logify.level = :fatal Thread.new do Logify.level = :debug expect(Logify.level).to eq(Logger::DEBUG) end.join # Make sure the parent thread isn't modified expect(Logify.level).to eq(Logger::FATAL) end it 'uses the level set in the main thread' do Logify.level = :fatal # Set the log level in another thread Thread.new { Logify.level }.join # Since Logify.level = :fatal was set in the main thread, # it should be the default moving forward Thread.new { expect(Logify.level).to eq(Logger::FATAL) }.join end end describe '.logger_for' do it 'uses a cached logger' do logger = double Logify.send(:loggers)['default'] = logger expect(Logify.logger_for('default')).to be(logger) end it 'creates a new logger when one does not exist' do Logger.stub(:new) expect(Logger).to receive(:new).with('default').once Logify.logger_for('default') end end describe '.included' do let(:klass) { Class.new { include Logify } } let(:instance) { klass.new } it 'includes the instances methods' do expect(klass).to respond_to(:log) end it 'includes the class methods' do expect(klass).to respond_to(:log) end end end end logify-0.2.0/spec/unit/logify/0000755000175100017500000000000012733020064015224 5ustar mmollmmolllogify-0.2.0/spec/unit/logify/logger_spec.rb0000644000175100017500000001625112733020064020047 0ustar mmollmmollrequire 'spec_helper' module Logify describe Logger do let(:io) { StringIO.new } let(:klass) { Class.new { include Logify } } let(:log) { klass.new.log } let(:stdout) { io.rewind && io.read } before do Logify.level = :debug Logify.io = io end it 'accepts a string parameter' do expect { log.debug 'An informative message' }.to_not raise_error expect(stdout).to include('An informative message') end it 'accepts a block parameter' do expect { log.debug { String.new('An informative message') } }.to_not raise_error expect(stdout).to include('An informative message') end context 'when the log level is :debug' do it 'pretty aligns parameters' do log.info 'Starting some command...' log.debug 'x = 0' log.debug 'y = 99' log.warn 'x is 0' log.error 'Cannot divide by 0' log.fatal 'Ruby segfaulted' expect(stdout).to include('| ===> Starting some command...') expect(stdout).to include('| x = 0') expect(stdout).to include('| y = 99') expect(stdout).to include('| **** x is 0') expect(stdout).to include('| >>>> Cannot divide by 0') expect(stdout).to include('| !!!! Ruby segfaulted') end context 'when the class is < MAX_LENGTH' do it 'uses the full class name' do klass.stub(:name).and_return('Hello::Kitty') log.debug 'Helpful info' expect(stdout).to include('Hello::Kitty | Helpful info') end end context 'when the class is MAX_LENGTH' do it 'uses the full class name' do klass.stub(:name).and_return('Hello::Kitty::Magical::Pony::Eye') log.debug 'Helpful info' expect(stdout).to include('Hello::Kitty::Magical::Pony::Eye | Helpful info') end end context 'when the class is > MAX_LENGTH' do it 'shortens the name by namespace' do klass.stub(:name).and_return('Hello::Kitty::Magical::Ponies::Eye') log.debug 'Helpful info' expect(stdout).to include('Kitty::Magical::Ponies::Eye | Helpful info') end it 'just pre-truncates long names' do klass.stub(:name).and_return('ReallyLongHelloKittyMagicalPoniesEye') log.debug 'Helpful info' expect(stdout).to include('gHelloKittyMagicalPoniesEye | Helpful info') end end end context 'when the log level is not :debug' do before { Logify.level = :info } it 'uses the shortened syntax' do log.info 'Starting some command...' log.debug 'x = 0' log.debug 'y = 99' log.warn 'x is 0' log.error 'Cannot divide by 0' log.fatal 'Ruby segfaulted' expect(stdout).to include('I: Starting some command') expect(stdout).to include('W: x is 0') expect(stdout).to include('E: Cannot divide by 0') expect(stdout).to include('F: Ruby segfaulted') end end context 'when the log level is :info' do before { Logify.level = :info } it 'does not print :debug messages' do log.debug 'This is a debug' expect(stdout).to_not include('This is a debug') end it 'prints :info messages' do log.info 'This is info' expect(stdout).to include('This is info') end it 'prints :warn messages' do log.warn 'This is a warn' expect(stdout).to include('This is a warn') end it 'prints :error messages' do log.error 'This is an error' expect(stdout).to include('This is an error') end it 'prints :fatal messages' do log.fatal 'This is a fatal' expect(stdout).to include('This is a fatal') end end context 'when the log level is :warn' do before { Logify.level = :warn } it 'does not print :debug messages' do log.debug 'This is a debug' expect(stdout).to_not include('This is a debug') end it 'does not print :info messages' do log.info 'This is info' expect(stdout).to_not include('This is info') end it 'prints :warn messages' do log.warn 'This is a warn' expect(stdout).to include('This is a warn') end it 'prints :error messages' do log.error 'This is an error' expect(stdout).to include('This is an error') end it 'prints :fatal messages' do log.fatal 'This is a fatal' expect(stdout).to include('This is a fatal') end end context 'when the log level is :error' do before { Logify.level = :error } it 'does not print :debug messages' do log.debug 'This is a debug' expect(stdout).to_not include('This is a debug') end it 'does not print :info messages' do log.info 'This is info' expect(stdout).to_not include('This is info') end it 'does not print :warn messages' do log.warn 'This is a warn' expect(stdout).to_not include('This is a warn') end it 'prints :error messages' do log.error 'This is an error' expect(stdout).to include('This is an error') end it 'prints :fatal messages' do log.fatal 'This is a fatal' expect(stdout).to include('This is a fatal') end end context 'when the log level is :fatal' do before { Logify.level = :fatal } it 'does not print :debug messages' do log.debug 'This is a debug' expect(stdout).to_not include('This is a debug') end it 'does not print :info messages' do log.info 'This is info' expect(stdout).to_not include('This is info') end it 'does not print :warn messages' do log.warn 'This is a warn' expect(stdout).to_not include('This is a warn') end it 'does not print :error messages' do log.error 'This is an error' expect(stdout).to_not include('This is an error') end it 'prints :fatal messages' do log.fatal 'This is a fatal' expect(stdout).to include('This is a fatal') end end context 'when the log level is :none' do before { Logify.level = :none } it 'does not print :debug messages' do log.debug 'This is a debug' expect(stdout).to_not include('This is a debug') end it 'does not print :info messages' do log.info 'This is info' expect(stdout).to_not include('This is info') end it 'does not print :warn messages' do log.warn 'This is a warn' expect(stdout).to_not include('This is a warn') end it 'does not print :error messages' do log.error 'This is an error' expect(stdout).to_not include('This is an error') end it 'does not print :fatal messages' do log.fatal 'This is a fatal' expect(stdout).to_not include('This is a fatal') end end context 'with filter params' do before { Logify.filter('bacon') } it 'filters the parameter' do log.info 'The password is bacon' expect(stdout).to include('The password is [FILTERED]') end end end end logify-0.2.0/spec/spec_helper.rb0000644000175100017500000000011412733020064015566 0ustar mmollmmoll$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'logify' logify-0.2.0/logify.gemspec0000644000175100017500000000252412733020064014663 0ustar mmollmmoll# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'logify/version' Gem::Specification.new do |spec| spec.name = 'logify' spec.version = Logify::VERSION spec.authors = ['Seth Vargo'] spec.email = ['sethvargo@gmail.com'] spec.summary = 'Logify is a lightweight logging library for Ruby!' spec.description = 'Logify is an incredibly light-weight Ruby logger ' \ 'with a developer-friendly API and no dependencies. ' \ 'It is intentionally very opinionated and is ' \ 'optimized for speed. This combination makes it ' \ 'perfect for command line applications.' spec.homepage = 'https://github.com/sethvargo/logify' spec.license = 'Apache 2.0' spec.required_ruby_version = '>= 1.9.3' spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] # Development dependencies spec.add_development_dependency 'rspec', '~> 2.14' spec.add_development_dependency 'bundler' spec.add_development_dependency 'rake' spec.add_development_dependency 'ruby-prof' end logify-0.2.0/lib/0000755000175100017500000000000012733020064012570 5ustar mmollmmolllogify-0.2.0/lib/logify/0000755000175100017500000000000012733020064014061 5ustar mmollmmolllogify-0.2.0/lib/logify/version.rb0000644000175100017500000000013612733020064016073 0ustar mmollmmollmodule Logify # # The Logify version # # @return [String] # VERSION = '0.2.0' end logify-0.2.0/lib/logify/logger.rb0000644000175100017500000000673412733020064015677 0ustar mmollmmollrequire 'monitor' module Logify class Logger class << self # # @private # # @macro level # @method $1(message = nil, &block) # Write a new $1 message to the current IO object. # # @example Write a +:$1+ message # log.$1 'This is a message' # # @example Write a lazy evaluated +:$1+ message # log.$1 { perform_complex_operation } # # @param [String] message # the message to log # @param [Proc] block # the block to call that returns a string to write # # @return [String] # the compiled log message # def level(name) constant = name.to_s.upcase class_eval <<-EOH, __FILE__, __LINE__ + 1 def #{name}(message = nil, &block) if Logify.level <= #{constant} buffer = '' if Logify.level == #{DEBUG} buffer << formatted_id buffer << SEPARATOR buffer << PREFIX_LONG_#{constant} else buffer << PREFIX_#{constant} end buffer << filter(message) if message buffer << filter(yield) if block_given? buffer << "#{NEWLINE}" MONITOR.synchronize { Logify.io.write(buffer) } buffer end end EOH end end ANONYMOUS = '(Anonymous)' FILTERED = '[FILTERED]' MAX_LENGTH = 32 NEWLINE = "\n" SEPARATOR = ' | ' MONITOR = Monitor.new NONE = 5 FATAL = 4 ERROR = 3 WARN = 2 INFO = 1 DEBUG = 0 DEFAULT = WARN LEVEL_MAP = { none: NONE, fatal: FATAL, error: ERROR, warn: WARN, info: INFO, debug: DEBUG, }.freeze PREFIX_FATAL = 'F: ' PREFIX_ERROR = 'E: ' PREFIX_WARN = 'W: ' PREFIX_INFO = 'I: ' PREFIX_DEBUG = 'D: ' PREFIX_LONG_FATAL = '!!!! ' PREFIX_LONG_ERROR = '>>>> ' PREFIX_LONG_WARN = '**** ' PREFIX_LONG_INFO = '===> ' PREFIX_LONG_DEBUG = ' ' level :fatal level :error level :warn level :info level :debug # # Create a new logger object. # # @param [String, nil] id # the ID of the logger object to create # def initialize(id) @id = id end private # # @private # # The truncated id (for debug only). # # @return [String] # the formatted id # def formatted_id return @formatted_id if @formatted_id # Account for anonymous classes id = @id ? @id.to_s : ANONYMOUS if id.length == MAX_LENGTH @formatted_id = id elsif id.length < MAX_LENGTH @formatted_id = id.rjust(MAX_LENGTH) else temp = id until temp.length <= MAX_LENGTH if temp.include?('::') temp = temp.split('::')[1..-1].join('::') else temp = id[-MAX_LENGTH..-1] end end @formatted_id = temp.rjust(MAX_LENGTH) end end # # @private # # Filter the given string of any filtered parameters. # # @see Logify.filter # # @param [String] # the string to filter # # @return [String] # the filtered string # def filter(string) string.dup.tap do |copy| Logify.filters.each do |param, _| copy.gsub!(param, FILTERED) end end end end end logify-0.2.0/lib/logify.rb0000644000175100017500000000561512733020064014415 0ustar mmollmmollrequire 'logify/logger' require 'logify/version' module Logify # @private LEVEL_ID = 'logify.level' # @private IO_ID = 'logify.io' class << self # @private def included(base) base.send(:extend, ClassMethods) base.send(:include, InstanceMethods) end # @private def logger_for(name) loggers[name] ||= Logger.new(name) end # # Reset the current loggers for all thread instances. # # @return [true] # def reset! Thread.list.each do |thread| thread[LEVEL_ID] = nil thread[IO_ID] = nil end loggers.clear true end # # The current log level. # # @return [Fixnum] # def level Thread.current[LEVEL_ID] || Thread.main[LEVEL_ID] || Logger::DEFAULT end # # Set the global log level. All loggers in the current thread will # immediately begin using this new log level. # # @example Setting the log level to +:fatal+ # Logify.level = :fatal # # @param [Symbol] id # the symbol id of the logger # # @return [Fixnum] # def level=(id) Thread.current[LEVEL_ID] = Logger::LEVEL_MAP.fetch(id, Logger::DEFAULT) end # # The IO stream to log to. Default: +$stdout+. # # @return [IO] # def io Thread.current[IO_ID] || Thread.main[IO_ID] || $stdout end # # Set the global io object. All loggers in the current thread will # immediately begin using this new IO stream. It is the user's # responsibility to manage this IO object (like rewinding and closing). # # @example Setting the outputter to +$stderr+ # Logify.io = $stderr # # @example Using an IO object # io = StringIO.new # Logify.io = io # # @param [IO] io # the IO object to output to # # @return [IO] # def io=(io) Thread.current[IO_ID] = io end # # Add a filter parameter to Logify. # # @example Filter a password in the logger # Logify.filter('P@s$w0r)') # log.debug "This is the P@s$w0r)" #=> "This is the [FILTERED]" # # @return [void] # def filter(param) filters[param] = nil end # # The list of filters for Logify. # # @return [Hash] # def filters @filters ||= {} end private # @private def loggers @loggers ||= {} end end # Class methods that get extended into any including object. module ClassMethods # # Write a message to the logger for this class. # # @return [Logger] # def log @log ||= Logify.logger_for(name) end end # Instance methods that get included into any including object. module InstanceMethods # # Write a message to the logger for this instance's class. # # @return [Logger] # def log @log ||= Logify.logger_for(self.class.name) end end end logify-0.2.0/Rakefile0000644000175100017500000000027712733020064013475 0ustar mmollmmollrequire 'bundler/setup' require 'bundler/gem_tasks' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:unit) namespace :travis do task :ci => [:unit] end task :default => [:unit] logify-0.2.0/README.md0000644000175100017500000001021312733020064013276 0ustar mmollmmollLogify ====== Logify is an incredibly light-weight Ruby logger with a developer-friendly API and no dependencies. It is intentionally very opinionated and is optimized for speed. This combination makes it perfect for command line applications. Logify does: - Support multithreading with inherited defaults - Provide a very pretty debug logger - Make logging fun again! Logify does not: - Depend on or inherit from Ruby's core `Logger` class - Manage the log device - if you wish to write your logs to a file, it is your responsibility to manage the file handler, rewind, etc. Usage ----- Simply include the `Logify` module in each class you want to log: ```ruby require 'logify' class MyClass include Logify end ``` This will expose a `log` method on both the class and instance: ```ruby MyClass.log 'This is a class log message!' instance = MyClass.new instance.log 'This is an instance log message!' ``` In debug mode, Logify is designed for developer happiness. Parameters are aligned, and visual queues are used to indicate status. The format is as follows: ```text MyClass | ===> Starting some command... MyClass | x = 0 MyClass | y = 99 MyClass | **** x is 0 MyClass | >>>> Cannot divide by 0 MyClass | !!!! Ruby segfaulted ``` Where the prefixes are: ```ruby FATAL #=> "!!!!" ERROR #=> ">>>>" WARN #=> "****" INFO #=> "===>" DEBUG #=> " " ``` Class names are automatically shortened if they exceed 32 characters. In non-debug mode, Logify is less chatty: ```text I: Starting some command W: x is 0 E: Cannot divide by 0 F: Ruby segfaulted ``` Where the letter corresponds to the log level: ```ruby FATAL #=> "F" ERROR #=> "E" WARN #=> "W" INFO #=> "I" ``` If you are anti-modules (or if you want to use `log` for something else), you can manually create your Logger object in an initializer: ```ruby require 'logify' class MyClass def initialize @logger = Logify.logger_for(self.class.name) # Or any custom name end end ``` And then use `@logger` to call your log methods: ```ruby def other_method @logger.info 'Running other_method' end ``` Configuring ----------- Logify is configurable via the top-level `Logify` module. Set the log level using symbol definitions: ```ruby Logify.level = :warn ``` Set the output object (io). It must respond to `<<`: ```ruby Logify.io = StringIO.new ``` The Logify module is thread-aware. Settings are inherited from the main thread. Changes to log levels in child threads are only persisted within the thread. ```ruby # Main thread configuration Logify.level = :warn Thread.new do # This will persist for the duration of this thread. # The main thread will continue to use :warn. Logify.level = :debug Thread.new do # The log level is _only_ inherited from the main thread. Logify.level #=> :warn end end ``` You can disable all logging by setting the `io` device to a null object: ```ruby class NullLogger def <<(*args); end end Logify.io = NullLogger.new ``` Or set the `log_level` to `:none`: ```ruby Logify.level = :none ``` If you are logging sensitive information (such as passwords and API keys), you can add that information as a filter to Logify. Logify will replace those values with "`[FILTERED]`" in logging output. ```ruby Logify.filter('P@s$w0r)') ``` Installation ------------ Add this line to your application's Gemfile: ```ruby gem 'logify' ``` And then execute: $ bundle Or install it yourself as: $ gem install logify Contributing ------------ 1. Fork it 1. Fix it 1. Test it 1. Pull Request it License & Authors ----------------- - Author: Seth Vargo () ```text Copyright 2014, Seth Vargo (sethvargo@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ``` logify-0.2.0/LICENSE0000644000175100017500000002512112733020064013030 0ustar mmollmmoll Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [YYYY] [Author] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. logify-0.2.0/Gemfile0000644000175100017500000000004612733020064013315 0ustar mmollmmollsource 'https://rubygems.org' gemspec logify-0.2.0/CHANGELOG.md0000644000175100017500000000030112733020064013625 0ustar mmollmmollLogify Changelog ================ v0.2.0 ------ - Document manual logger creation - Add filter parameters - `log` methods now return the yielded string v0.1.0 ------ - Initial public release logify-0.2.0/.travis.yml0000644000175100017500000000017512733020064014136 0ustar mmollmmollrvm: - 1.9.3 - 2.0.0 - 2.1 bundler_args: --jobs 7 branches: only: - master script: bundle exec rake travis:ci logify-0.2.0/.gitignore0000644000175100017500000000024112733020064014007 0ustar mmollmmoll*.gem *.rbc .bundle .config .rspec .yardoc Gemfile.lock InstalledFiles _yardoc coverage doc/ lib/bundler/man pkg rdoc spec/reports test/tmp test/version_tmp tmp