text: "use strict";function Log(e){this.always=this,this.options=_.extend({},{color:!0,verbose:!1,debug:!1,outStream:process.stdout,grunt:null,maxCols:null,muted:!1},e),this.hasLogged=!1,this.verbose=new VerboseLog(this,!0),this.notverbose=new VerboseLog(this,!1),this.verbose.or=this.notverbose,this.notverbose.or=this.verbose,this.options.grunt&&(_.bindAll(this),_.bindAll(this.verbose),_.bindAll(this.notverbose))}function VerboseLog(e,n){this.always=e,this._isVerbose=n}function makeSmartAccessor(e,n){Object.defineProperty(Log.prototype,e,{enumerable:!0,configurable:!0,get:function(){return n?this.always._options[e]:this.always["_"+e]},set:function(t){n?this.always._options[e]=t:this.always["_"+e]=t}})}var util=require("util"),hooker=require("hooker"),colors=require("colors"),_=require("lodash");_.str=require("underscore.string"),_.mixin(_.str.exports());var logUtils=require("grunt-legacy-log-utils");exports.Log=Log,util.inherits(VerboseLog,Log),VerboseLog.prototype._write=function(){return Boolean(this.option("verbose"))===this._isVerbose?VerboseLog.super_.prototype._write.apply(this,arguments):void 0},makeSmartAccessor("options"),makeSmartAccessor("hasLogged"),makeSmartAccessor("muted",!0),Log.prototype.initColors=function(){this.option("no-color")&&(colors.mode="none",hooker.hook(console,"log",function(){var e=_.toArray(arguments);return hooker.filter(this,e.map(function(e){return"string"==typeof e?colors.stripColors(e):e}))}))},Log.prototype.option=function(e){if(this.options.grunt&&this.options.grunt.option)return this.options.grunt.option(e);var n=e.match(/^no-(.+)$/);return n?!this.options[n[1]]:this.options[e]},Log.prototype._markup=function(e){return e=e||"",e=e.replace(/(\s|^)_(\S|\S[\s\S]+?\S)_(?=[\s,.!?]|$)/g,"$1"+"$2".underline),e=e.replace(/(\s|^)\*(\S|\S[\s\S]+?\S)\*(?=[\s,.!?]|$)/g,"$1"+"$2".bold)},Log.prototype._format=function(e){return e=_.toArray(e),e.length>0&&(e[0]=String(e[0])),util.format.apply(util,e)},Log.prototype._write=function(e){this.muted||(this.hasLogged=!0,e=e||"",this.option("no-color")&&(e=colors.stripColors(e)),this.options.outStream.write(this._markup(e)))},Log.prototype._writeln=function(e){this._write((e||"")+"\n")},Log.prototype.write=function(){return this._write(this._format(arguments)),this},Log.prototype.writeln=function(){return this._writeln(this._format(arguments)),this},Log.prototype.warn=function(){var e=this._format(arguments);return arguments.length>0?this._writeln(">> ".red+_.trim(e).replace(/\n/g,"\n>> ".red)):this._writeln("ERROR".red),this},Log.prototype.error=function(){return this.options.grunt&&this.options.grunt.fail&&this.options.grunt.fail.errorcount++,this.warn.apply(this,arguments),this},Log.prototype.ok=function(){var e=this._format(arguments);return arguments.length>0?this._writeln(">> ".green+_.trim(e).replace(/\n/g,"\n>> ".green)):this._writeln("OK".green),this},Log.prototype.errorlns=function(){var e=this._format(arguments);return this.error(this.wraptext(this.options.maxCols||77,e)),this},Log.prototype.oklns=function(){var e=this._format(arguments);return this.ok(this.wraptext(this.options.maxCols||77,e)),this},Log.prototype.success=function(){var e=this._format(arguments);return this._writeln(e.green),this},Log.prototype.fail=function(){var e=this._format(arguments);return this._writeln(e.red),this},Log.prototype.header=function(){var e=this._format(arguments);return this.hasLogged&&this._writeln(),this._writeln(e.underline),this},Log.prototype.subhead=function(){var e=this._format(arguments);return this.hasLogged&&this._writeln(),this._writeln(e.bold),this},Log.prototype.debug=function(){var e=this._format(arguments);return this.option("debug")&&this._writeln("[D] "+e.magenta),this},Log.prototype.writetableln=function(e,n){return this._writeln(this.table(e,n)),this},Log.prototype.writelns=function(){var e=this._format(arguments);return this._writeln(this.wraptext(this.options.maxCols||80,e)),this},Log.prototype.writeflags=function(e,n){var t;return Array.isArray(e)?t=this.wordlist(e):"object"==typeof e&&e&&(t=this.wordlist(Object.keys(e).map(function(n){var t=e[n];return n+(t===!0?"":"="+JSON.stringify(t))}))),this._writeln((n||"Flags")+": "+(t||"(none)".cyan)),this},["wordlist","uncolor","wraptext","table"].forEach(function(e){Log.prototype[e]=exports[e]=logUtils[e]});