Skip to content
Snippets Groups Projects
Commit f57ea359 authored by admin-sigmundd's avatar admin-sigmundd
Browse files

Made Fabric to use multiple Instances

parent f23b5f23
No related branches found
No related tags found
1 merge request!1Update index.test.js, examples/all-options.js, examples/log-to-file.js,...
......@@ -9,7 +9,8 @@ May Optional Log to A File and / or a Graylog-Server
## Usage
`const log = require('log')(options)`
`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 folder-name will be used
......
module.exports = function (options) {
function Log (options) {
this.moment = require('moment')
this.path = require('path')
this.fs = require('fs')
......@@ -68,3 +68,4 @@ module.exports = function (options) {
}
return this
}
module.exports = Log
const log = require('../index.js')({
const Log = require('../index.js')
let log = new Log({
name: 'Sample-Application',
hostname: 'test-server'
})
......
const log = require('../index.js')({
const Log = require('../index.js')
let log = new Log({
name: 'Sample-File',
file: 'file.log'
})
......
const log = require('../index.js')()
const Log = require('../index.js')
let log = new Log()
log.info('This is an Information')
log.warn('This is a Warning')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment