Compare commits

..

10 Commits

Author SHA1 Message Date
0310c03ecb 1.0.14 2018-11-04 15:37:55 +01:00
9e8efc7dea fix(core): update 2018-11-04 15:37:55 +01:00
00e1b8d862 1.0.13 2018-11-04 15:25:27 +01:00
c5cedb027d fix(core): update 2018-11-04 15:25:27 +01:00
f075f7f23a 1.0.12 2018-11-04 14:56:25 +01:00
809df76043 fix(core): update 2018-11-04 14:56:25 +01:00
d1dde293f6 1.0.11 2018-11-04 14:24:13 +01:00
b7ee6bb9a6 fix(smartlog): add getSmartlogDestination() 2018-11-04 14:24:12 +01:00
15cfa8fe88 1.0.10 2018-11-04 02:41:46 +01:00
1e222c7ad8 fix(core): update 2018-11-04 02:41:45 +01:00
5 changed files with 21 additions and 10 deletions

8
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@mojoio/logdna", "name": "@mojoio/logdna",
"version": "1.0.9", "version": "1.0.14",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -137,9 +137,9 @@
} }
}, },
"@pushrocks/smartlog-interfaces": { "@pushrocks/smartlog-interfaces": {
"version": "2.0.0", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-2.0.0.tgz", "resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-2.0.1.tgz",
"integrity": "sha512-rk3uEp78AXLULS81SUe6YtZvyQiDImuJu/zxnIzzUFDB6ciisqtJ1qVcHYbVsW/kImeo8vBFlQyKY9/YaNgkDw==" "integrity": "sha512-c9onE52z/5fGX5uEvaI/rXbcC6n7PkLrNjehRM+6JsK7HIbdAzrgY1PGrqUfW0a03hSe03mFcggORID+fQI4tA=="
}, },
"@pushrocks/smartpath": { "@pushrocks/smartpath": {
"version": "4.0.1", "version": "4.0.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@mojoio/logdna", "name": "@mojoio/logdna",
"version": "1.0.9", "version": "1.0.14",
"private": false, "private": false,
"description": "anunoffical package for the logdna api", "description": "anunoffical package for the logdna api",
"main": "dist/index.js", "main": "dist/index.js",
@ -22,7 +22,7 @@
"tslint-config-prettier": "^1.15.0" "tslint-config-prettier": "^1.15.0"
}, },
"dependencies": { "dependencies": {
"@pushrocks/smartlog-interfaces": "^2.0.0", "@pushrocks/smartlog-interfaces": "^2.0.1",
"@pushrocks/smartrequest": "^1.1.14", "@pushrocks/smartrequest": "^1.1.14",
"@pushrocks/smartstring": "^3.0.4", "@pushrocks/smartstring": "^3.0.4",
"@pushrocks/taskbuffer": "^2.0.5" "@pushrocks/taskbuffer": "^2.0.5"

View File

@ -22,7 +22,7 @@ tap.test('should create a standard log message', async () => {
containerName: 'ci-mojoio-logdna', containerName: 'ci-mojoio-logdna',
environment: 'test', environment: 'test',
runtime: 'node', runtime: 'node',
zone: 'ship.zone' zone: 'shipzone'
}, },
message: 'this is an awesome log message :)' message: 'this is an awesome log message :)'
}); });

View File

@ -70,7 +70,7 @@ export class LogdnaMessage {
env: smartlogPackageArg.context.environment, env: smartlogPackageArg.context.environment,
hostname: smartlogPackageArg.context.zone, hostname: smartlogPackageArg.context.zone,
level: smartlogPackageArg.level, level: smartlogPackageArg.level,
app: smartlogPackageArg.context.zone, app: smartlogPackageArg.context.containerName,
tags: (() => { tags: (() => {
const tagArray: string[] = []; const tagArray: string[] = [];
tagArray.push(smartlogPackageArg.context.company); tagArray.push(smartlogPackageArg.context.company);

View File

@ -1,7 +1,7 @@
import * as plugins from './logdna.plugins'; import * as plugins from './logdna.plugins';
import { LogdnaMessage } from './logdna.classes.logmessage'; import { LogdnaMessage } from './logdna.classes.logmessage';
import { ILogPackage } from '@pushrocks/smartlog-interfaces'; import { ILogPackage, ILogDestination } from '@pushrocks/smartlog-interfaces';
/** /**
* the main logdna account * the main logdna account
@ -71,7 +71,18 @@ export class LogdnaAccount {
/** /**
* convenience function for smartlog * convenience function for smartlog
*/ */
async sendSmartlogPackage (smartlogPackageArg: ILogPackage) { public async sendSmartlogPackage (smartlogPackageArg: ILogPackage) {
this.sendLogDnaMessage(LogdnaMessage.fromSmartLogPackage(smartlogPackageArg)); this.sendLogDnaMessage(LogdnaMessage.fromSmartLogPackage(smartlogPackageArg));
} }
/**
* returns a smartlog compatible log destination
*/
public get smartlogDestination (): ILogDestination {
return {
handleLog: (logPackageArg) => {
this.sendSmartlogPackage(logPackageArg);
}
};
}
} }