Feature request: logger methods to return nil

Open
#3 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby
Domain
observability

Research direction

Start by reproducing the documented bin/console example and trace logger.info through Ecraft::LoggingLibrary::Loggable and the logger methods it delegates to. Confirm the expected behavior for debug and info, then verify that a log call prints its message while returning nil.

Written by the indexing model from the issue text.

Description

I would expect that the return value from using a logger method like debug or info would be nil.

The following example is from a bin/console session using the code example from the documentation. The return value from a log line being printed is a here list of logger outputters/formatters (not falsy).

2.4.0 :004 > Ecraft::LoggingLibrary
 => Ecraft::LoggingLibrary 
2.4.0 :005 > class MyClass
2.4.0 :006?>   include Ecraft::LoggingLibrary::Loggable
2.4.0 :007?>   def load_data_from_database
2.4.0 :008?>       logger.info('Starting to load data from database')
2.4.0 :009?>     end
2.4.0 :010?>   end
 => :load_data_from_database 
2.4.0 :011 > c=MyClass.new
 => #<MyClass:0x007ff8a38a19b8> 
2.4.0 :012 > c.load_data_from_database
INFO  [2017-01-25 17:55:37.617] MyClass: Starting to load data from database
 => [#<Logger:0x007ff8a284f538 @level=1, @progname="MyClass", @default_formatter=#<Logger::Formatter:0x007ff8a284f4e8 @datetime_format=nil>, @formatter=#<Ecraft::LoggingLibrary::CustomFormatter:0x007ff8a284f268 @datetime_format=nil>, @logdev=#<Logger::LogDevice:0x007ff8a284f470 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @mon_owner=nil, @mon_count=0, @mon_mutex=#<Thread::Mutex:0x007ff8a284f3f8>>>] 

Dominant language
Ruby
Stars
0
Forks
2
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ecraft/logging_library

All issues in ecraft/logging_library

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.