Skip to content

Commit

Permalink
add dev sample
Browse files Browse the repository at this point in the history
  • Loading branch information
ovhemert committed Oct 18, 2021
1 parent 57d429e commit 3e72998
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ jspm_packages
.node_repl_history

.vscode
.env
20 changes: 20 additions & 0 deletions dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require('dotenv').config()

const pinoms = require('pino-multi-stream')
const papertrail = require('.')

// create the papertrail destination stream
const options = {
host: process.env.PT_HOST,
port: process.env.PT_PORT
}
console.log(process.env.PT_PORT)
const appname = 'my-project'
const writeStream = papertrail.createWriteStream({ ...options, appname })

// create pino loggger
const logger = pinoms({ streams: [{ stream: writeStream }] })

// log some events
logger.info('Informational message')
logger.error(new Error('things got bad'), 'error message')
104 changes: 104 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
"test"
],
"devDependencies": {
"dotenv": "^10.0.0",
"pino": "^6.4.1",
"pino-multi-stream": "^6.0.0",
"sinon": "^9.0.2",
"standard": "^14.3.4",
"tap": "^14.10.8"
Expand Down

0 comments on commit 3e72998

Please sign in to comment.