smartlog-destination-local/dist/beautylog.log.js

62 lines
4.5 KiB
JavaScript

"use strict";
require("typings-global");
var beautylog_log_helpers_1 = require("./beautylog.log.helpers");
var beautylog_log_helpers_2 = require("./beautylog.log.helpers");
exports.log = beautylog_log_helpers_2.log;
/**
* logs an info to console
* @param logText
* @returns {boolean}
*/
exports.info = function (logText) {
return beautylog_log_helpers_1.log(logText, 'info');
};
/**
* logs an 'OK!' message to console
* @param logText
* @returns {boolean}
*/
exports.ok = function (logText) {
return beautylog_log_helpers_1.log(logText, 'ok');
};
/**
* logs a success to console
* @param logText string to log as error
* @returns {boolean}
*/
exports.success = function (logText) {
return beautylog_log_helpers_1.log(logText, 'success');
};
/**
* logs a 'warn:' message to console
* @param logText string to log as error
* @returns {boolean}
*/
exports.warn = function (logText) {
return beautylog_log_helpers_1.log(logText, 'warn');
};
/**
* logs an error to console
* @param logText
* @returns {boolean}
*/
exports.error = function (logText) {
return beautylog_log_helpers_1.log(logText, 'error');
};
/**
* logs an directory to console
* @param logText
* @returns {boolean}
*/
exports.dir = function (logText) {
return beautylog_log_helpers_1.log(logText, 'dir');
};
exports.newLine = function (linesArg) {
if (linesArg === void 0) { linesArg = 1; }
for (var i = 0; i < linesArg; i++) {
console.log("\n");
}
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5sb2cudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUV4QixzQ0FBa0IseUJBQXlCLENBQUMsQ0FBQTtBQUM1QyxzQ0FBa0IseUJBQXlCLENBQUM7QUFBcEMsMENBQW9DO0FBRTVDOzs7O0dBSUc7QUFDUSxZQUFJLEdBQUcsVUFBQyxPQUFPO0lBQ3RCLE1BQU0sQ0FBQywyQkFBRyxDQUFDLE9BQU8sRUFBRSxNQUFNLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUM7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