@chia-carbon/core-registry-logger
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -0,1 +1,10 @@ | ||
## [1.0.11](https://github.com/Chia-Network/core-registry-logger/compare/1.0.10...1.0.11) (2023-09-25) | ||
### Features | ||
* add namespace option ([25e9f90](https://github.com/Chia-Network/core-registry-logger/commit/25e9f9072b40a5950e44229690b92d0c7c989cda)) | ||
## [1.0.10](https://github.com/Chia-Network/core-registry-logger/compare/1.0.9...1.0.10) (2023-09-23) | ||
@@ -2,0 +11,0 @@ |
21
index.js
@@ -14,2 +14,3 @@ const { createLogger, format, transports, addColors } = require("winston"); | ||
* @param {Object} options - Logger options | ||
* @param {string} options.namespace - The Chia namespace for this project | ||
* @param {string} options.projectName - The name of the project using the logger. | ||
@@ -20,4 +21,20 @@ * @param {string} options.logLevel - The logging level. | ||
constructor(options) { | ||
const { projectName, logLevel, packageVersion } = options; | ||
const { namespace, projectName, logLevel, packageVersion } = options; | ||
if (!namespace) { | ||
throw new Error("options.namespace is required"); | ||
} | ||
if (!projectName) { | ||
throw new Error("options.projectName is required"); | ||
} | ||
if (!logLevel) { | ||
throw new Error("options.logLevel is required"); | ||
} | ||
if (!packageVersion) { | ||
throw new Error("options.packageVersion is required"); | ||
} | ||
const customLevels = { | ||
@@ -49,3 +66,3 @@ levels: { | ||
const chiaRoot = getChiaRoot(); | ||
const logDir = `${chiaRoot}/core-registry/logs/${projectName}`; | ||
const logDir = `${chiaRoot}/${namespace}/logs/${projectName}`; | ||
@@ -52,0 +69,0 @@ if (!fs.existsSync(logDir)) { |
{ | ||
"name": "@chia-carbon/core-registry-logger", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "Custom logger for core registry projects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
23192
122