Module: CemAcpt::LoggingAsync

Included in:
RSpecUtils::Command, TestRunner::Runner
Defined in:
lib/cem_acpt/logging.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.async_debug(message, prefix = nil) ⇒ Object



272
273
274
275
# File 'lib/cem_acpt/logging.rb', line 272

def async_debug(message, prefix = nil)
  msg = prefix.nil? || prefix.empty? ? message : "#{prefix} #{message}"
  CemAcpt::Logging.logger.debug(msg)
end

.async_error(message, prefix = nil) ⇒ Object



287
288
289
290
# File 'lib/cem_acpt/logging.rb', line 287

def async_error(message, prefix = nil)
  msg = prefix.nil? || prefix.empty? ? message : "#{prefix} #{message}"
  CemAcpt::Logging.logger.error(msg)
end

.async_fatal(message, prefix = nil) ⇒ Object



292
293
294
295
# File 'lib/cem_acpt/logging.rb', line 292

def async_fatal(message, prefix = nil)
  msg = prefix.nil? || prefix.empty? ? message : "#{prefix} #{message}"
  CemAcpt::Logging.logger.fatal(msg)
end

.async_info(message, prefix = nil) ⇒ Object



277
278
279
280
# File 'lib/cem_acpt/logging.rb', line 277

def async_info(message, prefix = nil)
  msg = prefix.nil? || prefix.empty? ? message : "#{prefix} #{message}"
  CemAcpt::Logging.logger.info(msg)
end

.async_warn(message, prefix = nil) ⇒ Object



282
283
284
285
# File 'lib/cem_acpt/logging.rb', line 282

def async_warn(message, prefix = nil)
  msg = prefix.nil? || prefix.empty? ? message : "#{prefix} #{message}"
  CemAcpt::Logging.logger.warn(msg)
end

.included(base) ⇒ Object

Provides class method wrappers for logging methods



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/cem_acpt/logging.rb', line 299

def self.included(base)
  class << base
    def log_write_thread
      CemAcpt::LoggingAsync.log_write_thread
    end

    def async_debug(message, prefix = nil)
      CemAcpt::LoggingAsync.async_debug(message, prefix)
    end

    def async_info(message, prefix = nil)
      CemAcpt::LoggingAsync.async_info(message, prefix)
    end

    def async_warn(message, prefix = nil)
      CemAcpt::LoggingAsync.async_warn(message, prefix)
    end

    def async_error(message, prefix = nil)
      CemAcpt::LoggingAsync.async_error(message, prefix)
    end

    def async_fatal(message, prefix = nil)
      CemAcpt::LoggingAsync.async_fatal(message, prefix)
    end
  end
end

.log_write_threadObject



268
269
270
# File 'lib/cem_acpt/logging.rb', line 268

def log_write_thread
  @log_write_thread ||= Concurrent::SingleThreadExecutor.new
end

Instance Method Details

#async_debug(message, prefix = nil) ⇒ Object



331
332
333
# File 'lib/cem_acpt/logging.rb', line 331

def async_debug(message, prefix = nil)
  CemAcpt::LoggingAsync.async_debug(message, prefix)
end

#async_error(message, prefix = nil) ⇒ Object



343
344
345
# File 'lib/cem_acpt/logging.rb', line 343

def async_error(message, prefix = nil)
  CemAcpt::LoggingAsync.async_error(message, prefix)
end

#async_fatal(message, prefix = nil) ⇒ Object



347
348
349
# File 'lib/cem_acpt/logging.rb', line 347

def async_fatal(message, prefix = nil)
  CemAcpt::LoggingAsync.async_fatal(message, prefix)
end

#async_info(message, prefix = nil) ⇒ Object



335
336
337
# File 'lib/cem_acpt/logging.rb', line 335

def async_info(message, prefix = nil)
  CemAcpt::LoggingAsync.async_info(message, prefix)
end

#async_warn(message, prefix = nil) ⇒ Object



339
340
341
# File 'lib/cem_acpt/logging.rb', line 339

def async_warn(message, prefix = nil)
  CemAcpt::LoggingAsync.async_warn(message, prefix)
end

#log_write_threadObject



327
328
329
# File 'lib/cem_acpt/logging.rb', line 327

def log_write_thread
  CemAcpt::LoggingAsync.log_write_thread
end