diff --git a/lib/Acho.coffee b/lib/Acho.coffee index 3d7b21c..e0b0bde 100644 --- a/lib/Acho.coffee +++ b/lib/Acho.coffee @@ -1,9 +1,8 @@ 'use strict' -chalk = require 'chalk' + DEFAULT = require './Default' CONST = require './Constants' -format = require 'format-util' existsAssign = require 'existential-assign' module.exports = (options = {}) -> @@ -29,18 +28,4 @@ module.exports = (options = {}) -> @push type, message this - acho.colorize = (colors, message) -> - return message if not @color or CONST.ENV is 'production' - colors = colors.split ' ' - stylize = chalk - stylize = stylize[color] for color in colors - stylize message - - acho.isPrintable = (type) -> - return true if @level is CONST.UNMUTED - return false if @level is CONST.MUTED - @types[type].level <= @types[@level].level - - acho.format = (messages) -> format.apply null, messages - acho diff --git a/lib/Default.coffee b/lib/Default.coffee index d039a91..57d6a17 100644 --- a/lib/Default.coffee +++ b/lib/Default.coffee @@ -1,7 +1,9 @@ 'use strict' -ms = require 'pretty-ms' -CONST = require './Constants' +chalk = require 'chalk' +ms = require 'pretty-ms' +CONST = require './Constants' +formatUtil = require 'format-util' module.exports = print: -> @@ -43,6 +45,20 @@ module.exports = @transport @generateMessage type, message this + colorize: (colors, message) -> + return message if not @color or CONST.ENV is 'production' + colors = colors.split ' ' + stylize = chalk + stylize = stylize[color] for color in colors + stylize message + + isPrintable: (type) -> + return true if @level is CONST.UNMUTED + return false if @level is CONST.MUTED + @types[type].level <= @types[@level].level + + format: (messages) -> formatUtil.apply null, messages + keyword: null diff: false align: true