|
|
@ -219,11 +219,18 @@ export class Logger { |
|
|
|
} |
|
|
|
|
|
|
|
static toLoggableName(instance: Function | object) { |
|
|
|
let name; |
|
|
|
if (typeof instance === 'function') { |
|
|
|
return instance.name; |
|
|
|
if (instance.prototype == null || instance.prototype.constructor == null) { |
|
|
|
return instance.name; |
|
|
|
} |
|
|
|
|
|
|
|
name = instance.prototype.constructor.name; |
|
|
|
} |
|
|
|
else { |
|
|
|
name = instance.constructor != null ? instance.constructor.name : ''; |
|
|
|
} |
|
|
|
|
|
|
|
const name = instance.constructor != null ? instance.constructor.name : ''; |
|
|
|
// Strip webpack module name (since I never name classes with an _)
|
|
|
|
const index = name.indexOf('_'); |
|
|
|
return index === -1 ? name : name.substr(index + 1); |
|
|
|