Skip to content

Commit 0a0c7d1

Browse files
author
alpha.wong
committed
DEL: data field
1 parent 99498ac commit 0a0c7d1

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

README.md

-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ import { logger } from 'insightops-client'
2626
// {
2727
// "event": {
2828
// "message": "hello world",
29-
// "data": {
30-
// "key": "value"
31-
// },
3229
// "stringify": "{\"key\":\"value\"}"
3330
// }
3431
// }

index.js

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const Logger = ({ token, level, message, data }) => {
1919
level,
2020
event: {
2121
message,
22-
data,
2322
stringify: JSON.stringify(data)
2423
}
2524
},

index.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test('fire correct LOG json to insignOps', async () => {
1515
.post('/v1/logs/uuid', {
1616
level: logger.LOG_LEVEL.LOG,
1717
event: {
18-
...requestJSON,
18+
message: requestJSON.message,
1919
stringify: JSON.stringify(requestJSON.data)
2020
}
2121
})
@@ -32,7 +32,7 @@ test('fire correct INFO json to insignOps', async () => {
3232
.post('/v1/logs/uuid', {
3333
level: logger.LOG_LEVEL.INFO,
3434
event: {
35-
...requestJSON,
35+
message: requestJSON.message,
3636
stringify: JSON.stringify(requestJSON.data)
3737
}
3838
})
@@ -49,7 +49,7 @@ test('fire correct WARN json to insignOps', async () => {
4949
.post('/v1/logs/uuid', {
5050
level: logger.LOG_LEVEL.WARN,
5151
event: {
52-
...requestJSON,
52+
message: requestJSON.message,
5353
stringify: JSON.stringify(requestJSON.data)
5454
}
5555
})
@@ -66,7 +66,7 @@ test('fire correct ERROR json to insignOps', async () => {
6666
.post('/v1/logs/uuid', {
6767
level: logger.LOG_LEVEL.ERROR,
6868
event: {
69-
...requestJSON,
69+
message: requestJSON.message,
7070
stringify: JSON.stringify(requestJSON.data)
7171
}
7272
})

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "insightops-client",
3-
"version": "0.0.2",
3+
"version": "0.1.0",
44
"description": "it implements the basic logger function for https://www.rapid7.com/products/insightops/",
55
"main": "index.js",
66
"prettier": "prettier-config-standard",

0 commit comments

Comments
 (0)