@restroom-mw/logger
Advanced tools
Comparing version 0.13.1-c16e462.76 to 0.13.1-ec9eb62.77
@@ -18,2 +18,3 @@ "use strict"; | ||
const fs_1 = __importDefault(require("fs")); | ||
const path_1 = __importDefault(require("path")); | ||
const utils_1 = require("@restroom-mw/utils"); | ||
@@ -34,4 +35,5 @@ require("dotenv").config(); | ||
const addLog = (sentences, where) => { | ||
validatePath(where); | ||
const ws = fs_1.default.createWriteStream(where, { flags: "a" }); | ||
const absolutePath = path_1.default.resolve(path_1.default.join(exports.LOGGER_DIR, where)); | ||
validatePath(absolutePath); | ||
const ws = fs_1.default.createWriteStream(absolutePath, { flags: "a" }); | ||
ws.on('error', (error) => { | ||
@@ -38,0 +40,0 @@ throw new Error(`[LOGGER] An error occurred while writing to ${where}\n${error}`); |
{ | ||
"name": "@restroom-mw/logger", | ||
"version": "0.13.1-c16e462.76+c16e462", | ||
"version": "0.13.1-ec9eb62.77+ec9eb62", | ||
"description": "Utilities middleware to work with files for Restroom", | ||
@@ -36,3 +36,3 @@ "author": "Alberto Lerda <alberto@dyne.org>", | ||
}, | ||
"gitHead": "c16e46294477a54f79b9f551c4f3de4c56919a43" | ||
"gitHead": "ec9eb624dde3b5d0b8509d116f4af5f73da12d5b" | ||
} |
@@ -28,4 +28,5 @@ import {Restroom} from "@restroom-mw/core"; | ||
const addLog = (sentences: string[], where: string) => { | ||
validatePath(where); | ||
const ws = fs.createWriteStream(where, {flags: "a"}); | ||
const absolutePath = path.resolve(path.join(LOGGER_DIR, where)); | ||
validatePath(absolutePath); | ||
const ws = fs.createWriteStream(absolutePath, {flags: "a"}); | ||
ws.on('error', (error) => { | ||
@@ -32,0 +33,0 @@ throw new Error( |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
43021
147