discord-baymax-bot/node_modules/log4js/examples/memory-test.js
2017-03-23 23:52:08 -05:00

38 lines
847 B
JavaScript

var log4js = require('../lib/log4js')
, logger
, usage
, i;
log4js.configure(
{
appenders: [
{
category: "memory-test"
, type: "file"
, filename: "memory-test.log"
},
{
type: "console"
, category: "memory-usage"
},
{
type: "file"
, filename: "memory-usage.log"
, category: "memory-usage"
, layout: {
type: "messagePassThrough"
}
}
]
}
);
logger = log4js.getLogger("memory-test");
usage = log4js.getLogger("memory-usage");
for (i=0; i < 1000000; i++) {
if ( (i % 5000) === 0) {
usage.info("%d %d", i, process.memoryUsage().rss);
}
logger.info("Doing something.");
}