mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-12-22 21:32:10 +01:00
Added logger
This commit is contained in:
parent
ae8f2b8db2
commit
64cb6f1b47
1 changed files with 7 additions and 3 deletions
|
@ -5,8 +5,12 @@ var GitStats = require("../lib")
|
||||||
, Fs = require("fs")
|
, Fs = require("fs")
|
||||||
, AnsiParser = require("ansi-parser")
|
, AnsiParser = require("ansi-parser")
|
||||||
, Couleurs = require("couleurs")()
|
, Couleurs = require("couleurs")()
|
||||||
|
, Logger = require("bug-killer")
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Logger.config.displayDate = false;
|
||||||
|
Logger.config.logLevel = 4;
|
||||||
|
|
||||||
const THEMES = {
|
const THEMES = {
|
||||||
DARK: {
|
DARK: {
|
||||||
background: "#11181F"
|
background: "#11181F"
|
||||||
|
@ -42,18 +46,18 @@ switch (process.argv[2]) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
GitStats.record(data, function (err) {
|
GitStats.record(data, function (err) {
|
||||||
if (err) { throw err; }
|
if (err) { return Logger.log(err, "error"); }
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "--help":
|
case "--help":
|
||||||
console.log(Fs.readFileSync("./docs/help"));
|
console.log(Fs.readFileSync("./docs/help", "utf-8"));
|
||||||
break;
|
break;
|
||||||
case "-v":
|
case "-v":
|
||||||
console.log(require("../package.json").version);
|
console.log(require("../package.json").version);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
GitStats.ansiCalendar(function (err, data) {
|
GitStats.ansiCalendar(function (err, data) {
|
||||||
if (err) throw err;
|
if (err) { return Logger.log(err, "error"); }
|
||||||
data = AnsiParser.removeAnsi(data);
|
data = AnsiParser.removeAnsi(data);
|
||||||
if (process.argv.indexOf("--no-ansi") === -1) {
|
if (process.argv.indexOf("--no-ansi") === -1) {
|
||||||
var theme = THEMES.DARK
|
var theme = THEMES.DARK
|
||||||
|
|
Loading…
Reference in a new issue