@compodoc/ngd-core
Advanced tools
Comparing version 2.0.0-alpha.3 to 2.0.0
@@ -7,2 +7,3 @@ export declare class Logger { | ||
constructor(); | ||
setVerbose(level: boolean): void; | ||
title(...args: any[]): void; | ||
@@ -9,0 +10,0 @@ info(...args: any[]): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var gutil = require('gulp-util'); | ||
var c = gutil.colors; | ||
var c = require('ansi-colors'); | ||
var pkg = require('../../package.json'); | ||
var fancyLog = require('fancy-log'); | ||
var LEVEL; | ||
@@ -14,9 +14,12 @@ (function (LEVEL) { | ||
})(LEVEL || (LEVEL = {})); | ||
var Logger = (function () { | ||
var Logger = /** @class */ (function () { | ||
function Logger() { | ||
this.name = pkg.name; | ||
this.version = pkg.version; | ||
this.logger = gutil.log; | ||
this.silent = true; | ||
this.logger = fancyLog; | ||
this.silent = false; | ||
} | ||
Logger.prototype.setVerbose = function (level) { | ||
this.silent = level; | ||
}; | ||
Logger.prototype.title = function () { | ||
@@ -27,5 +30,5 @@ var args = []; | ||
} | ||
if (!this.silent) | ||
return; | ||
this.logger(c.cyan.apply(c, args)); | ||
if (this.silent == false) { | ||
this.logger(c.cyan.apply(c, args)); | ||
} | ||
}; | ||
@@ -37,5 +40,5 @@ Logger.prototype.info = function () { | ||
} | ||
if (!this.silent) | ||
return; | ||
this.logger(this.format.apply(this, [LEVEL.INFO].concat(args))); | ||
if (this.silent == false) { | ||
this.logger(this.format.apply(this, [LEVEL.INFO].concat(args))); | ||
} | ||
}; | ||
@@ -47,5 +50,5 @@ Logger.prototype.warn = function () { | ||
} | ||
if (!this.silent) | ||
return; | ||
this.logger(this.format.apply(this, [LEVEL.WARN].concat(args))); | ||
if (this.silent == false) { | ||
this.logger(this.format.apply(this, [LEVEL.WARN].concat(args))); | ||
} | ||
}; | ||
@@ -57,5 +60,5 @@ Logger.prototype.error = function () { | ||
} | ||
if (!this.silent) | ||
return; | ||
this.logger(this.format.apply(this, [LEVEL.FATAL].concat(args))); | ||
if (this.silent == false) { | ||
this.logger(this.format.apply(this, [LEVEL.FATAL].concat(args))); | ||
} | ||
}; | ||
@@ -67,5 +70,5 @@ Logger.prototype.fatal = function () { | ||
} | ||
if (!this.silent) | ||
return; | ||
this.error.apply(this, args); | ||
if (this.silent == false) { | ||
this.error.apply(this, args); | ||
} | ||
}; | ||
@@ -77,5 +80,5 @@ Logger.prototype.debug = function () { | ||
} | ||
if (!this.silent) | ||
return; | ||
this.logger(this.format.apply(this, [LEVEL.DEBUG].concat(args))); | ||
if (this.silent == false) { | ||
this.logger(this.format.apply(this, [LEVEL.DEBUG].concat(args))); | ||
} | ||
}; | ||
@@ -82,0 +85,0 @@ Logger.prototype.trace = function (error, file) { |
{ | ||
"name": "@compodoc/ngd-core", | ||
"version": "2.0.0-alpha.3", | ||
"version": "2.0.0", | ||
"description": "A core library for @compodoc/ngd", | ||
@@ -30,3 +30,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"gulp-util": "^3.0.8", | ||
"ansi-colors": "^1.0.1", | ||
"fancy-log": "^1.3.2", | ||
"typescript": "^2.4.2" | ||
@@ -33,0 +34,0 @@ }, |
@@ -1,4 +0,4 @@ | ||
let gutil = require('gulp-util'); | ||
let c = gutil.colors; | ||
let c = require('ansi-colors'); | ||
let pkg = require('../../package.json'); | ||
const fancyLog = require('fancy-log'); | ||
@@ -22,44 +22,54 @@ enum LEVEL { | ||
this.version = pkg.version; | ||
this.logger = gutil.log; | ||
this.silent = true; | ||
} | ||
this.logger = fancyLog; | ||
this.silent = false; | ||
} | ||
setVerbose(level: boolean) { | ||
this.silent = level; | ||
} | ||
title(...args) { | ||
if(!this.silent) return; | ||
this.logger( | ||
c.cyan(...args) | ||
); | ||
if(this.silent == false) { | ||
this.logger( | ||
c.cyan(...args) | ||
); | ||
} | ||
} | ||
info(...args) { | ||
if(!this.silent) return; | ||
this.logger( | ||
this.format(LEVEL.INFO, ...args) | ||
); | ||
if(this.silent == false) { | ||
this.logger( | ||
this.format(LEVEL.INFO, ...args) | ||
); | ||
} | ||
} | ||
warn(...args) { | ||
if(!this.silent) return; | ||
this.logger( | ||
this.format(LEVEL.WARN, ...args) | ||
); | ||
if(this.silent == false) { | ||
this.logger( | ||
this.format(LEVEL.WARN, ...args) | ||
); | ||
} | ||
} | ||
error(...args) { | ||
if(!this.silent) return; | ||
this.logger( | ||
this.format(LEVEL.FATAL, ...args) | ||
); | ||
if(this.silent == false) { | ||
this.logger( | ||
this.format(LEVEL.FATAL, ...args) | ||
); | ||
} | ||
} | ||
fatal(...args) { | ||
if(!this.silent) return; | ||
this.error(...args); | ||
} | ||
if(this.silent == false) { | ||
this.error(...args); | ||
} | ||
} | ||
debug(...args) { | ||
if(!this.silent) return; | ||
this.logger( | ||
this.format(LEVEL.DEBUG, ...args) | ||
); | ||
if(this.silent == false) { | ||
this.logger( | ||
this.format(LEVEL.DEBUG, ...args) | ||
); | ||
} | ||
} | ||
@@ -66,0 +76,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
415
0
23288
3
+ Addedansi-colors@^1.0.1
+ Addedfancy-log@^1.3.2
+ Addedansi-colors@1.1.0(transitive)
- Removedgulp-util@^3.0.8
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedarray-differ@1.0.0(transitive)
- Removedarray-uniq@1.0.3(transitive)
- Removedbeeper@1.1.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedclone@1.0.4(transitive)
- Removedclone-stats@0.0.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddateformat@2.2.0(transitive)
- Removedduplexer2@0.0.2(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedglogg@1.0.2(transitive)
- Removedgulp-util@3.0.8(transitive)
- Removedgulplog@1.0.0(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhas-gulplog@0.1.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedisarray@0.0.11.0.0(transitive)
- Removedlodash._basecopy@3.0.1(transitive)
- Removedlodash._basetostring@3.0.1(transitive)
- Removedlodash._basevalues@3.0.0(transitive)
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash._isiterateecall@3.0.9(transitive)
- Removedlodash._reescape@3.0.0(transitive)
- Removedlodash._reevaluate@3.0.0(transitive)
- Removedlodash._reinterpolate@3.0.0(transitive)
- Removedlodash._root@3.0.1(transitive)
- Removedlodash.escape@3.2.0(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedlodash.restparam@3.6.1(transitive)
- Removedlodash.template@3.6.2(transitive)
- Removedlodash.templatesettings@3.1.1(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmultipipe@0.1.2(transitive)
- Removedobject-assign@3.0.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@1.1.142.3.8(transitive)
- Removedreplace-ext@0.0.1(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsparkles@1.0.1(transitive)
- Removedstring_decoder@0.10.311.1.1(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedthrough2@2.0.5(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedvinyl@0.5.3(transitive)
- Removedxtend@4.0.2(transitive)