/**
 * Print debug message.
 * @namespace ci.worker._debug
 * @author Taka Okunishi
 * @protected
 *
 */
var log = require('../../lib/log'),
    Logger = log.Logger,
    logger = new Logger(log.levels.TRACE);

var debug = module.exports = function () {
    if (process.env.CI_LOG_DISABLED) {
        return;
    }
    logger.debug.apply(logger, arguments);
};

/**
 * Print a file create message.
 * @function ci.worker._debug.didCreateFile
 * @param {string} filename - Created file name
 */
debug.didCreateFile = function (filename) {
    debug('File created: %s', filename);
};

/**
 * Print a directory create message.
 * @function ci.worker._debug.didCreateDir
 * @param {string} dirname - Created directory name.
 */
debug.didCreateDir = function (dirname) {
    debug('Directory created: %s', dirname);
};

/**
 * Print a link create message.
 * @function ci.worker._debug.didCreateLink
 * @param {string} linkName - Created link name.
 * @param {string} src - Source file name.
 */
debug.didCreateLink = function (linkName, src) {
    debug('Link created: %s -> %s', linkName, src);
};

/**
 * Print a image create message.
 * @function ci.worker._debug.didCreateImage
 * @param {string} imageName - Created image file name.
 */
debug.didCreateImage = function (imageName) {
    debug('Image created: %s', imageName);
};
/**
 * Print a compile message.
 * @function ci.worker._debug.didCompile
 * @param {string} filename - Compiled file name.
 */
debug.didCompile = function (filename) {
    debug('File compiled: %s', filename);
};

/**
 * Print a chmod message.
 * @function ci.worker._debug.didChmod
 * @param {string} mode - Changed mode.
 * @param {string} filename - Mode changed file name.
 */
debug.didChmod = function (mode, filename) {
    debug('Chmod: %s %s', mode, filename);
};


/**
 * Print a clean dead link message.
 * @function ci.worker._debug.cleanDeadLink
 * @param {string} filename - Cleaned filename.
 */
debug.cleanDeadLink = function (filename) {
    debug('Clean dead link:%s', filename);
};

/**
 * Print a command done message.
 * @function ci.worker._debug.didExecute
 * @param {string} command - Executed command.
 */
debug.didExecute = function (command) {
    debug('Command executed: %s', command);
};

/**
 * Print a copy dir done message.
 * @param {string} from - Directory copied from.
 * @param {string} to - Directory copied to.
 */
debug.didCopyDir = function (from, to) {
    debug('Directory copied: %s to %s', from, to);
};

/**
 * Print a copy file done message.
 * @param {string} from - File copied from.
 * @param {string} to - File copied to.
 */
debug.didCopyFile = function (from, to) {
    debug('File copied: %s to %s', from, to);
};

debug.didLintPass = function (filename) {
    debug('Lint passed:%s', filename);
};
debug.didLintFail = function (count) {
    debug('Lint failed with %s files.\n', count);
};
debug.didInstall = function (packageName, destDir) {
    debug('Successfully install %s at %s.', packageName, destDir);
};