M
Minkoo Seo
Hi group.
I got a question on Marshal::dump and Logger. I've been used @logger
which contains Logger.new to log message to STDOUT like:
class Foo
def initialize
@logger = Logger.new(STDOUT)
end
def bar
@logger.info(...)
end
end
Unfortunately, Marshal::dump does not allow me to add such instance
variables and raises an error if such one exists.
That being the case, how can I add logger instance to a class w/o
hampering marshalling? Is there any design pattern that I can use?
Sincerely,
Minkoo Seo
I got a question on Marshal::dump and Logger. I've been used @logger
which contains Logger.new to log message to STDOUT like:
class Foo
def initialize
@logger = Logger.new(STDOUT)
end
def bar
@logger.info(...)
end
end
Unfortunately, Marshal::dump does not allow me to add such instance
variables and raises an error if such one exists.
That being the case, how can I add logger instance to a class w/o
hampering marshalling? Is there any design pattern that I can use?
Sincerely,
Minkoo Seo