Pārlūkot izejas kodu

Fixes logging of static class methods

main
Eric Amodio pirms 6 gadiem
vecāks
revīzija
8a9f7e672a
1 mainītis faili ar 9 papildinājumiem un 2 dzēšanām
  1. +9
    -2
      src/logger.ts

+ 9
- 2
src/logger.ts Parādīt failu

@ -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);

Notiek ielāde…
Atcelt
Saglabāt