mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
Don't hang on to the first Logger instance you see
If the main app instance hangs on to the logger that ::Middleman::Logger.singleton returns, then subsequent calls to re-init the logger won't have any effect (for instance, when setting up the preview server's logger based on CLI params). Redefining logger to be a pass-through to ::Middleman::Logger.singleton instead of an ivar seems more in keeping with the sprit of a singleton, anyways. This fixes an issue where running `middleman server --verbose` doesn't output any debug info.
This commit is contained in:
parent
fac4928d50
commit
d4d1391bbb
1 changed files with 3 additions and 2 deletions
|
@ -149,7 +149,9 @@ module Middleman
|
||||||
include Middleman::CoreExtensions::ExternalHelpers
|
include Middleman::CoreExtensions::ExternalHelpers
|
||||||
|
|
||||||
# Reference to Logger singleton
|
# Reference to Logger singleton
|
||||||
attr_reader :logger
|
def logger
|
||||||
|
::Middleman::Logger.singleton
|
||||||
|
end
|
||||||
|
|
||||||
# New container for config.rb commands
|
# New container for config.rb commands
|
||||||
attr_reader :config_context
|
attr_reader :config_context
|
||||||
|
@ -167,7 +169,6 @@ module Middleman
|
||||||
|
|
||||||
# Initialize the Middleman project
|
# Initialize the Middleman project
|
||||||
def initialize(&block)
|
def initialize(&block)
|
||||||
@logger = ::Middleman::Logger.singleton
|
|
||||||
@template_context_class = Class.new(Middleman::TemplateContext)
|
@template_context_class = Class.new(Middleman::TemplateContext)
|
||||||
@generic_template_context = @template_context_class.new(self)
|
@generic_template_context = @template_context_class.new(self)
|
||||||
@config_context = ConfigContext.new(self, @template_context_class)
|
@config_context = ConfigContext.new(self, @template_context_class)
|
||||||
|
|
Loading…
Reference in a new issue