Sha256: 59da10790e67edde7856d5e32f5ea00c6afb98a1a401add303ed8d4935b7f016
Contents?: true
Size: 1.19 KB
Versions: 59
Compression:
Stored size: 1.19 KB
Contents
require 'ansi' module Nutella module Framework module Log def self.debug(message, code=nil) puts( ANSI.cyan + message + ANSI.reset ) Nutella.f.net.publish( 'logging', log_to_json(message, code, __method__) ) code end def self.info(message, code=nil) puts( message ) Nutella.f.net.publish( 'logging', log_to_json(message, code, __method__) ) code end def self.success(message, code=nil) puts( ANSI.green + message + ANSI.reset ) Nutella.f.net.publish( 'logging', log_to_json(message, code, __method__) ) code end def self.warn(message, code=nil) puts( ANSI.yellow + message + ANSI.reset ) Nutella.f.net.publish( 'logging', log_to_json(message, code, __method__) ) code end def self.error(message, code=nil) puts( ANSI.red + message + ANSI.reset ) Nutella.f.net.publish( 'logging', log_to_json(message, code, __method__) ) code end private def self.log_to_json( message, code, level) code.nil? ? {level: level, message: message} : {level: level, message: message, code: code} end end end end
Version data entries
59 entries across 59 versions & 2 rubygems