var Q      = require('q'),
    spawn  = require('child_process').spawn,
    fs     = require('fs'),
    net    = require('net'),
    logger = require('winston'),
    mpdConfig = require(__dirname+'/mpd-config.js');

exports.create = function(config) {
  var mpdConf = mpdConfig.create(),
      instance = {};

  instance.port = mpdConf.port;

  function waitToBeOnline() {
    var deferred = Q.defer(),
        sock = new net.Socket();

    sock.setTimeout(2500);

    sock.on('connect', function() {
      logger.info('connected to '+instance.port);
      deferred.resolve();
    });

    sock.on('error', function(error) {
      logger.error('error for '+instance.port, error);

      setTimeout(function() {
        sock.connect(instance.port);
      }, 10);
    });

    sock.connect(instance.port);

    return deferred.promise;
  }

  function spawnMPD(fileName) {
    logger.info('spawn');

    var deferred = Q.defer(),
        mpdProcess = spawn('/usr/local/bin/mpd', [fileName, '--no-daemon']);

    mpdProcess.on('close', function(code, signal) {
      logger.info('MPD Closed: '+signal);
    });

    mpdProcess.stdout.on('data', function(data) {
      logger.info('MPD: ' + data);
    });

    mpdProcess.stderr.on('data', function(data) {
      logger.error('MPD: ' + data);
    });

    deferred.resolve();

    return deferred.promise;
  }

  instance.start = function() {
    return mpdConf.write(config).then(spawnMPD)
      .then(waitToBeOnline);
  };

  return instance;
};

@@ -868,35 +868,8 @@
 ) %7B%0A
-    logger.info('spawn');%0A%0A
     
@@ -886,32 +886,32 @@
 ed = Q.defer(),%0A
+
         mpdProce
@@ -1033,28 +1033,29 @@
      logger.
-info
+error
 ('MPD Closed
@@ -1061,15 +1061,15 @@
 d: '
-+signal
+ + code
 );%0A 
@@ -1229,29 +1229,28 @@
      logger.
-error
+warn
 ('MPD: ' + d

Update logging for mpd child process