smartlog-destination-local/ts/beautylog.node.ts

71 lines
1.9 KiB
TypeScript
Raw Normal View History

2015-11-01 21:00:07 +00:00
/// <reference path="./index.ts" />
2015-12-26 00:51:04 +00:00
module BeautylogNode {
2015-11-01 21:00:07 +00:00
export function init() {
2016-01-30 05:19:44 +00:00
plugins.colors = require("colors");
plugins.clc = require("cli-color");
2015-11-01 21:00:07 +00:00
2016-01-30 05:19:44 +00:00
var beautylogNode:any = {
log:BeautylogNodeLog.init(),
code:BeautylogNodeCode.init()
}; //object to append to all public facing functions
2015-11-01 21:00:07 +00:00
/**
* logs an directory to console
* @param logText
* @returns {boolean}
*/
2015-12-26 00:51:04 +00:00
beautylogNode.dir = function(logText) {
return beautylogNode.log(logText, 'dir');
2015-11-01 21:00:07 +00:00
};
/**
* logs an error to console
* @param logText
* @returns {boolean}
*/
2015-12-26 00:51:04 +00:00
beautylogNode.error = function(logText) {
return beautylogNode.log(logText, 'error');
2015-11-01 21:00:07 +00:00
};
/**
* logs an info to console
* @param logText
* @returns {boolean}
*/
2015-12-26 00:51:04 +00:00
beautylogNode.info = function(logText) {
return beautylogNode.log(logText, 'info');
2015-11-01 21:00:07 +00:00
};
/**
* logs an 'OK!' message to console
* @param logText
* @returns {boolean}
*/
2015-12-26 00:51:04 +00:00
beautylogNode.ok = function(logText) {
return beautylogNode.log(logText, 'ok');
2015-11-01 21:00:07 +00:00
};
/**
* logs a success to console
* @param logText string to log as error
* @returns {boolean}
*/
2015-12-26 00:51:04 +00:00
beautylogNode.success = function(logText) {
return beautylogNode.log(logText, 'success');
2015-11-13 21:53:28 +00:00
};
2015-11-01 21:00:07 +00:00
/**
* logs a 'warn:' message to console
* @param logText string to log as error
* @returns {boolean}
*/
2015-12-26 00:51:04 +00:00
beautylogNode.warn = function(logText) {
return beautylogNode.log(logText, 'warn');
2015-11-13 21:53:28 +00:00
};
2015-11-01 21:00:07 +00:00
2016-01-30 05:19:44 +00:00
beautylogNode.table = BeautylogNodeTable.init();
2015-11-15 05:15:20 +00:00
2015-12-26 00:51:04 +00:00
return beautylogNode;
2015-11-01 21:00:07 +00:00
}
}