-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.js
More file actions
28 lines (22 loc) · 707 Bytes
/
Copy pathexample.js
File metadata and controls
28 lines (22 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const fastify = require('fastify')();
const fs = require('fs');
//fastify.register(require('./index'))
// or provide options object
fastify.register(require('./index'), {
disabled:false,
symbols:{
error:'ERR',
},
// outStream:'./log-file.txt'
});
fastify.listen(8080, (err) => {
//use the following shortands
fastify.trace('This is a trace line');
fastify.debug('This is a debug line');
fastify.info('This is an info line');
fastify.warn('This is a warning line');
fastify.error('This is an error line');
fastify.fatal('This is a fatal line');
//or use chalk directly
console.log(fastify.chalk.green('console.log(fastify.chalk.green( ... ))'));
});