Skip to content
Snippets Groups Projects
Commit 4c74d2a0 authored by Sigmund, Dominik's avatar Sigmund, Dominik
Browse files

init error

parent 240e59b5
Branches
Tags
1 merge request!1Update index.test.js, examples/all-options.js, examples/log-to-file.js,...
......@@ -26,6 +26,9 @@ function Log (options) {
let os = require('os')
this.hostname = os.hostname()
}
if (this.options.graylog && this.options.graylog.active) {
this.udpclient = udp.createSocket('udp4')
}
if (this.options.file) {
this.fs = require('fs')
this.path = require('path')
......@@ -34,9 +37,6 @@ function Log (options) {
} catch (error) {
throw new Error('Could not create path ' + this.options.path + '\n' + error.toString())
}
if (this.options.graylog && this.options.graylog.active) {
this.udpclient = udp.createSocket('udp4')
}
try {
this.fs.accessSync(this.path.join(this.options.path, this.options.file), this.fs.constants.R_OK | this.fs.constants.W_OK)
} catch (err) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment