/**
 * Server logger.
 * @augment lib.log.FileLogger
 * @constructor lib.log.ServerLogger
 * @param {string} level - Log level.
 * @author Taka Okunishi
 */

var FileLogger = require('./file_logger');

var fs = require('fs'),
    object = require('../object'),
    define = object.define;

module.exports = define({
    prototype: FileLogger,
    /** @lends lib.log.ServerLogger.prototype **/
    properties: {
        /**
         * Log that the cluster starting.
         * @param {number} numberOfWorkers - Number of clusters to start.
         */
        clusterStarting: function (numberOfWorkers) {
            var s = this;
            s.info('Kicking cluster with %d workers...', numberOfWorkers);
        },
        /**
         * Log that a cluster worker started.
         * @param {number} pid - Cluster worker process id.
         */
        clusterWorkerStart: function (pid) {
            var s = this;
            s.trace('\tWorker started on process %d.', pid);
        },
        /**
         * Log that a cluster worker died.
         * @param {number} pid - Cluster worker process id.
         */
        clusterWorkerDied: function (pid) {
            var s = this;
            s.fatal('worker %d died', pid);
        },
        /**
         * Log that a cluster restarting.
         * @param {number} pid - Cluster worker process id.
         */
        clusterWorkerRestarting: function (pid) {
            var s = this;
            s.info('Restart dead cluster on %s ... ', pid);
        },
        /**
         * Log that server started.
         * @param {number} port - Port number server listening.
         */
        serverStarted: function (port) {
            var s = this;
            s.info('Server started listening on port %d.', port);
        }
    }
});