Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mcollina/hapi-pino
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed May 11, 2019
2 parents 18d6f9d + 1994c47 commit 2f2d126
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion benchmarks/hapi-pino-extreme.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require('make-promises-safe')

const Hapi = require('hapi')
const Hapi = require('@hapi/hapi')

async function start () {
const server = Hapi.server({ port: 3000 })
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/hapi-pino-merge-hapi-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require('make-promises-safe')

const Hapi = require('hapi')
const Hapi = require('@hapi/hapi')

async function start () {
const server = Hapi.server({ port: 3000 })
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/hapi-pino-no-merge-hapi-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require('make-promises-safe')

const Hapi = require('hapi')
const Hapi = require('@hapi/hapi')

async function start () {
const server = Hapi.server({ port: 3000 })
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/hapi-pino.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require('make-promises-safe')

const Hapi = require('hapi')
const Hapi = require('@hapi/hapi')

async function start () {
const server = Hapi.server({ port: 3000 })
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/hapi-pure.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require('make-promises-safe')

const Hapi = require('hapi')
const Hapi = require('@hapi/hapi')

async function start () {
const server = Hapi.server({ port: 3000 })
Expand Down
2 changes: 1 addition & 1 deletion example.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require('make-promises-safe')

const Hapi = require('hapi')
const Hapi = require('@hapi/hapi')

async function start () {
// Create a server with a host and port
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const Hoek = require('hoek')
const Hoek = require('@hapi/hoek')
const pino = require('pino')
const { stdSerializers } = pino
const { serializersSym } = pino.symbols
Expand Down Expand Up @@ -80,7 +80,7 @@ async function register (server, options) {

server.events.on('log', function (event) {
if (event.error) {
logger.warn({ err: event.error })
logger.error({ err: event.error })
} else {
logEvent(logger, event)
}
Expand All @@ -96,7 +96,7 @@ async function register (server, options) {
request.logger = request.logger || logger.child({ req: request })

if (event.error && isEnabledLogEvent(options, 'request-error')) {
request.logger.warn({
request.logger.error({
err: event.error
}, 'request error')
} else if (event.channel === 'app') {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@
],
"license": "MIT",
"devDependencies": {
"code": "^5.2.4",
"@hapi/code": "^5.3.0",
"coveralls": "^3.0.2",
"flush-write-stream": "^1.0.3",
"hapi": "^18.0.0",
"lab": "^18.0.0",
"@hapi/hapi": "^18.2.0",
"@hapi/lab": "^18.1.0",
"make-promises-safe": "^4.0.0",
"pre-commit": "^1.1.2",
"split2": "^3.0.0",
"standard": "^12.0.0"
},
"dependencies": {
"abstract-logging": "^1.0.0",
"hoek": "^6.1.2",
"pino": "^5.10.1",
"@hapi/hoek": "^6.2.0",
"pino": "^5.12.3",
"pino-pretty": "^2.5.0"
},
"repository": {
Expand Down
12 changes: 6 additions & 6 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

const Code = require('code')
const Lab = require('lab')
const Hoek = require('hoek')
const Code = require('@hapi/code')
const Lab = require('@hapi/lab')
const Hoek = require('@hapi/hoek')
const split = require('split2')
const writeStream = require('flush-write-stream')
const promisify = require('util').promisify
Expand All @@ -17,7 +17,7 @@ const after = lab.after
const afterEach = lab.afterEach
const expect = Code.expect

const Hapi = require('hapi')
const Hapi = require('@hapi/hapi')
const Pino = require('.')

function getServer () {
Expand Down Expand Up @@ -255,7 +255,7 @@ experiment('logs each request', () => {
await registerWithSink(server, 'info', (data, enc, cb) => {
if (count === 0) {
expect(data.err.message).to.equal('boom')
expect(data.level).to.equal(40)
expect(data.level).to.equal(50)
expect(data.msg).to.equal('request error')
} else {
expect(data.res.statusCode).to.equal(500)
Expand Down Expand Up @@ -381,7 +381,7 @@ experiment('logs through server.log', () => {
expect(data.err.message).to.equal('foobar')
expect(data.err.stack).to.exist()
// highest level tag
expect(data.level).to.equal(40)
expect(data.level).to.equal(50)
resolver()
})

Expand Down

0 comments on commit 2f2d126

Please sign in to comment.