/**
 * Define a batch logger for a context.
 * @function serverside.logger.newBatchLogger
 * @param {object} context - Sever context object.
 * @returns {object} - An logger object.
 * @protected
 * @ignore
 * @author Taka Okunishi
 */
var path = require('path'),
    lib = require('../../lib'),
    log = lib.log,
    BatchLogger = log.BatchLogger;

module.exports = function (context) {
    context.assertKeys(['BATCH_LOG_PATH']);
    return new BatchLogger(context.LOG_LEVEL)
        .filename(path.resolve(context.BATCH_LOG_PATH))
        .console(!!context.CONSOLE_ENABLED);
};