i see the soure code in WinstonLoggerAdapter
// custom query as winston is currently limited
query(options, callback = () => {}) {
if (!options) {
options = {};
}
// defaults to 7 days prior
const from = options.from || new Date(Date.now() - 7 * MILLISECONDS_IN_A_DAY);
const until = options.until || new Date();
const limit = options.size || 10;
const order = options.order || 'desc';
const level = options.level || 'info';
const queryOptions = {
from,
until,
limit,
order
};
return new Promise((resolve, reject) => {
_WinstonLogger.logger.query(queryOptions, (err, res) => {
if (err) {
callback(err);
return reject(err);
}
if (level === 'error') {
callback(res['parse-server-error']);
resolve(res['parse-server-error']);
} else {
callback(res['parse-server']);
resolve(res['parse-server']);
}
});
});
}
why use
if (!options) {
options = {};
}
I want to view the logs in real time, refresh automatically in 5 seconds, and automatically load the old logs of the previous page after sliding to the top. The parse-dashboard does not support real-time refresh and automatic loading of the previous page or the next one.