MCPcopy
hub / github.com/winstonjs/winston / push

Method push

lib/winston/transports/file.js:345–370  ·  view source on GitHub ↗
(log)

Source from the content-addressed store, hash-verified

343 }
344
345 function push(log) {
346 if (
347 options.rows &&
348 results.length >= options.rows &&
349 options.order !== 'desc'
350 ) {
351 if (stream.readable) {
352 stream.destroy();
353 }
354 return;
355 }
356
357 if (options.fields) {
358 log = options.fields.reduce((obj, key) => {
359 obj[key] = log[key];
360 return obj;
361 }, {});
362 }
363
364 if (options.order === 'desc') {
365 if (results.length >= options.rows) {
366 results.shift();
367 }
368 }
369 results.push(log);
370 }
371
372 function check(log) {
373 if (!log) {

Callers 11

_transformMethod · 0.80
streamMethod · 0.80
_doBatchMethod · 0.80
_incFileMethod · 0.80
logMethod · 0.80
logger.test.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected