now has working logging
This commit is contained in:
parent
818df0c367
commit
a0ba51718c
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,13 +1,8 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
.settings/
|
|
||||||
.idea/
|
|
||||||
coverage/
|
coverage/
|
||||||
docs/
|
docs/
|
||||||
|
|
||||||
#npm devug
|
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
|
||||||
ts/*.js
|
.nogit/
|
||||||
ts/*.js.map
|
|
||||||
ts/typings/
|
|
||||||
|
|
||||||
|
10
README.md
10
README.md
@ -11,7 +11,7 @@ beautiful logging, TypeScript ready
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
var beautylog = require("beautylog"); //for use in OS console environment AND browser console
|
var beautylog = require("beautylog");
|
||||||
|
|
||||||
beautylog.log("some log message"); // normal console log message
|
beautylog.log("some log message"); // normal console log message
|
||||||
beautylog.info("some log message") // info console log message
|
beautylog.info("some log message") // info console log message
|
||||||
@ -19,12 +19,6 @@ beautylog.ok("some log message"); // ok console log message
|
|||||||
beautylog.warn("some log message"); // warn console log message
|
beautylog.warn("some log message"); // warn console log message
|
||||||
beautylog.success("some success message"); // success console log message
|
beautylog.success("some success message"); // success console log message
|
||||||
beautylog.error("some error message"); // error console log message
|
beautylog.error("some error message"); // error console log message
|
||||||
|
|
||||||
// alternatively you can use a logType parameter
|
|
||||||
beautylog.log("some log message","normal");
|
|
||||||
beautylog.log("some success message","success");
|
|
||||||
beautylog.log("some error message","error");
|
|
||||||
/* ... and so on ... */
|
|
||||||
```
|
```
|
||||||
The plugin produces beautiful output like this:
|
The plugin produces beautiful output like this:
|
||||||
![console.png](https://mediaserve.lossless.digital/github.com/pushrocks/beautylog/console.png)
|
![console.png](https://mediaserve.lossless.digital/github.com/pushrocks/beautylog/console.png)
|
||||||
@ -81,7 +75,7 @@ Currently supported remote providers:
|
|||||||
* loggly.com
|
* loggly.com
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
beautylog.registerLoggly(
|
beautylog.remote.loggly(
|
||||||
token: "your-really-long-input-token",
|
token: "your-really-long-input-token",
|
||||||
subdomain: "your-subdomain",
|
subdomain: "your-subdomain",
|
||||||
auth: {
|
auth: {
|
||||||
|
1
dist/beautylog.classes.ora.d.ts
vendored
1
dist/beautylog.classes.ora.d.ts
vendored
@ -12,5 +12,4 @@ export declare class Ora {
|
|||||||
endError(textArg: any): void;
|
endError(textArg: any): void;
|
||||||
pause(): void;
|
pause(): void;
|
||||||
stop(): void;
|
stop(): void;
|
||||||
log(logText: string, logType: string): void;
|
|
||||||
}
|
}
|
||||||
|
13
dist/beautylog.classes.ora.js
vendored
13
dist/beautylog.classes.ora.js
vendored
@ -34,12 +34,12 @@ class Ora {
|
|||||||
}
|
}
|
||||||
endOk(textArg) {
|
endOk(textArg) {
|
||||||
this.end();
|
this.end();
|
||||||
beautylog_log_helpers_1.logNode(textArg, "ok");
|
beautylog_log_helpers_1.logNode("ok", textArg);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
endError(textArg) {
|
endError(textArg) {
|
||||||
this.end();
|
this.end();
|
||||||
beautylog_log_helpers_1.logNode(textArg, "error");
|
beautylog_log_helpers_1.logNode("error", textArg);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
pause() {
|
pause() {
|
||||||
@ -48,12 +48,7 @@ class Ora {
|
|||||||
stop() {
|
stop() {
|
||||||
this.end();
|
this.end();
|
||||||
}
|
}
|
||||||
// log methods that play nice with ora
|
;
|
||||||
log(logText, logType) {
|
|
||||||
this.stop();
|
|
||||||
beautylog_log_helpers_1.logNode(logText, logType);
|
|
||||||
this.start();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
exports.Ora = Ora;
|
exports.Ora = Ora;
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVhdXR5bG9nLmNsYXNzZXMub3JhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXM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FLLEVBQUUsQ0FBQztJQUM1QixDQUFDOztJQUNELEdBQUc7UUFDQyxJQUFJLENBQUMsVUFBVSxDQUFDLElBQUksRUFBRSxDQUFDO1FBQ3ZCLElBQUksQ0FBQyxVQUFVLENBQUMsS0FBSyxFQUFFLENBQUM7UUFDeEIsaUJBQVMsR0FBRyxTQUFTLENBQUM7UUFDdEIsaUJBQVMsR0FBRyxLQUFLLENBQUM7SUFDdEIsQ0FBQztJQUNELEtBQUssQ0FBQyxPQUFPO1FBQ1QsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDO1FBQ1gsK0JBQU8sQ0FBQyxJQUFJLEVBQUMsT0FBTyxDQUFDLENBQUM7SUFDMUIsQ0FBQzs7SUFDRCxRQUFRLENBQUMsT0FBTztRQUNaLElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQztRQUNYLCtCQUFPLENBQUMsT0FBTyxFQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQzdCLENBQUM7O0lBQ0QsS0FBSztRQUNELElBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxFQUFFLENBQUM7SUFDM0IsQ0FBQztJQUNELElBQUk7UUFDQSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUM7SUFDZixDQUFDOztBQUNMLENBQUM7QUEzQ1ksV0FBRyxNQTJDZixDQUFBIn0=
|
2
dist/beautylog.log.d.ts
vendored
2
dist/beautylog.log.d.ts
vendored
@ -1,10 +1,10 @@
|
|||||||
import "typings-global";
|
import "typings-global";
|
||||||
export { log } from "./beautylog.log.helpers";
|
|
||||||
/**
|
/**
|
||||||
* logs an info to console
|
* logs an info to console
|
||||||
* @param logText
|
* @param logText
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
|
export declare let log: (logText: any) => void;
|
||||||
export declare let info: (logText: any) => void;
|
export declare let info: (logText: any) => void;
|
||||||
/**
|
/**
|
||||||
* logs an 'OK!' message to console
|
* logs an 'OK!' message to console
|
||||||
|
4
dist/beautylog.log.helpers.d.ts
vendored
4
dist/beautylog.log.helpers.d.ts
vendored
@ -4,5 +4,5 @@
|
|||||||
* @param logType
|
* @param logType
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
export declare let log: (logText?: string, logType?: string) => void;
|
export declare let internalLog: (logType?: string, logText?: string) => void;
|
||||||
export declare let logNode: (logText: string, logType: string) => boolean;
|
export declare let logNode: (logType: string, logText: string) => boolean;
|
||||||
|
45
dist/beautylog.log.helpers.js
vendored
45
dist/beautylog.log.helpers.js
vendored
@ -1,6 +1,28 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
const plugins = require("./beautylog.plugins");
|
const plugins = require("./beautylog.plugins");
|
||||||
const beautylog_console_1 = require("./beautylog.console");
|
const beautylog_console_1 = require("./beautylog.console");
|
||||||
|
const beautylog_remote_1 = require("./beautylog.remote");
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param logText
|
||||||
|
* @param logType
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
exports.internalLog = function (logType = 'normal', logText = 'empty log') {
|
||||||
|
switch (plugins.smartenv.getEnv().runtimeEnv) {
|
||||||
|
case "node":
|
||||||
|
exports.logNode(logType, logText);
|
||||||
|
beautylog_remote_1.remoteLog(logType, logText);
|
||||||
|
break;
|
||||||
|
case "browser":
|
||||||
|
logBrowser(logText, logType);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log("something is strange about the platform in which you try to use beautylog");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
};
|
||||||
let localBl = {
|
let localBl = {
|
||||||
dirPrefix: plugins.clc.bgXterm(39).xterm(231).bold(' DIR ') + ' ',
|
dirPrefix: plugins.clc.bgXterm(39).xterm(231).bold(' DIR ') + ' ',
|
||||||
errorPrefix: ' Error: '.bgRed.white.bold + ' ',
|
errorPrefix: ' Error: '.bgRed.white.bold + ' ',
|
||||||
@ -10,26 +32,7 @@ let localBl = {
|
|||||||
successPrefix: ' Success: '.bgGreen.white.bold + ' ',
|
successPrefix: ' Success: '.bgGreen.white.bold + ' ',
|
||||||
warnPrefix: ' '.bgYellow + ' Warn: '.bgBlack.yellow.bold + ' '
|
warnPrefix: ' '.bgYellow + ' Warn: '.bgBlack.yellow.bold + ' '
|
||||||
};
|
};
|
||||||
/**
|
exports.logNode = function (logType, logText) {
|
||||||
*
|
|
||||||
* @param logText
|
|
||||||
* @param logType
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
exports.log = function (logText = 'empty log', logType = 'normal') {
|
|
||||||
switch (plugins.smartenv.getEnv().runtimeEnv) {
|
|
||||||
case "node":
|
|
||||||
exports.logNode(logText, logType);
|
|
||||||
break;
|
|
||||||
case "browser":
|
|
||||||
logBrowser(logText, logType);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.log("something is strange about the platform in which you try to use beautylog");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.logNode = function (logText, logType) {
|
|
||||||
try {
|
try {
|
||||||
switch (logType) {
|
switch (logType) {
|
||||||
case 'dir':
|
case 'dir':
|
||||||
@ -100,4 +103,4 @@ let logBrowser = function (logText, logType) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVhdXR5bG9nLmxvZy5oZWxwZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvYmVhdXR5bG9nLmxvZy5oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxNQUFZLE9BQU8sV0FBTSxxQkFBcUIsQ0FBQyxDQUFBO0FBQy9DLG9DQUE0QixxQkFBcUIsQ0FBQyxDQUFBO0FBRWxELElBQUksT0FBTyxHQUFHO0lBQ1YsU0FBUyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUMs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.log.js
vendored
@ -1,15 +1,16 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
require("typings-global");
|
require("typings-global");
|
||||||
const beautylog_log_helpers_1 = require("./beautylog.log.helpers");
|
const 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
|
* logs an info to console
|
||||||
* @param logText
|
* @param logText
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
|
exports.log = (logText) => {
|
||||||
|
return beautylog_log_helpers_1.internalLog("log", logText);
|
||||||
|
};
|
||||||
exports.info = (logText) => {
|
exports.info = (logText) => {
|
||||||
return beautylog_log_helpers_1.log(logText, 'info');
|
return beautylog_log_helpers_1.internalLog('info', logText);
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* logs an 'OK!' message to console
|
* logs an 'OK!' message to console
|
||||||
@ -17,7 +18,7 @@ exports.info = (logText) => {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
exports.ok = (logText) => {
|
exports.ok = (logText) => {
|
||||||
return beautylog_log_helpers_1.log(logText, 'ok');
|
return beautylog_log_helpers_1.internalLog("ok", logText);
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* logs a success to console
|
* logs a success to console
|
||||||
@ -25,7 +26,7 @@ exports.ok = (logText) => {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
exports.success = (logText) => {
|
exports.success = (logText) => {
|
||||||
return beautylog_log_helpers_1.log(logText, 'success');
|
return beautylog_log_helpers_1.internalLog("success", logText);
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* logs a 'warn:' message to console
|
* logs a 'warn:' message to console
|
||||||
@ -33,7 +34,7 @@ exports.success = (logText) => {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
exports.warn = (logText) => {
|
exports.warn = (logText) => {
|
||||||
return beautylog_log_helpers_1.log(logText, 'warn');
|
return beautylog_log_helpers_1.internalLog("warn", logText);
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* logs an error to console
|
* logs an error to console
|
||||||
@ -41,7 +42,7 @@ exports.warn = (logText) => {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
exports.error = (logText) => {
|
exports.error = (logText) => {
|
||||||
return beautylog_log_helpers_1.log(logText, 'error');
|
return beautylog_log_helpers_1.internalLog("error", logText);
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* logs an directory to console
|
* logs an directory to console
|
||||||
@ -49,7 +50,7 @@ exports.error = (logText) => {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
exports.dir = (logText) => {
|
exports.dir = (logText) => {
|
||||||
return beautylog_log_helpers_1.log(logText, 'dir');
|
return beautylog_log_helpers_1.internalLog("dir", logText);
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* creates a new empty line
|
* creates a new empty line
|
||||||
@ -71,9 +72,9 @@ exports.logReduced = (logTextArg, repeatEveryTimesArg = 0) => {
|
|||||||
else {
|
else {
|
||||||
sameMessageCounter = 0;
|
sameMessageCounter = 0;
|
||||||
previousMessage = logTextArg;
|
previousMessage = logTextArg;
|
||||||
beautylog_log_helpers_1.log(logTextArg);
|
exports.log(logTextArg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let previousMessage = "";
|
let previousMessage = "";
|
||||||
let sameMessageCounter = 0;
|
let sameMessageCounter = 0;
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVhdXR5bG9nLmxvZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2JlYXV0eWxvZy5sb2cudHMiXSwibmFtZXMiOlt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UMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxRQUFRLEVBQUMsQ0FBQyxFQUFFLEVBQUMsQ0FBQztRQUM3QixPQUFPLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxDQUFDO0lBQ3RCLENBQUM7QUFDTCxDQUFDLENBQUE7QUFFRDs7R0FFRztBQUNRLGtCQUFVLEdBQUcsQ0FBQyxVQUFpQixFQUFDLG1CQUFtQixHQUFVLENBQUM7SUFDckUsRUFBRSxDQUFBLENBQUMsVUFBVSxJQUFJLGVBQWUsSUFBSSxDQUFDLG1CQUFtQixJQUFJLENBQUMsSUFBSSxrQkFBa0IsSUFBSSxtQkFBbUIsQ0FBQyxDQUFDLENBQUEsQ0FBQztRQUN6RyxrQkFBa0IsRUFBRSxDQUFDO0lBQ3pCLENBQUM7SUFBQyxJQUFJLENBQUMsQ0FBQztRQUNKLGtCQUFrQixHQUFHLENBQUMsQ0FBQztRQUN2QixlQUFlLEdBQUcsVUFBVSxDQUFDO1FBQzdCLFdBQUcsQ0FBQyxVQUFVLENBQUMsQ0FBQztJQUNwQixDQUFDO0FBQ0wsQ0FBQyxDQUFDO0FBQ0YsSUFBSSxlQUFlLEdBQVUsRUFBRSxDQUFDO0FBQ2hDLElBQUksa0JBQWtCLEdBQVUsQ0FBQyxDQUFDIn0=
|
1
dist/beautylog.plugins.d.ts
vendored
1
dist/beautylog.plugins.d.ts
vendored
@ -8,3 +8,4 @@ export declare let clc: any;
|
|||||||
export declare let figlet: any;
|
export declare let figlet: any;
|
||||||
export import loggly = require("loggly");
|
export import loggly = require("loggly");
|
||||||
export declare let ora: any;
|
export declare let ora: any;
|
||||||
|
export import winstonLoggly = require("winston-loggly-bulk");
|
||||||
|
3
dist/beautylog.plugins.js
vendored
3
dist/beautylog.plugins.js
vendored
@ -9,4 +9,5 @@ exports.clc = require("cli-color");
|
|||||||
exports.figlet = require("figlet");
|
exports.figlet = require("figlet");
|
||||||
exports.loggly = require("loggly");
|
exports.loggly = require("loggly");
|
||||||
exports.ora = require("ora");
|
exports.ora = require("ora");
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVhdXR5bG9nLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9iZWF1dHlsb2cucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBRVYsY0FBTSxXQUFXLFFBQVEsQ0FBQyxDQUFDO0FBQzNCLGdCQUFRLFdBQVcsVUFBVSxDQUFDLENBQUM7QUFDL0IsU0FBQyxXQUFXLEdBQUcsQ0FBQyxDQUFBO0FBQ25CLGdCQUFRLEdBQUcsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUFDO0FBQzlCLGNBQU0sV0FBVyxRQUFRLENBQUMsQ0FBQztBQUM5QixXQUFHLEdBQUcsT0FBTyxDQUFDLFdBQVcsQ0FBQyxDQUFDO0FBQzNCLGNBQU0sR0FBRyxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUM7QUFDeEIsY0FBTSxXQUFXLFFBQVEsQ0FBQyxDQUFDO0FBQzlCLFdBQUcsR0FBRyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUMifQ==
|
exports.winstonLoggly = require("winston-loggly-bulk");
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVhdXR5bG9nLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9iZWF1dHlsb2cucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBRVYsY0FBTSxXQUFXLFFBQVEsQ0FBQyxDQUFDO0FBQzNCLGdCQUFRLFdBQVcsVUFBVSxDQUFDLENBQUM7QUFDL0IsU0FBQyxXQUFXLEdBQUcsQ0FBQyxDQUFBO0FBQ25CLGdCQUFRLEdBQUcsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUFDO0FBQzlCLGNBQU0sV0FBVyxRQUFRLENBQUMsQ0FBQztBQUM5QixXQUFHLEdBQUcsT0FBTyxDQUFDLFdBQVcsQ0FBQyxDQUFDO0FBQzNCLGNBQU0sR0FBRyxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUM7QUFDeEIsY0FBTSxXQUFXLFFBQVEsQ0FBQyxDQUFDO0FBQzlCLFdBQUcsR0FBRyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUM7QUFDbEIscUJBQWEsV0FBVyxxQkFBcUIsQ0FBQyxDQUFDIn0=
|
4
dist/beautylog.remote.d.ts
vendored
4
dist/beautylog.remote.d.ts
vendored
@ -0,0 +1,4 @@
|
|||||||
|
export declare let remoteLog: (logType: string, logMessage: string) => void;
|
||||||
|
export declare let remote: {
|
||||||
|
loggly: (customerTokenArg: string, subdomainArg: string) => void;
|
||||||
|
};
|
31
dist/beautylog.remote.js
vendored
31
dist/beautylog.remote.js
vendored
@ -1 +1,30 @@
|
|||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVhdXR5bG9nLnJlbW90ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2JlYXV0eWxvZy5yZW1vdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
"use strict";
|
||||||
|
const plugins = require("./beautylog.plugins");
|
||||||
|
let client;
|
||||||
|
let clientData = {
|
||||||
|
serverName: "myServer",
|
||||||
|
applicationName: "myApp",
|
||||||
|
message: "undefined",
|
||||||
|
messageType: "undefined"
|
||||||
|
};
|
||||||
|
exports.remoteLog = (logType, logMessage) => {
|
||||||
|
clientData.messageType = logType;
|
||||||
|
clientData.message = logMessage;
|
||||||
|
if (client) {
|
||||||
|
client.log(clientData);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
};
|
||||||
|
// Service implementations
|
||||||
|
let loggly = (customerTokenArg, subdomainArg) => {
|
||||||
|
client = plugins.loggly.createClient({
|
||||||
|
token: customerTokenArg,
|
||||||
|
subdomain: subdomainArg,
|
||||||
|
tags: ["beautylog-test"],
|
||||||
|
json: true
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.remote = {
|
||||||
|
loggly: loggly
|
||||||
|
};
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVhdXR5bG9nLnJlbW90ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2JlYXV0eWxvZy5yZW1vdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE1BQVksT0FBTyxXQUFNLHFCQUFxQixDQUFDLENBQUE7QUFFL0MsSUFBSSxNQUFNLENBQUM7QUFDWCxJQUFJLFVBQVUsR0FBRztJQUNiLFVBQVUsRUFBQyxVQUFVO0lBQ3JCLGVBQWUsRUFBQyxPQUFPO0lBQ3ZCLE9BQU8sRUFBQyxXQUFXO0lBQ25CLFdBQVcsRUFBQyxXQUFXO0NBQzFCLENBQUE7QUFDVSxpQkFBUyxHQUFHLENBQUMsT0FBYyxFQUFDLFVBQWlCO0lBQ3BELFVBQVUsQ0FBQyxXQUFXLEdBQUcsT0FBTyxDQUFDO0lBQ2pDLFVBQVUsQ0FBQyxPQUFPLEdBQUcsVUFBVSxDQUFDO0lBQ2hDLEVBQUUsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFBLENBQUM7UUFDUCxNQUFNLENBQUMsR0FBRyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0lBQzVCLENBQUM7SUFBQSxDQUFDO0FBQ04sQ0FBQyxDQUFBO0FBRUQsMEJBQTBCO0FBRTFCLElBQUksTUFBTSxHQUFHLENBQUMsZ0JBQXVCLEVBQUMsWUFBbUI7SUFDckQsTUFBTSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsWUFBWSxDQUFDO1FBQ2pDLEtBQUssRUFBRSxnQkFBZ0I7UUFDdkIsU0FBUyxFQUFFLFlBQVk7UUFDdkIsSUFBSSxFQUFFLENBQUMsZ0JBQWdCLENBQUM7UUFDeEIsSUFBSSxFQUFDLElBQUk7S0FDWixDQUFDLENBQUM7QUFDUCxDQUFDLENBQUE7QUFFVSxjQUFNLEdBQUc7SUFDaEIsTUFBTSxFQUFFLE1BQU07Q0FDakIsQ0FBQyJ9
|
1
dist/index.d.ts
vendored
1
dist/index.d.ts
vendored
@ -3,3 +3,4 @@ export { Table } from "./beautylog.classes.table";
|
|||||||
export { Ora } from "./beautylog.classes.ora";
|
export { Ora } from "./beautylog.classes.ora";
|
||||||
export { dir, error, info, log, logReduced, ok, success, warn, newLine } from "./beautylog.log";
|
export { dir, error, info, log, logReduced, ok, success, warn, newLine } from "./beautylog.log";
|
||||||
export { figlet, figletSync } from "./beautylog.figlet";
|
export { figlet, figletSync } from "./beautylog.figlet";
|
||||||
|
export { remote } from "./beautylog.remote";
|
||||||
|
4
dist/index.js
vendored
4
dist/index.js
vendored
@ -19,4 +19,6 @@ exports.newLine = beautylog_log_1.newLine;
|
|||||||
var beautylog_figlet_1 = require("./beautylog.figlet");
|
var beautylog_figlet_1 = require("./beautylog.figlet");
|
||||||
exports.figlet = beautylog_figlet_1.figlet;
|
exports.figlet = beautylog_figlet_1.figlet;
|
||||||
exports.figletSync = beautylog_figlet_1.figletSync;
|
exports.figletSync = beautylog_figlet_1.figletSync;
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQ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M7QUFBbEMsMkNBQWtDIn0=
|
@ -35,6 +35,7 @@
|
|||||||
"@types/lodash": "0.0.28",
|
"@types/lodash": "0.0.28",
|
||||||
"@types/loggly": "^1.0.28",
|
"@types/loggly": "^1.0.28",
|
||||||
"@types/q": "^0.0.27",
|
"@types/q": "^0.0.27",
|
||||||
|
"@types/winston": "^0.0.27",
|
||||||
"cli-color": "^1.1.0",
|
"cli-color": "^1.1.0",
|
||||||
"cli-table2": "^0.2.0",
|
"cli-table2": "^0.2.0",
|
||||||
"colors": "1.1.2",
|
"colors": "1.1.2",
|
||||||
|
16
test/test.js
16
test/test.js
File diff suppressed because one or more lines are too long
18
test/test.ts
18
test/test.ts
@ -2,20 +2,11 @@ import "typings-test";
|
|||||||
import beautylog = require('../dist/index');
|
import beautylog = require('../dist/index');
|
||||||
|
|
||||||
describe("beautylog",function(){
|
describe("beautylog",function(){
|
||||||
describe(".log(message,logtype)",function(){
|
describe(".log(message)",function(){
|
||||||
it("should log cyan text",function(){
|
it("should print a blue Dir message",function(){
|
||||||
beautylog.log('beautylog.log(), with normal logText, without logType');
|
beautylog.log('beautylog.log(), with normal logText, without logType');
|
||||||
});
|
})
|
||||||
it("should print different log types dependent on logType",function(){
|
})
|
||||||
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');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
describe(".dir(message)",function(){
|
describe(".dir(message)",function(){
|
||||||
it("should print a blue Dir message",function(){
|
it("should print a blue Dir message",function(){
|
||||||
beautylog.dir('beautylog.dir(), with normal logText, without logType');
|
beautylog.dir('beautylog.dir(), with normal logText, without logType');
|
||||||
@ -67,7 +58,6 @@ describe("beautylog",function(){
|
|||||||
let testOra = new beautylog.Ora("This is a test text","green",true);
|
let testOra = new beautylog.Ora("This is a test text","green",true);
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
testOra.text("updated text!");
|
testOra.text("updated text!");
|
||||||
testOra.log("an intermediate log message","info");
|
|
||||||
beautylog.info("another log message that uses the normal log function");
|
beautylog.info("another log message that uses the normal log function");
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
testOra.endOk("Allright, ora works!");
|
testOra.endOk("Allright, ora works!");
|
||||||
|
@ -36,23 +36,16 @@ export class Ora {
|
|||||||
}
|
}
|
||||||
endOk(textArg){
|
endOk(textArg){
|
||||||
this.end();
|
this.end();
|
||||||
logNode(textArg,"ok");
|
logNode("ok",textArg);
|
||||||
};
|
};
|
||||||
endError(textArg){
|
endError(textArg){
|
||||||
this.end();
|
this.end();
|
||||||
logNode(textArg,"error");
|
logNode("error",textArg);
|
||||||
};
|
};
|
||||||
pause(){
|
pause(){
|
||||||
this._oraObject.stop();
|
this._oraObject.stop();
|
||||||
}
|
}
|
||||||
stop(){ // alias for end
|
stop(){ // alias for end
|
||||||
this.end();
|
this.end();
|
||||||
}
|
};
|
||||||
|
|
||||||
// log methods that play nice with ora
|
|
||||||
log(logText:string,logType:string){
|
|
||||||
this.stop();
|
|
||||||
logNode(logText,logType);
|
|
||||||
this.start();
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,5 +1,27 @@
|
|||||||
import * as plugins from "./beautylog.plugins";
|
import * as plugins from "./beautylog.plugins";
|
||||||
import {beautyConsole} from "./beautylog.console";
|
import { beautyConsole } from "./beautylog.console";
|
||||||
|
import {remoteLog} from "./beautylog.remote";
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param logText
|
||||||
|
* @param logType
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
export let internalLog = function (logType: string = 'normal', logText: string = 'empty log') {
|
||||||
|
switch (plugins.smartenv.getEnv().runtimeEnv){
|
||||||
|
case "node":
|
||||||
|
logNode(logType,logText);
|
||||||
|
remoteLog(logType,logText);
|
||||||
|
break;
|
||||||
|
case "browser":
|
||||||
|
logBrowser(logText, logType);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log("something is strange about the platform in which you try to use beautylog");
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
let localBl = {
|
let localBl = {
|
||||||
dirPrefix: plugins.clc.bgXterm(39).xterm(231).bold(' DIR ') + ' ',
|
dirPrefix: plugins.clc.bgXterm(39).xterm(231).bold(' DIR ') + ' ',
|
||||||
@ -11,27 +33,7 @@ let localBl = {
|
|||||||
warnPrefix: ' '.bgYellow + ' Warn: '.bgBlack.yellow.bold + ' '
|
warnPrefix: ' '.bgYellow + ' Warn: '.bgBlack.yellow.bold + ' '
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
export let logNode = function (logType: string,logText: string) {
|
||||||
*
|
|
||||||
* @param logText
|
|
||||||
* @param logType
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
export let log = function(logText:string = 'empty log', logType:string = 'normal') {
|
|
||||||
switch(plugins.smartenv.getEnv().runtimeEnv) {
|
|
||||||
case "node":
|
|
||||||
logNode(logText,logType);
|
|
||||||
break;
|
|
||||||
case "browser":
|
|
||||||
logBrowser(logText,logType);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.log("something is strange about the platform in which you try to use beautylog");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export let logNode = function(logText:string,logType:string){
|
|
||||||
try {
|
try {
|
||||||
switch (logType) {
|
switch (logType) {
|
||||||
case 'dir':
|
case 'dir':
|
||||||
@ -72,7 +74,7 @@ export let logNode = function(logText:string,logType:string){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let logBrowser = function(logText,logType){
|
let logBrowser = function (logText, logType) {
|
||||||
switch (logType) {
|
switch (logType) {
|
||||||
case 'dir':
|
case 'dir':
|
||||||
logText = localBl.dirPrefix + plugins.clc.xterm(26)(logText);
|
logText = localBl.dirPrefix + plugins.clc.xterm(26)(logText);
|
||||||
@ -81,22 +83,22 @@ let logBrowser = function(logText,logType){
|
|||||||
logText = localBl.errorPrefix + logText.red.bold;
|
logText = localBl.errorPrefix + logText.red.bold;
|
||||||
break;
|
break;
|
||||||
case 'info':
|
case 'info':
|
||||||
console.log('%c Info: %c ' + logText,'background:#EC407A;color:#ffffff;','color:#EC407A;');
|
console.log('%c Info: %c ' + logText, 'background:#EC407A;color:#ffffff;', 'color:#EC407A;');
|
||||||
break;
|
break;
|
||||||
case 'normal':
|
case 'normal':
|
||||||
logText = localBl.normalPrefix + logText.cyan.bold;
|
logText = localBl.normalPrefix + logText.cyan.bold;
|
||||||
break;
|
break;
|
||||||
case 'ok':
|
case 'ok':
|
||||||
console.log('%c OK: %c ' + logText,"background:#000000;color:#8BC34A;","color:#000000;");
|
console.log('%c OK: %c ' + logText, "background:#000000;color:#8BC34A;", "color:#000000;");
|
||||||
break;
|
break;
|
||||||
case 'success':
|
case 'success':
|
||||||
console.log('%c Success: %c ' + logText,"background:#8BC34A;color:#ffffff;","color:#8BC34A;");
|
console.log('%c Success: %c ' + logText, "background:#8BC34A;color:#ffffff;", "color:#8BC34A;");
|
||||||
break;
|
break;
|
||||||
case 'warn':
|
case 'warn':
|
||||||
console.log('%c Warn: %c ' + logText,"background:#000000;color:#FB8C00;","color:#000000;");
|
console.log('%c Warn: %c ' + logText, "background:#000000;color:#FB8C00;", "color:#000000;");
|
||||||
break;
|
break;
|
||||||
case 'log':
|
case 'log':
|
||||||
console.log('%c Log: %c ' + logText,"background:#42A5F5;color:#ffffff","color:#42A5F5;");
|
console.log('%c Log: %c ' + logText, "background:#42A5F5;color:#ffffff", "color:#42A5F5;");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log('unknown logType for "' + logText + '"');
|
console.log('unknown logType for "' + logText + '"');
|
||||||
|
@ -1,15 +1,19 @@
|
|||||||
import "typings-global";
|
import "typings-global";
|
||||||
|
|
||||||
import {log} from "./beautylog.log.helpers";
|
import {internalLog} from "./beautylog.log.helpers";
|
||||||
export {log} from "./beautylog.log.helpers";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* logs an info to console
|
* logs an info to console
|
||||||
* @param logText
|
* @param logText
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export let log = (logText) => {
|
||||||
|
return internalLog("log",logText)
|
||||||
|
}
|
||||||
|
|
||||||
export let info = (logText) => {
|
export let info = (logText) => {
|
||||||
return log(logText, 'info');
|
return internalLog('info',logText);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -18,7 +22,7 @@ export let info = (logText) => {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
export let ok = (logText) => {
|
export let ok = (logText) => {
|
||||||
return log(logText, 'ok');
|
return internalLog("ok",logText);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,7 +31,7 @@ export let ok = (logText) => {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
export let success = (logText) => {
|
export let success = (logText) => {
|
||||||
return log(logText, 'success');
|
return internalLog("success",logText);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,7 +40,7 @@ export let success = (logText) => {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
export let warn = (logText) => {
|
export let warn = (logText) => {
|
||||||
return log(logText, 'warn');
|
return internalLog("warn",logText);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,7 +49,7 @@ export let warn = (logText) => {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
export let error = (logText) => {
|
export let error = (logText) => {
|
||||||
return log(logText, 'error');
|
return internalLog("error",logText);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,7 +58,7 @@ export let error = (logText) => {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
export let dir = (logText) => {
|
export let dir = (logText) => {
|
||||||
return log(logText, 'dir');
|
return internalLog("dir",logText);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,3 +9,4 @@ export let clc = require("cli-color");
|
|||||||
export let figlet = require("figlet");
|
export let figlet = require("figlet");
|
||||||
export import loggly = require("loggly");
|
export import loggly = require("loggly");
|
||||||
export let ora = require("ora");
|
export let ora = require("ora");
|
||||||
|
export import winstonLoggly = require("winston-loggly-bulk");
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
import * as plugins from "./beautylog.plugins";
|
||||||
|
|
||||||
|
let client;
|
||||||
|
let clientData = {
|
||||||
|
serverName:"myServer",
|
||||||
|
applicationName:"myApp",
|
||||||
|
message:"undefined",
|
||||||
|
messageType:"undefined"
|
||||||
|
}
|
||||||
|
export let remoteLog = (logType:string,logMessage:string) => {
|
||||||
|
clientData.messageType = logType;
|
||||||
|
clientData.message = logMessage;
|
||||||
|
if (client){
|
||||||
|
client.log(clientData);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Service implementations
|
||||||
|
|
||||||
|
let loggly = (customerTokenArg:string,subdomainArg:string) => {
|
||||||
|
client = plugins.loggly.createClient({
|
||||||
|
token: customerTokenArg,
|
||||||
|
subdomain: subdomainArg,
|
||||||
|
tags: ["beautylog-test"],
|
||||||
|
json:true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export let remote = {
|
||||||
|
loggly: loggly
|
||||||
|
};
|
@ -1,7 +1,6 @@
|
|||||||
import "typings-global";
|
import "typings-global";
|
||||||
|
|
||||||
import * as plugins from "./beautylog.plugins";
|
import * as plugins from "./beautylog.plugins";
|
||||||
import * as BeautylogConsole from "./beautylog.console";
|
|
||||||
|
|
||||||
// export classes
|
// export classes
|
||||||
export {Table} from "./beautylog.classes.table";
|
export {Table} from "./beautylog.classes.table";
|
||||||
@ -10,3 +9,4 @@ export {Ora} from "./beautylog.classes.ora";
|
|||||||
// export methods
|
// export methods
|
||||||
export {dir,error,info,log,logReduced,ok,success,warn,newLine} from "./beautylog.log";
|
export {dir,error,info,log,logReduced,ok,success,warn,newLine} from "./beautylog.log";
|
||||||
export {figlet,figletSync} from "./beautylog.figlet";
|
export {figlet,figletSync} from "./beautylog.figlet";
|
||||||
|
export {remote} from "./beautylog.remote";
|
Loading…
Reference in New Issue
Block a user