@ayana/logger
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "@ayana/logger", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Useful and great looking logging made easy", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -66,3 +66,5 @@ /* | ||
let name; | ||
if (typeof forClass === 'function') name = forClass.name; | ||
if (forClass == null || forClass === '') name = 'index.js'; | ||
else if (typeof forClass === 'function') name = forClass.name; | ||
else if (typeof forClass === 'string') name = forClass; | ||
@@ -95,4 +97,6 @@ else throw new Error('Logger.get(): Invalid forClass parameter. Use a string or a named function'); | ||
if (!pkgPath) pkgPath = ''; | ||
if (pkgPath.length > 0) pkgPath = `${pkgPath}.`; | ||
if (pkgPath.length > 0 && name !== 'index.js') pkgPath = `${pkgPath}.`; | ||
if (name === 'index.js') name = ''; | ||
return new Logger(name, pkgName, pkgPath); | ||
@@ -99,0 +103,0 @@ } |
21828
244