Skip to content

日志的收集

Published: at 16:00

Node 牛刀小试 · 第 33 篇,共 49 篇

日志的收集

IOPS

日志所影响的CPU及内存

class / extends

function Animal(name) {
  this.name = name;
}

Animal.prototype.hello = () => {
  console.log("hello");
};

function Dog(name, say) {
  Animal.call(this, name);
  this.say = say;
}

Dog.prototype = Object.create(Animal.prototype);

Reflect.defineProperty(Dog.prototype, "constructor", {
  value: Dog,
  enumerable: false, // 不可枚举
  writable: true,
});
class Animal {
  constructor(name) {
    this.name = name;
  }

  hello() {
    console.log("hello");
  }
}

class Dog extends Animal {
  constructor(name, say) {
    super(name);
    this.say = say;
  }
}