"use strict";

var LINE = "+--------------------------------------------------------------------+";

var LINE_CR = LINE + "\n";

var printStartingBanner = function (pjson) {
    var banner = "\n" + LINE_CR + "| Application Starting";
    banner += "\n" + LINE_CR;
    banner += "| Platform: " + process.platform;
    banner += "\n| Architecture: " + process.arch;
    banner += "\n| PID: " + process.pid;
    banner += "\n| Environment: " + process.env.NODE_ENV;
    banner += "\n|\n| Application Versions: ";
    banner += "\n|   " + pjson.name + ": v" + pjson.version;
    banner += "\n|   Node: " + process.version;
    banner += "\n" + LINE_CR;

    logger.info(banner);
};

var printCompletionBanner = function (message) {
    var banner = "\n" + LINE_CR + "| " + message;
    banner += "\n" + LINE;

    logger.info(banner);
};

var printStartCompleteBanner = function (port) {
    var message = "Application Started";

    if (port) {
        message += " on port " + port;
    }

    printCompletionBanner(message);
};

module.exports = {
    printStartingBanner: printStartingBanner,

    printCompletionBanner: printCompletionBanner,

    printStartCompleteBanner: printStartCompleteBanner
};
