diff --git a/.gitignore b/.gitignore index 1823973c12a7643dccd73111974696c0572706cc..2771490a5027cf8dc13e4960802f749751bda663 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -node_modules -samples/file.log -coverage/ -mochawesome-report/ -.nyc_output/ \ No newline at end of file +node_modules +samples/file.log +coverage/ +stryker.log +*.DS_Store diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6588ee3ed6da17cb354eaef713a9d10e07afa567..ce58add837852dfaff30cba60291f8543c59092a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,17 @@ image: node:latest include: + - project: 'general/templates' + file: '/cicd/SAST-nodejs.gitlab-ci.yml' - project: 'general/templates' file: '/cicd/npm-audit.gitlab-ci.yml' - project: 'general/templates' file: '/cicd/sonarqube.gitlab-ci.yml' +variables: + SONAR_PROJECT_KEY: argos-log + SONAR_TOKEN: 11922a8e774494f51e1d2f0e695949e4073e7df8 + cache: paths: @@ -14,6 +20,7 @@ cache: stages: - build - test + - quality build: stage: build @@ -29,6 +36,4 @@ test: artifacts: paths: - docs/test-report.html - - docs/junit.xml - reports: - junit: docs/junit.xml + - docs/coverage/lcov.info diff --git a/README.md b/README.md index f9752bef668752352da8bca47651c7529eea361c..032cfc6531087285012eb60530a78b160ea4cc8d 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,51 @@ -# log.js - -A real simple logger application. -May Optional Log to A File. - -## Installation -`npm install --save git+ssh://git@it-devops-01.br-edv.brnet.int:argos/log.git` - -## Usage - -`const Log = require('log')` -`let log = new Log(options)` - -Note: The options Part may be omitted, as all parts are optional, but using the name is recommended, as without it, the package-name will be used - -### Methods - -* `log.info('This is an Information' )` -* `log.notice('This is a Notice' )` -* `log.warn('This is a Warning' )` -* `log.error('This is an Error' )` -* `log.fatal('This is a Fatal Message' )` -* `log.debug('This is a Debug Message' )` - -### Options - -```json -{ - name: 'Name of App. Default: Name of BaseFolder', - hostname: 'Server Hostname, Default: os.hostname()', - file: 'File to Append Log to', - path: 'Path Logfile located', - loglevel: 'Minimal LogLevel. Default: WARN' -} +# log + + +[](https://it-devops-01.br-edv.brnet.int/general/log/commits/master) +[](https://it-devops-01.br-edv.brnet.int/general/log/commits/master) +[](https://it-devops-01.br-edv.brnet.int:8999/dashboard?id=argos-log) + +A real simple logger application. +May Optional Log to A File and a graylog-server. + +## Installation + +- `npm config set @br:registry https://it-devops-01:4873` +- `npm install --save @br/config` + +## Usage + +`const Log = require('@br/log')` +`let log = new Log(options)` + +Note: The options Part may be omitted, as all parts are optional, but using the name is recommended, as without it, the package-name will be used + +### Methods + +* `log.info('This is an Information' )` +* `log.notice('This is a Notice' )` +* `log.warn('This is a Warning' )` +* `log.error('This is an Error' )` +* `log.fatal('This is a Fatal Message' )` +* `log.debug('This is a Debug Message' )` + +### Options + +```json +{ + name: 'Name of App. Default: Name of BaseFolder', + hostname: 'Server Hostname, Default: os.hostname()', + file: 'File to Append Log to', + graylog: { + active: 'true or false', + servers: [ + { + server: 'graylog-server', + port: 'graylog-port' + } + ] + }, + path: 'Path Logfile located', + loglevel: 'Minimal LogLevel. Default: WARN' +} ``` \ No newline at end of file diff --git a/samples/all-options.js b/examples/all-options.js similarity index 100% rename from samples/all-options.js rename to examples/all-options.js diff --git a/samples/log-to-file.js b/examples/log-to-file.js similarity index 100% rename from samples/log-to-file.js rename to examples/log-to-file.js diff --git a/samples/no-options.js b/examples/no-options.js similarity index 100% rename from samples/no-options.js rename to examples/no-options.js diff --git a/index.d.ts b/index.d.ts index 9966c27ed20c5be15edd23578b48cf3c7e489c74..7f0df8c3c3716208971fb7fd031e3eed19f3a34a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,7 @@ -/** Declaration file generated by dts-gen */ - -export = ./index; - +declare module 'Log' { + export function info(message: string): string; + export function notice(message: string): string; + export function debug(message: string): string; + export function warning(message: string): string; + export function log(message: string): string; +} diff --git a/index.js b/index.js index c2e6e086c14144e6f1a6050867b43d63be4edff9..86b9f5d66b89a54da0a552ab8d565922d582fa81 100644 --- a/index.js +++ b/index.js @@ -43,6 +43,15 @@ function Log (options) { } } } + if (this.options.graylog && this.options.graylog.active) { + this.graylog2 = require('graylog2') + this.graylogger = new this.graylog2.graylog({ // eslint-disable-line new-cap + servers: this.options.graylog.servers, + hostname: this.hostname, + facility: this.name + }) + } + this.info = function (message) { if (this.loglevel >= this.levels.INFO) { return this.log('INFO', message) @@ -116,6 +125,30 @@ function Log (options) { } }) } + if (this.options.graylog && this.options.graylog.active) { + switch (tag) { + case 'INFO': + this.graylogger.info(message) + break + case 'NOTICE': + this.graylogger.notice(message) + break + case 'WARN': + this.graylogger.warning(message) + break + case 'ERROR': + this.graylogger.error(message) + break + case 'FATAL': + this.graylogger.critical(message) + break + case 'DEBUG': + this.graylogger.debug(message) + break + default: + this.graylogger.notice(message) + } + } return msg } this.getDate = function () { diff --git a/tests/index.test.js b/index.test.js similarity index 86% rename from tests/index.test.js rename to index.test.js index e6868f4223592782b350d109d5de8b9c796cdefe..324e019be4dc5de8068c8ff528b68e201d2b779d 100644 --- a/tests/index.test.js +++ b/index.test.js @@ -1,313 +1,313 @@ -/* global it, describe, beforeEach, afterEach */ -const assert = require('assert') -const os = require('os') -const path = require('path') -const fs = require('fs') -const LOG = require(path.join(__dirname, '../index.js')) -const hostname = os.hostname() -function getDate () { - var tzoffset = (new Date()).getTimezoneOffset() * 60000 // offset in milliseconds - var localISOTime = (new Date(Date.now() - tzoffset)).toISOString().slice(0, -1) - return localISOTime.split('.')[0].trim() -} -const manualhostname = 'testhost' -const name = 'testapp' -let file = 'testfile' -const filePath = '/tmp' - -let orginialFile -let log -let line -let testline -describe('Log.js', () => { - describe(': No Options', () => { - beforeEach(() => { - console.log('create Object') - log = new LOG() - }) - afterEach(() => { - console.log('destroy Object') - log = undefined - }) - describe(': Info', () => { - it('should output empty line - standard log-level without options is warn', () => { - line = log.info('testline') - assert.equal(line, '') - }) - }) - describe(': Notice', () => { - it('should output empty line - standard log-level without options is warn', () => { - line = log.notice('testline') - assert.equal(line, '') - }) - }) - describe(': Warn', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + hostname + '\tlib-log\tWARN\ttestline' - line = log.warn('testline') - assert.equal(line, testline) - }) - }) - describe(': Error', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + hostname + '\tlib-log\tERROR\ttestline' - line = log.error('testline') - assert.equal(line, testline) - }) - }) - describe(': Fatal', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + hostname + '\tlib-log\tFATAL\ttestline' - line = log.fatal('testline') - assert.equal(line, testline) - }) - }) - describe(': Debug', () => { - it('should output the given Line', () => { - line = log.debug('testline') - assert.equal(line, '') - }) - }) - }) - describe(': Hostname Set', () => { - beforeEach(() => { - console.log('create Object') - log = new LOG({ - hostname: manualhostname - }) - }) - afterEach(() => { - console.log('destroy Object') - log = undefined - }) - describe(': Info', () => { - it('should output the given Line', () => { - line = log.info('testline') - assert.equal(line, '') - }) - }) - describe(': Notice', () => { - it('should output the given Line', () => { - line = log.notice('testline') - assert.equal(line, '') - }) - }) - describe(': Warn', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + manualhostname + '\tlib-log\tWARN\ttestline' - line = log.warn('testline') - assert.equal(line, testline) - }) - }) - describe(': Error', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + manualhostname + '\tlib-log\tERROR\ttestline' - line = log.error('testline') - assert.equal(line, testline) - }) - }) - describe(': Fatal', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + manualhostname + '\tlib-log\tFATAL\ttestline' - line = log.fatal('testline') - assert.equal(line, testline) - }) - }) - describe(': Debug', () => { - it('should output the given Line', () => { - line = log.debug('testline') - assert.equal(line, '') - }) - }) - }) - describe(': Name Set', () => { - beforeEach(() => { - console.log('create Object') - log = new LOG({ - name: name - }) - }) - afterEach(() => { - console.log('destroy Object') - log = undefined - }) - describe(': Info', () => { - it('should output the given Line', () => { - line = log.info('testline') - assert.equal(line, '') - }) - }) - describe(': Notice', () => { - it('should output the given Line', () => { - line = log.notice('testline') - assert.equal(line, '') - }) - }) - describe(': Warn', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + hostname + '\t' + name + '\tWARN\ttestline' - line = log.warn('testline') - assert.equal(line, testline) - }) - }) - describe(': Error', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + hostname + '\t' + name + '\tERROR\ttestline' - line = log.error('testline') - assert.equal(line, testline) - }) - }) - describe(': Fatal', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + hostname + '\t' + name + '\tFATAL\ttestline' - line = log.fatal('testline') - assert.equal(line, testline) - }) - }) - describe(': Debug', () => { - it('should output the given Line', () => { - line = log.debug('testline') - assert.equal(line, '') - }) - }) - }) - describe(': File Set', () => { - beforeEach(() => { - console.log('create Object') - log = new LOG({ - path: filePath, - file: file - }) - orginialFile = file - file = path.join(filePath, file) - try { - fs.accessSync(file, fs.constants.R_OK | fs.constants.W_OK) - } catch (error) { - fs.writeFileSync(file, '', { flag: 'wx' }) // Create File if not exists - } - }) - afterEach(() => { - console.log('destroy Object') - log = undefined - fs.truncateSync(file) // Clean Up, clear contents - file = orginialFile - }) - describe(': Info', () => { - it('should output the given Line to the file', function (done) { - log.info('testline') - setTimeout(() => { - line = fs.readFileSync(file, 'utf-8') - assert.equal(line, '') - done() - }, 10) - }) - }) - describe(': Notice', () => { - it('should output the given Line to the file', function (done) { - log.notice('testline') - setTimeout(() => { - line = fs.readFileSync(file, 'utf-8') - assert.equal(line, '') - done() - }, 10) - }) - }) - describe(': Warn', () => { - it('should output the given Line to the file', function (done) { - testline = getDate() + '\t' + hostname + '\tlib-log\tWARN\ttestline\n' - log.warn('testline') - setTimeout(() => { - line = fs.readFileSync(file, 'utf-8') - assert.equal(line, testline) - done() - }, 10) - }) - }) - describe(': Error', () => { - it('should output the given Line to the file', function (done) { - testline = getDate() + '\t' + hostname + '\tlib-log\tERROR\ttestline\n' - log.error('testline') - setTimeout(() => { - line = fs.readFileSync(file, 'utf-8') - assert.equal(line, testline) - done() - }, 10) - }) - }) - describe(': Fatal', () => { - it('should output the given Line to the file', function (done) { - testline = getDate() + '\t' + hostname + '\tlib-log\tFATAL\ttestline\n' - log.fatal('testline') - setTimeout(() => { - line = fs.readFileSync(file, 'utf-8') - assert.equal(line, testline) - done() - }, 10) - }) - }) - describe(': Debug', () => { - it('should output the given Line to the file', function (done) { - log.debug('testline') - setTimeout(() => { - line = fs.readFileSync(file, 'utf-8') - assert.equal(line, '') - done() - }, 10) - }) - }) - }) - describe(': Loglevel DEBUG Set', () => { - beforeEach(() => { - console.log('create Object') - log = new LOG({ - loglevel: 'DEBUG' - }) - }) - afterEach(() => { - console.log('destroy Object') - log = undefined - }) - describe(': Info', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + hostname + '\tlib-log\tINFO\ttestline' - line = log.info('testline') - assert.equal(line, testline) - }) - }) - describe(': Notice', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + hostname + '\tlib-log\tNOTICE\ttestline' - line = log.notice('testline') - assert.equal(line, testline) - }) - }) - describe(': Warn', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + hostname + '\tlib-log\tWARN\ttestline' - line = log.warn('testline') - assert.equal(line, testline) - }) - }) - describe(': Error', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + hostname + '\tlib-log\tERROR\ttestline' - line = log.error('testline') - assert.equal(line, testline) - }) - }) - describe(': Fatal', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + hostname + '\tlib-log\tFATAL\ttestline' - line = log.fatal('testline') - assert.equal(line, testline) - }) - }) - describe(': Debug', () => { - it('should output the given Line', () => { - testline = getDate() + '\t' + hostname + '\tlib-log\tDEBUG\ttestline' - line = log.debug('testline') - assert.equal(line, testline) - }) - }) - }) -}) +/* global it, describe, beforeEach, afterEach */ +const assert = require('assert') +const os = require('os') +const path = require('path') +const fs = require('fs') +const LOG = require('./index') +const hostname = os.hostname() +function getDate () { + var tzoffset = (new Date()).getTimezoneOffset() * 60000 // offset in milliseconds + var localISOTime = (new Date(Date.now() - tzoffset)).toISOString().slice(0, -1) + return localISOTime.split('.')[0].trim() +} +const manualhostname = 'testhost' +const name = 'testapp' +let file = 'testfile' +const filePath = '/tmp' + +let orginialFile +let log +let line +let testline +describe('@br/Log', () => { + describe(': No Options', () => { + beforeEach(() => { + console.log('create Object') + log = new LOG() + }) + afterEach(() => { + console.log('destroy Object') + log = undefined + }) + describe(': Info', () => { + it('should output empty line - standard log-level without options is warn', () => { + line = log.info('testline') + assert.equal(line, '') + }) + }) + describe(': Notice', () => { + it('should output empty line - standard log-level without options is warn', () => { + line = log.notice('testline') + assert.equal(line, '') + }) + }) + describe(': Warn', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + hostname + '\t@br/log\tWARN\ttestline' + line = log.warn('testline') + assert.equal(line, testline) + }) + }) + describe(': Error', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + hostname + '\t@br/log\tERROR\ttestline' + line = log.error('testline') + assert.equal(line, testline) + }) + }) + describe(': Fatal', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + hostname + '\t@br/log\tFATAL\ttestline' + line = log.fatal('testline') + assert.equal(line, testline) + }) + }) + describe(': Debug', () => { + it('should output the given Line', () => { + line = log.debug('testline') + assert.equal(line, '') + }) + }) + }) + describe(': Hostname Set', () => { + beforeEach(() => { + console.log('create Object') + log = new LOG({ + hostname: manualhostname + }) + }) + afterEach(() => { + console.log('destroy Object') + log = undefined + }) + describe(': Info', () => { + it('should output the given Line', () => { + line = log.info('testline') + assert.equal(line, '') + }) + }) + describe(': Notice', () => { + it('should output the given Line', () => { + line = log.notice('testline') + assert.equal(line, '') + }) + }) + describe(': Warn', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + manualhostname + '\t@br/log\tWARN\ttestline' + line = log.warn('testline') + assert.equal(line, testline) + }) + }) + describe(': Error', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + manualhostname + '\t@br/log\tERROR\ttestline' + line = log.error('testline') + assert.equal(line, testline) + }) + }) + describe(': Fatal', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + manualhostname + '\t@br/log\tFATAL\ttestline' + line = log.fatal('testline') + assert.equal(line, testline) + }) + }) + describe(': Debug', () => { + it('should output the given Line', () => { + line = log.debug('testline') + assert.equal(line, '') + }) + }) + }) + describe(': Name Set', () => { + beforeEach(() => { + console.log('create Object') + log = new LOG({ + name: name + }) + }) + afterEach(() => { + console.log('destroy Object') + log = undefined + }) + describe(': Info', () => { + it('should output the given Line', () => { + line = log.info('testline') + assert.equal(line, '') + }) + }) + describe(': Notice', () => { + it('should output the given Line', () => { + line = log.notice('testline') + assert.equal(line, '') + }) + }) + describe(': Warn', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + hostname + '\t' + name + '\tWARN\ttestline' + line = log.warn('testline') + assert.equal(line, testline) + }) + }) + describe(': Error', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + hostname + '\t' + name + '\tERROR\ttestline' + line = log.error('testline') + assert.equal(line, testline) + }) + }) + describe(': Fatal', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + hostname + '\t' + name + '\tFATAL\ttestline' + line = log.fatal('testline') + assert.equal(line, testline) + }) + }) + describe(': Debug', () => { + it('should output the given Line', () => { + line = log.debug('testline') + assert.equal(line, '') + }) + }) + }) + describe(': File Set', () => { + beforeEach(() => { + console.log('create Object') + log = new LOG({ + path: filePath, + file: file + }) + orginialFile = file + file = path.join(filePath, file) + try { + fs.accessSync(file, fs.constants.R_OK | fs.constants.W_OK) + } catch (error) { + fs.writeFileSync(file, '', { flag: 'wx' }) // Create File if not exists + } + }) + afterEach(() => { + console.log('destroy Object') + log = undefined + fs.truncateSync(file) // Clean Up, clear contents + file = orginialFile + }) + describe(': Info', () => { + it('should output the given Line to the file', function (done) { + log.info('testline') + setTimeout(() => { + line = fs.readFileSync(file, 'utf-8') + assert.equal(line, '') + done() + }, 10) + }) + }) + describe(': Notice', () => { + it('should output the given Line to the file', function (done) { + log.notice('testline') + setTimeout(() => { + line = fs.readFileSync(file, 'utf-8') + assert.equal(line, '') + done() + }, 10) + }) + }) + describe(': Warn', () => { + it('should output the given Line to the file', function (done) { + testline = getDate() + '\t' + hostname + '\t@br/log\tWARN\ttestline\n' + log.warn('testline') + setTimeout(() => { + line = fs.readFileSync(file, 'utf-8') + assert.equal(line, testline) + done() + }, 10) + }) + }) + describe(': Error', () => { + it('should output the given Line to the file', function (done) { + testline = getDate() + '\t' + hostname + '\t@br/log\tERROR\ttestline\n' + log.error('testline') + setTimeout(() => { + line = fs.readFileSync(file, 'utf-8') + assert.equal(line, testline) + done() + }, 10) + }) + }) + describe(': Fatal', () => { + it('should output the given Line to the file', function (done) { + testline = getDate() + '\t' + hostname + '\t@br/log\tFATAL\ttestline\n' + log.fatal('testline') + setTimeout(() => { + line = fs.readFileSync(file, 'utf-8') + assert.equal(line, testline) + done() + }, 10) + }) + }) + describe(': Debug', () => { + it('should output the given Line to the file', function (done) { + log.debug('testline') + setTimeout(() => { + line = fs.readFileSync(file, 'utf-8') + assert.equal(line, '') + done() + }, 10) + }) + }) + }) + describe(': Loglevel DEBUG Set', () => { + beforeEach(() => { + console.log('create Object') + log = new LOG({ + loglevel: 'DEBUG' + }) + }) + afterEach(() => { + console.log('destroy Object') + log = undefined + }) + describe(': Info', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + hostname + '\t@br/log\tINFO\ttestline' + line = log.info('testline') + assert.equal(line, testline) + }) + }) + describe(': Notice', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + hostname + '\t@br/log\tNOTICE\ttestline' + line = log.notice('testline') + assert.equal(line, testline) + }) + }) + describe(': Warn', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + hostname + '\t@br/log\tWARN\ttestline' + line = log.warn('testline') + assert.equal(line, testline) + }) + }) + describe(': Error', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + hostname + '\t@br/log\tERROR\ttestline' + line = log.error('testline') + assert.equal(line, testline) + }) + }) + describe(': Fatal', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + hostname + '\t@br/log\tFATAL\ttestline' + line = log.fatal('testline') + assert.equal(line, testline) + }) + }) + describe(': Debug', () => { + it('should output the given Line', () => { + testline = getDate() + '\t' + hostname + '\t@br/log\tDEBUG\ttestline' + line = log.debug('testline') + assert.equal(line, testline) + }) + }) + }) +}) diff --git a/package-lock.json b/package-lock.json index b08133aa9d3c4f7b643d8df550da50486b762753..604d0c6bc113e6a55db0fc84555f3ef6a88c9638 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "lib-log", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2027,6 +2027,11 @@ "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", "dev": true }, + "graylog2": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/graylog2/-/graylog2-0.2.1.tgz", + "integrity": "sha512-vjysakwOhrAqMeIvSK0WZcmzKvkpxY6pCfT9QqtdSVAidPFIynuin7adqbdFp9MCCTbTE402WIxvg8cph5OWTA==" + }, "growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", diff --git a/package.json b/package.json index 019a3948bab1550f8a2b13a1b51f93573adea623..e32cfbdbd7dce6facd147f37960248b0f7213820 100644 --- a/package.json +++ b/package.json @@ -1,21 +1,33 @@ { - "name": "lib-log", + "name": "@br/log", "version": "2.0.0", "description": "A simple Logger with Options!", "main": "index.js", "scripts": { - "test": "jest tests/index.test.js", - "test-coverage": "nyc --reporter=html --reporter=text mocha -- tests/test.js && rsync --remove-source-files -av --progress ./coverage ./docs/ && rm -Rf ./coverage", - "test-graphics": "nyc --reporter=html --reporter=text mocha -R mochawesome -- tests/test.js && rsync --remove-source-files -av --progress ./coverage ./docs/ && rm -Rf ./coverage && rsync --remove-source-files -av --progress ./mochawesome-report ./docs/ && rm -Rf ./mochawesome-report" + "test": "jest", + "sonarqube": "sonar-scanner -Dsonar.projectKey=argos-log -Dsonar.sources=. -Dsonar.host.url=https://it-devops-01.br-edv.brnet.int:8999 -Dsonar.login=gitlab" }, "author": "Dominik Sigmund <sigmund.dominik@googlemail.com> (https://webdad.eu)", "license": "ISC", "repository": { "type": "git", - "url": "https://it-devops-01.br-edv.brnet.int/argos/log" + "url": "https://it-devops-01.br-edv.brnet.int/general/log" + }, + "dependencies": { + "graylog2": "^0.2.1" }, - "dependencies": {}, "devDependencies": { "jest": "^24.9.0" + }, + "jest": { + "collectCoverage": true, + "coverageReporters": [ + "json", + "lcov", + "text", + "clover", + "html" + ], + "coverageDirectory": "docs/coverage" } }