Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
76d3926ba4 | |||
0310c03ecb | |||
9e8efc7dea | |||
00e1b8d862 | |||
c5cedb027d | |||
f075f7f23a | |||
809df76043 | |||
d1dde293f6 | |||
b7ee6bb9a6 | |||
15cfa8fe88 | |||
1e222c7ad8 | |||
91a1571635 | |||
2e39906fd2 |
4
.snyk
Normal file
4
.snyk
Normal file
@ -0,0 +1,4 @@
|
||||
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
|
||||
version: v1.12.0
|
||||
ignore: {}
|
||||
patch: {}
|
8
package-lock.json
generated
8
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mojoio/logdna",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.15",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -137,9 +137,9 @@
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartlog-interfaces": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-2.0.0.tgz",
|
||||
"integrity": "sha512-rk3uEp78AXLULS81SUe6YtZvyQiDImuJu/zxnIzzUFDB6ciisqtJ1qVcHYbVsW/kImeo8vBFlQyKY9/YaNgkDw=="
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-2.0.1.tgz",
|
||||
"integrity": "sha512-c9onE52z/5fGX5uEvaI/rXbcC6n7PkLrNjehRM+6JsK7HIbdAzrgY1PGrqUfW0a03hSe03mFcggORID+fQI4tA=="
|
||||
},
|
||||
"@pushrocks/smartpath": {
|
||||
"version": "4.0.1",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mojoio/logdna",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.15",
|
||||
"private": false,
|
||||
"description": "anunoffical package for the logdna api",
|
||||
"main": "dist/index.js",
|
||||
@ -22,7 +22,7 @@
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartlog-interfaces": "^2.0.0",
|
||||
"@pushrocks/smartlog-interfaces": "^2.0.1",
|
||||
"@pushrocks/smartrequest": "^1.1.14",
|
||||
"@pushrocks/smartstring": "^3.0.4",
|
||||
"@pushrocks/taskbuffer": "^2.0.5"
|
||||
|
@ -22,7 +22,7 @@ tap.test('should create a standard log message', async () => {
|
||||
containerName: 'ci-mojoio-logdna',
|
||||
environment: 'test',
|
||||
runtime: 'node',
|
||||
zone: 'ship.zone'
|
||||
zone: 'shipzone'
|
||||
},
|
||||
message: 'this is an awesome log message :)'
|
||||
});
|
||||
|
@ -63,11 +63,14 @@ export class LogdnaMessage {
|
||||
static fromSmartLogPackage(smartlogPackageArg: ILogPackage): LogdnaMessage {
|
||||
return new LogdnaMessage({
|
||||
line: smartlogPackageArg.message,
|
||||
meta: smartlogPackageArg.context,
|
||||
meta: {
|
||||
...smartlogPackageArg.context,
|
||||
logType: smartlogPackageArg.type
|
||||
},
|
||||
env: smartlogPackageArg.context.environment,
|
||||
hostname: smartlogPackageArg.context.zone,
|
||||
level: smartlogPackageArg.level,
|
||||
app: smartlogPackageArg.context.zone,
|
||||
app: smartlogPackageArg.context.containerName,
|
||||
tags: (() => {
|
||||
const tagArray: string[] = [];
|
||||
tagArray.push(smartlogPackageArg.context.company);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as plugins from './logdna.plugins';
|
||||
|
||||
import { LogdnaMessage } from './logdna.classes.logmessage';
|
||||
import { ILogPackage } from '@pushrocks/smartlog-interfaces';
|
||||
import { ILogPackage, ILogDestination } from '@pushrocks/smartlog-interfaces';
|
||||
|
||||
/**
|
||||
* the main logdna account
|
||||
@ -71,7 +71,18 @@ export class LogdnaAccount {
|
||||
/**
|
||||
* convenience function for smartlog
|
||||
*/
|
||||
async sendSmartlogPackage (smartlogPackageArg: ILogPackage) {
|
||||
public async sendSmartlogPackage (smartlogPackageArg: ILogPackage) {
|
||||
this.sendLogDnaMessage(LogdnaMessage.fromSmartLogPackage(smartlogPackageArg));
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a smartlog compatible log destination
|
||||
*/
|
||||
public get smartlogDestination (): ILogDestination {
|
||||
return {
|
||||
handleLog: (logPackageArg) => {
|
||||
this.sendSmartlogPackage(logPackageArg);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user