/**
 * Squid Core
 *
 * Advanced logging with NodeJs
 * http://tostring.it/2014/06/23/advanced-logging-with-nodejs/
 *
 */

'use strict';

var  _      = require('lodash')
  , winston = window.require('winston')

winston.emitErrs = true

var _LOGNAME = '[Desktop::Utils::Logger] '

// Initialize Logger Class
//
//      @params  {object}  config
//      @return  {object}  Logger instance
//
var Logger = function( options )
{
  this._LOGGER = false

  options = options || false

  // no options, no logger
  // usefull for test env
  if( !options )
    return this

  // Logger require transports options
  if( _.isUndefined( options.transports ) )
    throw new Error( _LOGNAME + 'missing transports options' )

  //initialize logger
  this._LOGGER = new winston.Logger(
  {
      exitOnError: options.exitOnError || false
    , transports:  [
         new winston.transports[ options.output || 'File' ]( options.transports )
      ]
  })

  return this
}

// Display info level message
//
//      @params  {mixed}  single message or an array of messages
//      @return  {void}
//
Logger.prototype.print = function( message )
{
  // Logger is not setup
  if( !this._LOGGER )
    return

  // Strange ... need to fix that
  this._LOGGER._LOGGER.info.apply( this, arguments )
}

module.exports = Logger

@@ -10,12 +10,15 @@
 uid 
-Core
+Desktop
 %0A *%0A
@@ -937,16 +937,64 @@
  %5D%0A  %7D)%0A
+%7D%0A%0ALogger.prototype.getEngineName = function()%0A%7B
 %0A  retur
@@ -995,20 +995,25 @@
  return 
-this
+'WINSTON'
 %0A%7D%0A%0A// D
@@ -1245,54 +1245,12 @@
 %0A%0A  
-// Strange ... need to fix that%0A  this._LOGGER
+this
 ._LO

fix storage scope