Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bitdiver/logadapter

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bitdiver/logadapter - npm Package Compare versions

Comparing version 1.4.5 to 1.4.6

34

package.json
{
"name": "@bitdiver/logadapter",
"version": "1.4.5",
"version": "1.4.6",
"description": "",

@@ -38,28 +38,28 @@ "main": "lib/index.js",

"devDependencies": {
"@babel/cli": "7.12.1",
"@babel/core": "7.12.9",
"@babel/node": "7.12.6",
"@babel/plugin-proposal-object-rest-spread": "7.12.1",
"@babel/plugin-transform-runtime": "7.12.1",
"@babel/cli": "7.14.8",
"@babel/core": "7.14.8",
"@babel/node": "7.14.7",
"@babel/plugin-proposal-object-rest-spread": "7.14.7",
"@babel/plugin-transform-runtime": "7.14.5",
"@babel/polyfill": "7.12.1",
"@babel/preset-env": "7.12.7",
"@babel/register": "7.12.1",
"@babel/preset-env": "7.14.8",
"@babel/register": "7.14.5",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.1.0",
"babel-jest": "26.6.3",
"babel-jest": "27.0.6",
"cz-conventional-changelog": "3.3.0",
"eslint": "7.14.0",
"eslint-config-prettier": "6.15.0",
"eslint": "7.31.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-babel": "5.3.1",
"globby": "11.0.1",
"jest": "26.6.3",
"jest-cli": "26.6.3",
"jest": "27.0.6",
"jest-cli": "27.0.6",
"jest-environment-node-debug": "2.0.0",
"prettier": "2.2.1",
"regenerator-runtime": "0.13.7",
"prettier": "2.3.2",
"regenerator-runtime": "0.13.9",
"rimraf": "3.0.2",
"semantic-release": "17.3.0"
"semantic-release": "17.4.4"
},
"dependencies": {
"@babel/runtime": "7.12.5",
"@babel/runtime": "7.14.8",
"mkdirp": "1.0.4",

@@ -66,0 +66,0 @@ "moment": "2.29.1"

import { LogAdapterConsoleJsonElastic } from '../src/index'
test('init LogAdapter: default loglevel', async (done) => {
test('init LogAdapter: default loglevel', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic()
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})
test('init LogAdapter: unknown loglevel init. Should end in default level', async (done) => {
test('init LogAdapter: unknown loglevel init. Should end in default level', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic({ logLevel: 'gum' })
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})
test('init LogAdapter: text loglevel.', async (done) => {
test('init LogAdapter: text loglevel.', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic({ logLevel: 'info' })
expect(logAdapter.level).toEqual('info')
expect(logAdapter.levelNumber).toEqual(1)
done()
})
test('init LogAdapter: number loglevel.', async (done) => {
test('init LogAdapter: number loglevel.', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic({ logLevel: 1 })
expect(logAdapter.level).toEqual('info')
expect(logAdapter.levelNumber).toEqual(1)
done()
})
test('init LogAdapter: number in string.', async (done) => {
test('init LogAdapter: number in string.', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic({ logLevel: '1' })
expect(logAdapter.level).toEqual('info')
expect(logAdapter.levelNumber).toEqual(1)
done()
})
test('init LogAdapter: number > maxlevel.', async (done) => {
test('init LogAdapter: number > maxlevel.', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic({ logLevel: 7 })
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})
test('init LogAdapter: number in string > maxlevel.', async (done) => {
test('init LogAdapter: number in string > maxlevel.', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic({ logLevel: '7' })
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})

@@ -80,3 +73,3 @@

test('LogLevel < level of Logadapter', async (done) => {
test('LogLevel < level of Logadapter', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic()

@@ -100,6 +93,5 @@

expect(res).toEqual([])
done()
})
test('LogLevel >= level of Logadapter', async (done) => {
test('LogLevel >= level of Logadapter', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic()

@@ -124,6 +116,5 @@

expect(res).toEqual([logMessage])
done()
})
test('LogLevel not given. LogAdapter level = error', async (done) => {
test('LogLevel not given. LogAdapter level = error', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic()

@@ -147,6 +138,5 @@

expect(res).toEqual([logMessage])
done()
})
test('LogLevel not given. LogAdapter level = debug', async (done) => {
test('LogLevel not given. LogAdapter level = debug', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic({ logLevel: 0 })

@@ -170,6 +160,5 @@

expect(res).toEqual([logMessage])
done()
})
test('LogLevel not given. LogAdapter level = fatal', async (done) => {
test('LogLevel not given. LogAdapter level = fatal', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic({ logLevel: 4 })

@@ -193,6 +182,5 @@

expect(res).toEqual([])
done()
})
test('log run', async (done) => {
test('log run', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic({ logLevel: 2 })

@@ -218,7 +206,5 @@

expect(res).toEqual([{ ...logMessage, logLevel: 'error' }])
done()
})
test('log test case', async (done) => {
test('log test case', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic({ logLevel: 2 })

@@ -247,6 +233,5 @@

expect(res).toEqual([{ ...logMessage, logLevel: 'error' }])
done()
})
test('log step', async (done) => {
test('log step', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic({ logLevel: 2 })

@@ -276,6 +261,5 @@

expect(res).toEqual([{ ...logMessage, logLevel: 'error' }])
done()
})
test('show log step with json data content', async (done) => {
test('show log step with json data content', async () => {
const logAdapter = new LogAdapterConsoleJsonElastic({ logLevel: 0 })

@@ -300,4 +284,2 @@

await logAdapter.log(logMessage)
done()
})
import { LogAdapterConsoleJson } from '../src/index'
test('init LogAdapter: default loglevel', async (done) => {
test('init LogAdapter: default loglevel', async () => {
const logAdapter = new LogAdapterConsoleJson()
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})
test('init LogAdapter: unknown loglevel init. Should end in default level', async (done) => {
test('init LogAdapter: unknown loglevel init. Should end in default level', async () => {
const logAdapter = new LogAdapterConsoleJson({ logLevel: 'gum' })
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})
test('init LogAdapter: text loglevel.', async (done) => {
test('init LogAdapter: text loglevel.', async () => {
const logAdapter = new LogAdapterConsoleJson({ logLevel: 'info' })
expect(logAdapter.level).toEqual('info')
expect(logAdapter.levelNumber).toEqual(1)
done()
})
test('init LogAdapter: number loglevel.', async (done) => {
test('init LogAdapter: number loglevel.', async () => {
const logAdapter = new LogAdapterConsoleJson({ logLevel: 1 })
expect(logAdapter.level).toEqual('info')
expect(logAdapter.levelNumber).toEqual(1)
done()
})
test('init LogAdapter: number in string.', async (done) => {
test('init LogAdapter: number in string.', async () => {
const logAdapter = new LogAdapterConsoleJson({ logLevel: '1' })
expect(logAdapter.level).toEqual('info')
expect(logAdapter.levelNumber).toEqual(1)
done()
})
test('init LogAdapter: number > maxlevel.', async (done) => {
test('init LogAdapter: number > maxlevel.', async () => {
const logAdapter = new LogAdapterConsoleJson({ logLevel: 7 })
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})
test('init LogAdapter: number in string > maxlevel.', async (done) => {
test('init LogAdapter: number in string > maxlevel.', async () => {
const logAdapter = new LogAdapterConsoleJson({ logLevel: '7' })
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})

@@ -80,3 +73,3 @@

test('LogLevel < level of Logadapter', async (done) => {
test('LogLevel < level of Logadapter', async () => {
const logAdapter = new LogAdapterConsoleJson()

@@ -100,6 +93,5 @@

expect(res).toEqual([])
done()
})
test('LogLevel >= level of Logadapter', async (done) => {
test('LogLevel >= level of Logadapter', async () => {
const logAdapter = new LogAdapterConsoleJson()

@@ -124,6 +116,5 @@

expect(res).toEqual([logMessage])
done()
})
test('LogLevel not given. LogAdapter level = error', async (done) => {
test('LogLevel not given. LogAdapter level = error', async () => {
const logAdapter = new LogAdapterConsoleJson()

@@ -147,6 +138,5 @@

expect(res).toEqual([logMessage])
done()
})
test('LogLevel not given. LogAdapter level = debug', async (done) => {
test('LogLevel not given. LogAdapter level = debug', async () => {
const logAdapter = new LogAdapterConsoleJson({ logLevel: 0 })

@@ -170,6 +160,5 @@

expect(res).toEqual([logMessage])
done()
})
test('LogLevel not given. LogAdapter level = fatal', async (done) => {
test('LogLevel not given. LogAdapter level = fatal', async () => {
const logAdapter = new LogAdapterConsoleJson({ logLevel: 4 })

@@ -193,6 +182,5 @@

expect(res).toEqual([])
done()
})
test('log run', async (done) => {
test('log run', async () => {
const logAdapter = new LogAdapterConsoleJson({ logLevel: 2 })

@@ -218,7 +206,5 @@

expect(res).toEqual([{ ...logMessage, logLevel: 'error' }])
done()
})
test('log test case', async (done) => {
test('log test case', async () => {
const logAdapter = new LogAdapterConsoleJson({ logLevel: 2 })

@@ -247,6 +233,5 @@

expect(res).toEqual([{ ...logMessage, logLevel: 'error' }])
done()
})
test('log step', async (done) => {
test('log step', async () => {
const logAdapter = new LogAdapterConsoleJson({ logLevel: 2 })

@@ -276,3 +261,2 @@

expect(res).toEqual([{ ...logMessage, logLevel: 'error' }])
done()
})
import { LogAdapterConsole } from '../src/index'
test('init LogAdapter: default loglevel', async (done) => {
test('init LogAdapter: default loglevel', async () => {
const logAdapter = new LogAdapterConsole()
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})
test('init LogAdapter: unknown loglevel init. Should end in default level', async (done) => {
test('init LogAdapter: unknown loglevel init. Should end in default level', async () => {
const logAdapter = new LogAdapterConsole({ logLevel: 'gum' })
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})
test('init LogAdapter: text loglevel.', async (done) => {
test('init LogAdapter: text loglevel.', async () => {
const logAdapter = new LogAdapterConsole({ logLevel: 'info' })
expect(logAdapter.level).toEqual('info')
expect(logAdapter.levelNumber).toEqual(1)
done()
})
test('init LogAdapter: number loglevel.', async (done) => {
test('init LogAdapter: number loglevel.', async () => {
const logAdapter = new LogAdapterConsole({ logLevel: 1 })
expect(logAdapter.level).toEqual('info')
expect(logAdapter.levelNumber).toEqual(1)
done()
})
test('init LogAdapter: number in string.', async (done) => {
test('init LogAdapter: number in string.', async () => {
const logAdapter = new LogAdapterConsole({ logLevel: '1' })
expect(logAdapter.level).toEqual('info')
expect(logAdapter.levelNumber).toEqual(1)
done()
})
test('init LogAdapter: number > maxlevel.', async (done) => {
test('init LogAdapter: number > maxlevel.', async () => {
const logAdapter = new LogAdapterConsole({ logLevel: 7 })
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})
test('init LogAdapter: number in string > maxlevel.', async (done) => {
test('init LogAdapter: number in string > maxlevel.', async () => {
const logAdapter = new LogAdapterConsole({ logLevel: '7' })
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})

@@ -80,3 +73,3 @@

test('LogLevel < level of Logadapter', async (done) => {
test('LogLevel < level of Logadapter', async () => {
const logAdapter = new LogAdapterConsole()

@@ -100,6 +93,5 @@

expect(res).toEqual([])
done()
})
test('LogLevel >= level of Logadapter', async (done) => {
test('LogLevel >= level of Logadapter', async () => {
const logAdapter = new LogAdapterConsole()

@@ -124,6 +116,5 @@

expect(res).toEqual([logMessage])
done()
})
test('LogLevel not given. LogAdapter level = error', async (done) => {
test('LogLevel not given. LogAdapter level = error', async () => {
const logAdapter = new LogAdapterConsole()

@@ -147,6 +138,5 @@

expect(res).toEqual([logMessage])
done()
})
test('LogLevel not given. LogAdapter level = debug', async (done) => {
test('LogLevel not given. LogAdapter level = debug', async () => {
const logAdapter = new LogAdapterConsole({ logLevel: 0 })

@@ -170,6 +160,5 @@

expect(res).toEqual([logMessage])
done()
})
test('LogLevel not given. LogAdapter level = fatal', async (done) => {
test('LogLevel not given. LogAdapter level = fatal', async () => {
const logAdapter = new LogAdapterConsole({ logLevel: 4 })

@@ -193,6 +182,5 @@

expect(res).toEqual([])
done()
})
test('log run', async (done) => {
test('log run', async () => {
const logAdapter = new LogAdapterConsole({ logLevel: 2 })

@@ -228,6 +216,5 @@

expect(resStep).toEqual([])
done()
})
test('log test case', async (done) => {
test('log test case', async () => {
const logAdapter = new LogAdapterConsole({ logLevel: 2 })

@@ -266,6 +253,5 @@

expect(resStep).toEqual([])
done()
})
test('log step', async (done) => {
test('log step', async () => {
const logAdapter = new LogAdapterConsole({ logLevel: 2 })

@@ -305,3 +291,2 @@

expect(resStep).toEqual([{ ...logMessage, logLevel: 'error' }])
done()
})

@@ -15,3 +15,3 @@ import { LogAdapterFile } from '../src/index'

test('Log Message Run', async (done) => {
test('Log Message Run', async () => {
const logAdapter = new LogAdapterFile({

@@ -52,6 +52,5 @@ targetDir: LOG_PATH,

])
done()
})
test('Log Message Testcase', async (done) => {
test('Log Message Testcase', async () => {
const logAdapter = new LogAdapterFile({

@@ -102,6 +101,5 @@ targetDir: LOG_PATH,

])
done()
})
test('Log Message Step', async (done) => {
test('Log Message Step', async () => {
const logAdapter = new LogAdapterFile({

@@ -160,3 +158,2 @@ targetDir: LOG_PATH,

])
done()
})
import { LogAdapterMemory } from '../src/index'
test('init LogAdapter: default loglevel', async (done) => {
test('init LogAdapter: default loglevel', async () => {
const logAdapter = new LogAdapterMemory()
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})
test('init LogAdapter: unknown loglevel init. Should end in default level', async (done) => {
test('init LogAdapter: unknown loglevel init. Should end in default level', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: 'gum' })
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})
test('init LogAdapter: text loglevel.', async (done) => {
test('init LogAdapter: text loglevel.', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: 'info' })
expect(logAdapter.level).toEqual('info')
expect(logAdapter.levelNumber).toEqual(1)
done()
})
test('init LogAdapter: number loglevel.', async (done) => {
test('init LogAdapter: number loglevel.', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: 1 })
expect(logAdapter.level).toEqual('info')
expect(logAdapter.levelNumber).toEqual(1)
done()
})
test('init LogAdapter: number in string.', async (done) => {
test('init LogAdapter: number in string.', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: '1' })
expect(logAdapter.level).toEqual('info')
expect(logAdapter.levelNumber).toEqual(1)
done()
})
test('init LogAdapter: number > maxlevel.', async (done) => {
test('init LogAdapter: number > maxlevel.', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: 7 })
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})
test('init LogAdapter: number in string > maxlevel.', async (done) => {
test('init LogAdapter: number in string > maxlevel.', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: '7' })
expect(logAdapter.level).toEqual('error')
expect(logAdapter.levelNumber).toEqual(3)
done()
})

@@ -80,3 +73,3 @@

test('LogLevel < level of Logadapter', async (done) => {
test('LogLevel < level of Logadapter', async () => {
const logAdapter = new LogAdapterMemory()

@@ -100,6 +93,5 @@

expect(res).toEqual([])
done()
})
test('LogLevel >= level of Logadapter', async (done) => {
test('LogLevel >= level of Logadapter', async () => {
const logAdapter = new LogAdapterMemory()

@@ -124,6 +116,5 @@

expect(res).toEqual([logMessage])
done()
})
test('LogLevel not given. LogAdapter level = error', async (done) => {
test('LogLevel not given. LogAdapter level = error', async () => {
const logAdapter = new LogAdapterMemory()

@@ -147,6 +138,5 @@

expect(res).toEqual([logMessage])
done()
})
test('LogLevel not given. LogAdapter level = debug', async (done) => {
test('LogLevel not given. LogAdapter level = debug', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: 0 })

@@ -170,6 +160,5 @@

expect(res).toEqual([logMessage])
done()
})
test('LogLevel not given. LogAdapter level = fatal', async (done) => {
test('LogLevel not given. LogAdapter level = fatal', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: 4 })

@@ -193,6 +182,5 @@

expect(res).toEqual([])
done()
})
test('log run', async (done) => {
test('log run', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: 2 })

@@ -228,6 +216,5 @@

expect(resStep).toEqual([])
done()
})
test('log test case', async (done) => {
test('log test case', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: 2 })

@@ -266,6 +253,5 @@

expect(resStep).toEqual([])
done()
})
test('log step', async (done) => {
test('log step', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: 2 })

@@ -305,6 +291,5 @@

expect(resStep).toEqual([{ ...logMessage, logLevel: 'error' }])
done()
})
test('Test reset and log step', async (done) => {
test('Test reset and log step', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: 2 })

@@ -360,7 +345,5 @@

expect(logAdapter.logs).toEqual({})
done()
})
test('Test log run', async (done) => {
test('Test log run', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: 2 })

@@ -391,7 +374,5 @@

expect(logAdapter.logs).toEqual({})
done()
})
test('Test log test case', async (done) => {
test('Test log test case', async () => {
const logAdapter = new LogAdapterMemory({ logLevel: 2 })

@@ -442,4 +423,2 @@

expect(logAdapter.logs).toEqual({})
done()
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc