fix README

This commit is contained in:
Philipp Kunz 2016-07-24 01:30:30 +02:00
parent 35fd765546
commit ba6dbc3915
4 changed files with 38 additions and 30 deletions

View File

@ -75,18 +75,12 @@ Currently supported remote providers:
* loggly.com * loggly.com
```typescript ```typescript
beautylog.remote.loggly( beautylog.remote.loggly({
token: "your-really-long-input-token", customerTokenArg: "loggly-token",
subdomain: "your-subdomain", subdomainArg: "loggly-subdomain",
auth: { appName: "some App Name",
username: "your-username", serverName: "some Server Name"
password: "your-password" });
},
//
// Optional: Tag to send with EVERY log message
//
tags: ['global-tag']
);
``` ```
> Note: since beautylog monkeypatches all console log methods. > Note: since beautylog monkeypatches all console log methods.

View File

@ -1,4 +1,9 @@
export declare let remoteLog: (logType: string, logMessage: string) => void; export declare let remoteLog: (logType: string, logMessage: string) => void;
export declare let remote: { export declare let remote: {
loggly: (customerTokenArg: string, subdomainArg: string) => void; loggly: (optionsArg: {
customerTokenArg: string;
subdomainArg: string;
appName: string;
serverName: string;
}) => void;
}; };

View File

@ -16,15 +16,17 @@ exports.remoteLog = (logType, logMessage) => {
; ;
}; };
// Service implementations // Service implementations
let loggly = (customerTokenArg, subdomainArg) => { let loggly = (optionsArg) => {
client = plugins.loggly.createClient({ client = plugins.loggly.createClient({
token: customerTokenArg, token: optionsArg.customerTokenArg,
subdomain: subdomainArg, subdomain: optionsArg.subdomainArg,
tags: ["beautylog-test"], tags: [],
json: true json: true
}); });
clientData.applicationName = optionsArg.appName;
clientData.serverName = optionsArg.serverName;
}; };
exports.remote = { exports.remote = {
loggly: loggly loggly: loggly
}; };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVhdXR5bG9nLnJlbW90ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2JlYXV0eWxvZy5yZW1vdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE1BQVksT0FBTyxXQUFNLHFCQUFxQixDQU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ifQ==

View File

@ -2,28 +2,35 @@ import * as plugins from "./beautylog.plugins";
let client; let client;
let clientData = { let clientData = {
serverName:"myServer", serverName: "myServer",
applicationName:"myApp", applicationName: "myApp",
message:"undefined", message: "undefined",
messageType:"undefined" messageType: "undefined"
} }
export let remoteLog = (logType:string,logMessage:string) => { export let remoteLog = (logType: string, logMessage: string) => {
clientData.messageType = logType; clientData.messageType = logType;
clientData.message = logMessage; clientData.message = logMessage;
if (client){ if (client) {
client.log(clientData); client.log(clientData);
}; };
} }
// Service implementations // Service implementations
let loggly = (customerTokenArg:string,subdomainArg:string) => { let loggly = (optionsArg: {
customerTokenArg: string,
subdomainArg: string,
appName: string,
serverName:string
}) => {
client = plugins.loggly.createClient({ client = plugins.loggly.createClient({
token: customerTokenArg, token: optionsArg.customerTokenArg,
subdomain: subdomainArg, subdomain: optionsArg.subdomainArg,
tags: ["beautylog-test"], tags: [],
json:true json: true
}); });
clientData.applicationName = optionsArg.appName;
clientData.serverName = optionsArg.serverName;
} }
export let remote = { export let remote = {