smartlog-destination-local/test.js

41 lines
2.0 KiB
JavaScript
Raw Normal View History

2015-09-26 18:46:16 +00:00
/// <reference path="./typings/tsd.d.ts" />
2015-12-26 00:51:04 +00:00
var smartenv = require("smartenv");
var beautyLog = require('./index.js');
2015-11-15 05:15:20 +00:00
console.log('*** start OS console test ***');
2015-09-26 18:46:16 +00:00
console.log('');
console.log('declarative function calls:');
2015-12-26 00:51:04 +00:00
beautyLog.log('beautylog.log(), with normal logText, without logType');
beautyLog.dir('beautylog.dir(), with normal logText, without logType');
beautyLog.error('beautylog.error(), with normal logText, without logType');
beautyLog.info('beautylog.dir(), with normal logText, without logType');
beautyLog.ok('beautylog.ok(), with normal logText, without logType');
beautyLog.success('beautylog.success(), with normal logText, without logType');
beautyLog.warn('beautylog.warn(), with normal logText, without logType');
2015-09-26 18:46:16 +00:00
console.log('');
console.log('logType String:');
2015-12-26 00:51:04 +00:00
beautyLog.log('beautylog.log(), with normal logText, without logType');
beautyLog.log('beautylog.log(), with normal logText, with logType "dir"', 'dir');
beautyLog.log('beautylog.log(), with normal logText, with logType "error"', 'error');
beautyLog.log('beautylog.log(), with normal logText, with logType "info"', 'info');
beautyLog.log('beautylog.log(), with normal logText, with logType "ok"', 'ok');
beautyLog.log('beautylog.log(), with normal logText, with logType "success"', 'success');
beautyLog.log('beautylog.log(), with normal logText, with logType "warn"', 'warn');
2015-09-26 18:46:16 +00:00
console.log('');
2015-11-15 05:15:20 +00:00
console.log('*** end OS console test ***');
console.log("*** start table test ***");
2015-12-20 22:14:22 +00:00
(function () {
2015-12-26 00:51:04 +00:00
var testTable1 = beautyLog.table.new("checks");
2015-12-20 22:14:22 +00:00
testTable1.push(['check1', 'success']);
testTable1.push(['check2', 'error']);
testTable1.push(['check3', 'error']);
testTable1.print();
2015-12-26 00:51:04 +00:00
var testTable2 = beautyLog.table.new("custom", ["Column1".red, "Column2".blue, "Column3".cyan]);
2015-12-20 22:14:22 +00:00
testTable2.push(["Hey", "this", "works"]);
testTable2.print();
})();
2015-11-15 05:15:20 +00:00
console.log("*** end table test ***");
2016-01-30 05:19:44 +00:00
console.log("*** start code test ***");
beautyLog.code("var test = 3; function(){}\n", {
language: "javascript"
});