I am trying to create a simple logging solution for my program using ruby's built in logger function. At the moment, what I have is the initialization for the logger like this:
logger = Logger.new(logfile.log)
logger.level = 'DEBUG'
logger.datetime_format = '%Y-%m-%d %H:%M:%S'
undefined local variable or method 'logger'
logger is a local variable, which is only visible in the area where it was defined. Rename it to
@logger to make it be an instance variable which is stored inside the object and can be used from any of the object's methods.