This commit is contained in:
Philipp Kunz 2015-11-15 06:15:20 +01:00
parent fd5f02d6c7
commit be71cdb472
18 changed files with 193 additions and 42 deletions

View File

@ -1,15 +1,46 @@
/// <reference path="./index.ts" /> /// <reference path="./index.ts" />
var ConsoleTable = (function () {
function ConsoleTable(tableType) {
switch (tableType) {
case "checks":
this.tableHead = ['Check Item:'.cyan, 'Status:'.cyan];
break;
default:
break;
}
this.rows = [];
this.type = tableType;
}
ConsoleTable.prototype.push = function (row) {
this.rows.push(row);
};
ConsoleTable.prototype.print = function () {
var table = new BeautylogOsTable.cliTable({
head: this.tableHead,
colWidths: [20, 20]
});
for (var row in this.rows) {
if (this.rows[row][1] == "success") {
this.rows[row][1] = ' '.bgGreen + ' ' + this.rows[row][1];
}
else if (this.rows[row][1] == "error") {
this.rows[row][1] = ' '.bgRed + ' ' + this.rows[row][1];
}
table.push(this.rows[row]);
}
;
console.log(table.toString());
};
return ConsoleTable;
})();
/// <reference path="./index.ts" />
var BeautylogOS; var BeautylogOS;
(function (BeautylogOS) { (function (BeautylogOS) {
function init() { function init() {
var colors = require("colors"); var colors = require("colors");
var clc = require("cli-color"); var clc = require("cli-color");
var beautylogOS = {}; var beautylogOS = {}; //object to append to all public facing functions
/** var localBl; // object to append to all private params and functions
* object to append to all locally used params
* @type {{}}
*/
var localBl;
localBl = {}; localBl = {};
localBl.dirPrefix = clc.bgXterm(39).xterm(231).bold(' DIR ') + ' '; localBl.dirPrefix = clc.bgXterm(39).xterm(231).bold(' DIR ') + ' ';
localBl.errorPrefix = ' Error: '.bgRed.white.bold + ' '; localBl.errorPrefix = ' Error: '.bgRed.white.bold + ' ';
@ -110,11 +141,26 @@ var BeautylogOS;
beautylogOS.warn = function (logText) { beautylogOS.warn = function (logText) {
return beautylogOS.log(logText, 'warn'); return beautylogOS.log(logText, 'warn');
}; };
beautylogOS.table = BeautylogOsTable.init();
return beautylogOS; return beautylogOS;
} }
BeautylogOS.init = init; BeautylogOS.init = init;
})(BeautylogOS || (BeautylogOS = {})); })(BeautylogOS || (BeautylogOS = {}));
/// <reference path="./index.ts" /> /// <reference path="./index.ts" />
var BeautylogOsTable;
(function (BeautylogOsTable) {
function init() {
BeautylogOsTable.cliTable = require("cli-table2");
var beautylogOsTable = {};
beautylogOsTable.new = function (type) {
var newConsoleTable = new ConsoleTable(type);
return newConsoleTable;
};
return beautylogOsTable;
}
BeautylogOsTable.init = init;
})(BeautylogOsTable || (BeautylogOsTable = {}));
/// <reference path="./index.ts" />
var BeautylogBrowser; var BeautylogBrowser;
(function (BeautylogBrowser) { (function (BeautylogBrowser) {
function init() { function init() {
@ -139,8 +185,10 @@ var BeautylogBrowser;
BeautylogBrowser.init = init; BeautylogBrowser.init = init;
})(BeautylogBrowser || (BeautylogBrowser = {})); })(BeautylogBrowser || (BeautylogBrowser = {}));
/// <reference path="./typings/tsd.d.ts" /> /// <reference path="./typings/tsd.d.ts" />
/// <reference path="./console.os.ts" /> /// <reference path="./beautylog.classes.ts" />
/// <reference path="./console.browser.ts" /> /// <reference path="./beautylog.os.ts" />
/// <reference path="./beautylog.os.table.ts" />
/// <reference path="./beautylog.browser.ts" />
var beautylog = function (logPlatform) { var beautylog = function (logPlatform) {
if (logPlatform === void 0) { logPlatform = "os"; } if (logPlatform === void 0) { logPlatform = "os"; }
switch (logPlatform) { switch (logPlatform) {

View File

@ -25,6 +25,7 @@
"homepage": "https://github.com/pushrocks/beautylog", "homepage": "https://github.com/pushrocks/beautylog",
"dependencies": { "dependencies": {
"cli-color": "^1.1.0", "cli-color": "^1.1.0",
"cli-table2": "^0.1.9",
"colors": "1.1.2" "colors": "1.1.2"
} }
} }

14
test.js
View File

@ -1,7 +1,7 @@
/// <reference path="./typings/tsd.d.ts" /> /// <reference path="./typings/tsd.d.ts" />
var beautyLogOs = require('./index.js')("os"); var beautyLogOs = require('./index.js')("os");
var beautyLogBrowser = require("./index.js")("browser"); var beautyLogBrowser = require("./index.js")("browser");
console.log('*** start test ***'); console.log('*** start OS console test ***');
console.log(''); console.log('');
console.log('declarative function calls:'); console.log('declarative function calls:');
beautyLogOs.log('beautylog.log(), with normal logText, without logType'); beautyLogOs.log('beautylog.log(), with normal logText, without logType');
@ -21,6 +21,14 @@ beautyLogOs.log('beautylog.log(), with normal logText, with logType "ok"', 'ok')
beautyLogOs.log('beautylog.log(), with normal logText, with logType "success"', 'success'); beautyLogOs.log('beautylog.log(), with normal logText, with logType "success"', 'success');
beautyLogOs.log('beautylog.log(), with normal logText, with logType "warn"', 'warn'); beautyLogOs.log('beautylog.log(), with normal logText, with logType "warn"', 'warn');
console.log(''); console.log('');
console.log('*** end test ***'); console.log('*** end OS console test ***');
console.log("start test of beautylog browser module (Might look weird in is console...)"); console.log("*** start browser console test (Might look weird in OS console and travis log...) ***");
beautyLogBrowser.log("hello"); beautyLogBrowser.log("hello");
console.log("*** end browser console test ***");
console.log("*** start table test ***");
var testTable = beautyLogOs.table.new("checks");
testTable.push(['check1', 'success']);
testTable.push(['check2', 'error']);
testTable.push(['check3', 'error']);
testTable.print();
console.log("*** end table test ***");

View File

@ -1,9 +1,35 @@
/// <reference path="./index.ts" /> /// <reference path="./index.ts" />
var ConsoleTable = (function () { var ConsoleTable = (function () {
function ConsoleTable() { function ConsoleTable(tableType) {
switch (tableType) {
case "checks":
this.tableHead = ['Check Item:'.cyan, 'Status:'.cyan];
break;
default:
break;
} }
this.rows = [];
this.type = tableType;
}
ConsoleTable.prototype.push = function (row) {
this.rows.push(row);
};
ConsoleTable.prototype.print = function () { ConsoleTable.prototype.print = function () {
alert(this.name + " moved " + meters + "m."); var table = new BeautylogOsTable.cliTable({
head: this.tableHead,
colWidths: [20, 20]
});
for (var row in this.rows) {
if (this.rows[row][1] == "success") {
this.rows[row][1] = ' '.bgGreen + ' ' + this.rows[row][1];
}
else if (this.rows[row][1] == "error") {
this.rows[row][1] = ' '.bgRed + ' ' + this.rows[row][1];
}
table.push(this.rows[row]);
}
;
console.log(table.toString());
}; };
return ConsoleTable; return ConsoleTable;
})(); })();

View File

@ -1 +1 @@
{"version":3,"file":"beautylog.classes.js","sourceRoot":"","sources":["beautylog.classes.ts"],"names":["ConsoleTable","ConsoleTable.constructor","ConsoleTable.print"],"mappings":"AAAA,mCAAmC;AACnC;IAEIA;IAAeC,CAACA;IAChBD,4BAAKA,GAALA;QACIE,KAAKA,CAACA,IAAIA,CAACA,IAAIA,GAAGA,SAASA,GAAGA,MAAMA,GAAGA,IAAIA,CAACA,CAACA;IACjDA,CAACA;IACLF,mBAACA;AAADA,CAACA,AAND,IAMC"} {"version":3,"file":"beautylog.classes.js","sourceRoot":"","sources":["beautylog.classes.ts"],"names":["ConsoleTable","ConsoleTable.constructor","ConsoleTable.push","ConsoleTable.print"],"mappings":"AAAA,mCAAmC;AAEnC;IAIIA,sBAAYA,SAAgBA;QACxBC,MAAMA,CAACA,CAACA,SAASA,CAACA,CAACA,CAACA;YAChBA,KAAKA,QAAQA;gBACTA,IAAIA,CAACA,SAASA,GAAGA,CAACA,aAAaA,CAACA,IAAIA,EAACA,SAASA,CAACA,IAAIA,CAACA,CAACA;gBACrDA,KAAKA,CAACA;YACVA;gBACIA,KAAKA,CAACA;QACdA,CAACA;QACDA,IAAIA,CAACA,IAAIA,GAAGA,EAAEA,CAACA;QACfA,IAAIA,CAACA,IAAIA,GAAGA,SAASA,CAACA;IAC1BA,CAACA;IACDD,2BAAIA,GAAJA,UAAKA,GAAYA;QACbE,IAAIA,CAACA,IAAIA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACxBA,CAACA;IACDF,4BAAKA,GAALA;QACIG,IAAIA,KAAKA,GAAGA,IAAIA,gBAAgBA,CAACA,QAAQA,CAACA;YACtCA,IAAIA,EAAEA,IAAIA,CAACA,SAASA;YACpBA,SAASA,EAAEA,CAACA,EAAEA,EAAEA,EAAEA,CAACA;SACtBA,CAACA,CAACA;QACHA,GAAGA,CAACA,CAACA,GAAGA,CAACA,GAAGA,IAAIA,IAAIA,CAACA,IAAIA,CAACA,CAAAA,CAACA;YACvBA,EAAEA,CAAAA,CAACA,IAAIA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,IAAIA,SAASA,CAACA,CAAAA,CAACA;gBAC/BA,IAAIA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,GAAGA,GAAGA,CAACA,OAAOA,GAAGA,GAAGA,GAAGA,IAAIA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;YAC9DA,CAACA;YAACA,IAAIA,CAACA,EAAEA,CAACA,CAACA,IAAIA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,IAAIA,OAAOA,CAACA,CAACA,CAACA;gBACtCA,IAAIA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,GAAGA,GAAGA,CAACA,KAAKA,GAAGA,GAAGA,GAAGA,IAAIA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;YAC5DA,CAACA;YACDA,KAAKA,CAACA,IAAIA,CAACA,IAAIA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA;QAC/BA,CAACA;QAAAA,CAACA;QACFA,OAAOA,CAACA,GAAGA,CAACA,KAAKA,CAACA,QAAQA,EAAEA,CAACA,CAACA;IAClCA,CAACA;IACLH,mBAACA;AAADA,CAACA,AAjCD,IAiCC"}

View File

@ -1,8 +1,36 @@
/// <reference path="./index.ts" /> /// <reference path="./index.ts" />
class ConsoleTable { class ConsoleTable {
rows:[]; tableHead:string[];
constructor() {} rows;
type:string;
constructor(tableType:string) {
switch (tableType) {
case "checks":
this.tableHead = ['Check Item:'.cyan,'Status:'.cyan];
break;
default:
break;
}
this.rows = [];
this.type = tableType;
}
push(row:string[]){
this.rows.push(row);
}
print() { print() {
alert(this.name + " moved " + meters + "m."); var table = new BeautylogOsTable.cliTable({
head: this.tableHead,
colWidths: [20, 20]
});
for (var row in this.rows){
if(this.rows[row][1] == "success"){
this.rows[row][1] = ' '.bgGreen + ' ' + this.rows[row][1];
} else if (this.rows[row][1] == "error") {
this.rows[row][1] = ' '.bgRed + ' ' + this.rows[row][1];
}
table.push(this.rows[row]);
};
console.log(table.toString());
} }
} }

View File

@ -4,12 +4,8 @@ var BeautylogOS;
function init() { function init() {
var colors = require("colors"); var colors = require("colors");
var clc = require("cli-color"); var clc = require("cli-color");
var beautylogOS = {}; var beautylogOS = {}; //object to append to all public facing functions
/** var localBl; // object to append to all private params and functions
* object to append to all locally used params
* @type {{}}
*/
var localBl;
localBl = {}; localBl = {};
localBl.dirPrefix = clc.bgXterm(39).xterm(231).bold(' DIR ') + ' '; localBl.dirPrefix = clc.bgXterm(39).xterm(231).bold(' DIR ') + ' ';
localBl.errorPrefix = ' Error: '.bgRed.white.bold + ' '; localBl.errorPrefix = ' Error: '.bgRed.white.bold + ' ';
@ -110,6 +106,7 @@ var BeautylogOS;
beautylogOS.warn = function (logText) { beautylogOS.warn = function (logText) {
return beautylogOS.log(logText, 'warn'); return beautylogOS.log(logText, 'warn');
}; };
beautylogOS.table = BeautylogOsTable.init();
return beautylogOS; return beautylogOS;
} }
BeautylogOS.init = init; BeautylogOS.init = init;

View File

@ -1 +1 @@
{"version":3,"file":"beautylog.os.js","sourceRoot":"","sources":["beautylog.os.ts"],"names":["BeautylogOS","BeautylogOS.init"],"mappings":"AAAA,mCAAmC;AACnC,IAAO,WAAW,CA0HjB;AA1HD,WAAO,WAAW,EAAC,CAAC;IAChBA;QACIC,IAAIA,MAAMA,GAAGA,OAAOA,CAACA,QAAQA,CAACA,CAACA;QAC/BA,IAAIA,GAAGA,GAAGA,OAAOA,CAACA,WAAWA,CAACA,CAACA;QAE/BA,IAAIA,WAAWA,GAAOA,EAAEA,CAACA;QACzBA;;;WAGGA;QACHA,IAAIA,OAAWA,CAACA;QAChBA,OAAOA,GAAGA,EAAEA,CAACA;QACbA,OAAOA,CAACA,SAASA,GAAGA,GAAGA,CAACA,OAAOA,CAACA,EA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AACA;gBACvGA,MAAMA,CAACA,KAAKA,CAACA;YACjBA,CAACA;QACLA,CAACA,CAACA;QAIFA;;;;WAIGA;QACHA,WAAWA,CAACA,GAAGA,GAAGA,UAASA,OAAOA;YAC9B,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC3C,CAAC,CAACA;QAGFA;;;;WAIGA;QACHA,WAAWA,CAACA,KAAKA,GAAGA,UAASA,OAAOA;YAChC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7C,CAAC,CAACA;QAEFA;;;;WAIGA;QACHA,WAAWA,CAACA,IAAIA,GAAGA,UAASA,OAAOA;YAC/B,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC5C,CAAC,CAACA;QAEFA;;;;WAIGA;QACHA,WAAWA,CAACA,EAAEA,GAAGA,UAASA,OAAOA;YAC7B,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1C,CAAC,CAACA;QAEFA;;;;WAIGA;QACHA,WAAWA,CAACA,OAAOA,GAAGA,UAASA,OAAOA;YAClC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC/C,CAAC,CAACA;QAEFA;;;;WAIGA;QACHA,WAAWA,CAACA,IAAIA,GAAGA,UAASA,OAAOA;YAC/B,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC5C,CAAC,CAACA;QAEFA,MAAMA,CAACA,WAAWA,CAACA;IACvBA,CAACA;IAxHeD,gBAAIA,OAwHnBA,CAAAA;AACLA,CAACA,EA1HM,WAAW,KAAX,WAAW,QA0HjB"} {"version":3,"file":"beautylog.os.js","sourceRoot":"","sources":["beautylog.os.ts"],"names":["BeautylogOS","BeautylogOS.init"],"mappings":"AAA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AC;QAC/C,CAAC,CAACA;QAEFA;;;;WAIGA;QACHA,WAAWA,CAACA,IAAIA,GAAGA,UAASA,OAAOA;YAC/B,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC5C,CAAC,CAACA;QAEFA,WAAWA,CAACA,KAAKA,GAAGA,gBAAgBA,CAACA,IAAIA,EAAEA,CAACA;QAE5CA,MAAMA,CAACA,WAAWA,CAACA;IACvBA,CAACA;IAvHeD,gBAAIA,OAuHnBA,CAAAA;AACLA,CAACA,EAzHM,WAAW,KAAX,WAAW,QAyHjB"}

View File

@ -1 +1,15 @@
/// <reference path="./index.ts" />
var BeautylogOsTable;
(function (BeautylogOsTable) {
function init() {
BeautylogOsTable.cliTable = require("cli-table2");
var beautylogOsTable = {};
beautylogOsTable.new = function (type) {
var newConsoleTable = new ConsoleTable(type);
return newConsoleTable;
};
return beautylogOsTable;
}
BeautylogOsTable.init = init;
})(BeautylogOsTable || (BeautylogOsTable = {}));
//# sourceMappingURL=beautylog.os.table.js.map //# sourceMappingURL=beautylog.os.table.js.map

View File

@ -1 +1 @@
{"version":3,"file":"beautylog.os.table.js","sourceRoot":"","sources":["beautylog.os.table.ts"],"names":[],"mappings":"AAEC"} {"version":3,"file":"beautylog.os.table.js","sourceRoot":"","sources":["beautylog.os.table.ts"],"names":["BeautylogOsTable","BeautylogOsTable.init"],"mappings":"AAAA,mCAAmC;AACnC,IAAO,gBAAgB,CAYtB;AAZD,WAAO,gBAAgB,EAAC,CAAC;IAErBA;QACIC,yBAAQA,GAAIA,OAAOA,CAACA,YAAYA,CAACA,CAACA;QAClCA,IAAIA,gBAAgBA,GAAOA,EAAEA,CAACA;QAE9BA,gBAAgBA,CAACA,GAAGA,GAAGA,UAASA,IAAWA;YACvC,IAAI,eAAe,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;YAC7C,MAAM,CAAC,eAAe,CAAC;QAC3B,CAAC,CAACA;QACFA,MAAMA,CAACA,gBAAgBA,CAACA;IAC5BA,CAACA;IATeD,qBAAIA,OASnBA,CAAAA;AACLA,CAACA,EAZM,gBAAgB,KAAhB,gBAAgB,QAYtB"}

View File

@ -1,3 +1,14 @@
/// <reference path="./index.ts" />
module BeautylogOsTable { module BeautylogOsTable {
export var cliTable;
export function init() {
cliTable = require("cli-table2");
var beautylogOsTable:any = {};
beautylogOsTable.new = function(type:string) {
var newConsoleTable = new ConsoleTable(type);
return newConsoleTable;
};
return beautylogOsTable;
}
} }

View File

@ -4,12 +4,9 @@ module BeautylogOS {
var colors = require("colors"); var colors = require("colors");
var clc = require("cli-color"); var clc = require("cli-color");
var beautylogOS:any = {}; var beautylogOS:any = {}; //object to append to all public facing functions
/** var localBl:any; // object to append to all private params and functions
* object to append to all locally used params
* @type {{}}
*/
var localBl:any;
localBl = {}; localBl = {};
localBl.dirPrefix = clc.bgXterm(39).xterm(231).bold(' DIR ') + ' '; localBl.dirPrefix = clc.bgXterm(39).xterm(231).bold(' DIR ') + ' ';
localBl.errorPrefix = ' Error: '.bgRed.white.bold + ' '; localBl.errorPrefix = ' Error: '.bgRed.white.bold + ' ';
@ -119,6 +116,8 @@ module BeautylogOS {
return beautylogOS.log(logText, 'warn'); return beautylogOS.log(logText, 'warn');
}; };
beautylogOS.table = BeautylogOsTable.init();
return beautylogOS; return beautylogOS;
} }
} }

View File

@ -1,6 +1,7 @@
/// <reference path="./typings/tsd.d.ts" /> /// <reference path="./typings/tsd.d.ts" />
/// <reference path="./beautylog.classes.ts" /> /// <reference path="./beautylog.classes.ts" />
/// <reference path="./beautylog.os.ts" /> /// <reference path="./beautylog.os.ts" />
/// <reference path="./beautylog.os.table.ts" />
/// <reference path="./beautylog.browser.ts" /> /// <reference path="./beautylog.browser.ts" />
var beautylog = function (logPlatform) { var beautylog = function (logPlatform) {
if (logPlatform === void 0) { logPlatform = "os"; } if (logPlatform === void 0) { logPlatform = "os"; }

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,+CAA+C;AAC/C,0CAA0C;AAC1C,+CAA+C;AAE/C,IAAI,SAAS,GAAG,UAAS,WAAyB;IAAzB,2BAAyB,GAAzB,kBAAyB;IAC9C,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QAClB,KAAK,IAAI;YACL,IAAI,WAAW,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;YACrC,MAAM,CAAC,WAAW,CAAC;YACnB,KAAK,CAAC;QACV,KAAK,SAAS;YACV,IAAI,gBAAgB,GAAG,gBAAgB,CAAC,IAAI,EAAE,CAAC;YAC/C,MAAM,CAAC,gBAAgB,CAAC;YACxB,KAAK,CAAC;QACV;YACI,OAAO,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAC;YACxE,KAAK,CAAC;IACd,CAAC;AACL,CAAC,CAAC;AACF,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC"} {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,+CAA+C;AAC/C,0CAA0C;AAC1C,gDAAgD;AAChD,+CAA+C;AAE/C,IAAI,SAAS,GAAG,UAAS,WAAyB;IAAzB,2BAAyB,GAAzB,kBAAyB;IAC9C,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QAClB,KAAK,IAAI;YACL,IAAI,WAAW,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;YACrC,MAAM,CAAC,WAAW,CAAC;YACnB,KAAK,CAAC;QACV,KAAK,SAAS;YACV,IAAI,gBAAgB,GAAG,gBAAgB,CAAC,IAAI,EAAE,CAAC;YAC/C,MAAM,CAAC,gBAAgB,CAAC;YACxB,KAAK,CAAC;QACV;YACI,OAAO,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAC;YACxE,KAAK,CAAC;IACd,CAAC;AACL,CAAC,CAAC;AACF,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC"}

View File

@ -1,6 +1,7 @@
/// <reference path="./typings/tsd.d.ts" /> /// <reference path="./typings/tsd.d.ts" />
/// <reference path="./beautylog.classes.ts" /> /// <reference path="./beautylog.classes.ts" />
/// <reference path="./beautylog.os.ts" /> /// <reference path="./beautylog.os.ts" />
/// <reference path="./beautylog.os.table.ts" />
/// <reference path="./beautylog.browser.ts" /> /// <reference path="./beautylog.browser.ts" />
var beautylog = function(logPlatform:string = "os") { var beautylog = function(logPlatform:string = "os") {

View File

@ -1,7 +1,7 @@
/// <reference path="./typings/tsd.d.ts" /> /// <reference path="./typings/tsd.d.ts" />
var beautyLogOs = require('./index.js')("os"); var beautyLogOs = require('./index.js')("os");
var beautyLogBrowser = require("./index.js")("browser"); var beautyLogBrowser = require("./index.js")("browser");
console.log('*** start test ***'); console.log('*** start OS console test ***');
console.log(''); console.log('');
console.log('declarative function calls:'); console.log('declarative function calls:');
beautyLogOs.log('beautylog.log(), with normal logText, without logType'); beautyLogOs.log('beautylog.log(), with normal logText, without logType');
@ -21,7 +21,15 @@ beautyLogOs.log('beautylog.log(), with normal logText, with logType "ok"', 'ok')
beautyLogOs.log('beautylog.log(), with normal logText, with logType "success"', 'success'); beautyLogOs.log('beautylog.log(), with normal logText, with logType "success"', 'success');
beautyLogOs.log('beautylog.log(), with normal logText, with logType "warn"', 'warn'); beautyLogOs.log('beautylog.log(), with normal logText, with logType "warn"', 'warn');
console.log(''); console.log('');
console.log('*** end test ***'); console.log('*** end OS console test ***');
console.log("start test of beautylog browser module (Might look weird in is console...)"); console.log("*** start browser console test (Might look weird in OS console and travis log...) ***");
beautyLogBrowser.log("hello"); beautyLogBrowser.log("hello");
console.log("*** end browser console test ***");
console.log("*** start table test ***");
var testTable = beautyLogOs.table.new("checks");
testTable.push(['check1', 'success']);
testTable.push(['check2', 'error']);
testTable.push(['check3', 'error']);
testTable.print();
console.log("*** end table test ***");
//# sourceMappingURL=test.js.map //# sourceMappingURL=test.js.map

View File

@ -1 +1 @@
{"version":3,"file":"test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C,GAAG,CAAC,2DAA2D,EAAC,MAAM,CAAC,CAAC;AACpF,WAAW,CAAC,GAAG,CAAC,yDAAyD,EAAC,IAAI,CAAC,CAAC;AAChF,WAAW,CAAC,GAAG,CAAC,8DAA8D,EAAC,SAAS,CAAC,CAAC;AAC1F,WAAW,CAAC,GAAG,CAAC,2DAA2D,EAAC,MAAM,CAAC,CAAC;AAEpF,OAAO,CAAC,GAAG,CAAE,EAAE,CAAC,CAAC;AACjB,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;AAE3C,OAAO,CAAC,GAAG,CAAC,uFAAuF,CAAC,CAAC;AACrG,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC9B,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;AAEhD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AACxC,IAAI,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAChD,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAC,SAAS,CAAC,CAAC,CAAC;AACrC,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAC,OAAO,CAAC,CAAC,CAAC;AACnC,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAC,OAAO,CAAC,CAAC,CAAC;AACnC,SAAS,CAAC,KAAK,EAAE,CAAC;AAClB,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC"}

View File

@ -2,7 +2,7 @@
var beautyLogOs = require('./index.js')("os"); var beautyLogOs = require('./index.js')("os");
var beautyLogBrowser = require("./index.js")("browser"); var beautyLogBrowser = require("./index.js")("browser");
console.log('*** start test ***'); console.log('*** start OS console test ***');
console.log (''); console.log ('');
console.log('declarative function calls:'); console.log('declarative function calls:');
@ -26,7 +26,16 @@ beautyLogOs.log('beautylog.log(), with normal logText, with logType "success"','
beautyLogOs.log('beautylog.log(), with normal logText, with logType "warn"','warn'); beautyLogOs.log('beautylog.log(), with normal logText, with logType "warn"','warn');
console.log (''); console.log ('');
console.log('*** end test ***'); console.log('*** end OS console test ***');
console.log("start test of beautylog browser module (Might look weird in is console...)"); console.log("*** start browser console test (Might look weird in OS console and travis log...) ***");
beautyLogBrowser.log("hello"); beautyLogBrowser.log("hello");
console.log("*** end browser console test ***");
console.log("*** start table test ***");
var testTable = beautyLogOs.table.new("checks");
testTable.push(['check1','success']);
testTable.push(['check2','error']);
testTable.push(['check3','error']);
testTable.print();
console.log("*** end table test ***");