Method: NicInfo::Config#configure_logger

Defined in:
lib/nicinfo/config.rb

#configure_loggerObject

Configures the logger



203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/nicinfo/config.rb', line 203

def configure_logger
  output = @config[ NicInfo::OUTPUT ]
  return if output == nil

  @logger.message_level = output[ NicInfo::MESSAGES ]
  @logger.validate_message_level

  messages_file = output[ NicInfo::MESSAGES_FILE ]
  if messages_file != nil
    @logger.message_out = File.open( messages_file, "w+" )
  end

  @logger.data_amount = output[ NicInfo::DATA ]
  @logger.validate_data_amount

  data_file = output[ NicInfo::DATA_FILE ]
  if data_file != nil
    @logger.data_out= File.open( data_file, "w+" )
  end

  @logger.pager=output[ NicInfo::PAGER ]
  @logger.auto_wrap=output[ NicInfo::AUTO_WRAP ]
  @logger.default_width=output[ NicInfo::DEFAULT_WIDTH ]
  @logger.detect_width=output[ NicInfo::DETECT_WIDTH ]

  @logger.color_scheme = output[ NicInfo::COLOR_SCHEME ]
  @logger.validate_color_scheme
end