From: nobu@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:78673] [Ruby trunk Bug#13040] syslog/logger uses "require 'logger'" which is interpreted as circular dependency
Date: Fri, 16 Dec 2016 01:15:13 +0000 [thread overview]
Message-ID: <redmine.journal-62051.20161216011512.4931c3e3ce6ddc15@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-13040.20161215191125@ruby-lang.org
Issue #13040 has been updated by Nobuyoshi Nakada.
'syslog/logger.rb' and 'logger.rb' are different files.
What do you mean by "test"?
----------------------------------------
Bug #13040: syslog/logger uses "require 'logger'" which is interpreted as circular dependency
https://bugs.ruby-lang.org/issues/13040#change-62051
* Author: Luis Mondesi
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
while using the 'syslog/logger' require from Ruby it works well, however if one tries to use it via "test" it complaints about circular require and the constant "Logger" not defined. After a little digging, I realized that 'syslog/logger' has a line that says require 'logger' which could mean itself!
The fix is to use require_relative '../logger' as this is what it intends in order to piggy back on Logger:
Current code for syslog/logger:
1. # frozen_string_literal: false
2. require 'syslog'
3. require 'logger'
Fixed code:
1. # frozen_string_literal: false
2. require 'syslog'
3. require_relative '../logger'
--
https://bugs.ruby-lang.org/
next prev parent reply other threads:[~2016-12-16 0:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-13040.20161215191125@ruby-lang.org>
2016-12-15 19:11 ` [ruby-core:78668] [Ruby trunk Bug#13040] syslog/logger uses "require 'logger'" which is interpreted as circular dependency lemsx1
2016-12-16 1:15 ` nobu [this message]
2016-12-16 1:15 ` [ruby-core:78674] [Ruby trunk Bug#13040][Feedback] " nobu
2016-12-20 2:33 ` [ruby-core:78733] [Ruby trunk Bug#13040] " lemsx1
2017-05-18 13:55 ` [ruby-core:81224] " lemsx1
2017-06-08 15:46 ` [ruby-core:81622] " lemsx1
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-62051.20161216011512.4931c3e3ce6ddc15@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).