Remove Logger from global namespace

This commit is contained in:
Andrew Stewart 2014-05-13 19:44:40 -07:00
parent 43a9351921
commit c22ef95239
9 changed files with 15 additions and 8 deletions

View File

@ -8,7 +8,8 @@
"use strict";
var Basestar = require('./basestar');
var Basestar = require('./basestar'),
Logger = require('./logger');
// The Adaptor class is a base class for Adaptor classes in external Cylon
// modules to use. It offers basic functions for connecting/disconnecting that

View File

@ -12,6 +12,7 @@ var fs = require('fs');
var express = require('express');
var Logger = require('./logger');
var API = module.exports = function API(opts) {
var self = this;

View File

@ -12,6 +12,8 @@ require("./utils");
var EventEmitter = require('events').EventEmitter;
var Logger = require('./logger');
// The Connection class represents the interface to
// a specific group of hardware devices. Examples would be an
// Arduino, a Sphero, or an ARDrone.

View File

@ -8,14 +8,14 @@
"use strict";
var Robot = require('./robot'),
var Logger = require('./logger'),
Robot = require('./robot'),
Utils = require('./utils');
require('./logger');
Logger.setup();
var Cylon = module.exports = {
Logger: Logger,
Driver: require('./driver'),
Adaptor: require('./adaptor'),

View File

@ -12,6 +12,8 @@ require('./utils');
var EventEmitter = require('events').EventEmitter;
var Logger = require('./logger');
// The Artoo::Device class represents the interface to
// a specific individual hardware devices. Examples would be a digital
// thermometer connected to an Arduino, or a Sphero's accelerometer

View File

@ -8,7 +8,8 @@
'use strict';
var Basestar = require('./basestar');
var Basestar = require('./basestar'),
Logger = require('./logger');
// The Driver class is a base class for Driver classes in external Cylon
// modules to use. It offers basic functions for starting/halting that

View File

@ -18,7 +18,7 @@ var BasicLogger = require('./logger/basic_logger'),
// The Logger is a global object to facilitate logging stuff to the console (or
// other output) easily and consistently. It's available anywhere in Cylon, as
// well as in external modules that are loaded into Cylon
var Logger = global.Logger = module.exports = {};
var Logger = module.exports = {};
// Public: Creates a Logger instance and assigns it to @logger
//

View File

@ -10,10 +10,9 @@
require('./utils');
require('./cylon');
var Connection = require("./connection"),
Device = require("./device"),
Logger = require('./logger'),
config = require('./config');
var Async = require("async"),

View File

@ -9,6 +9,7 @@ var chai = require('chai');
var sinonChai = require('sinon-chai');
require('..');
global.Logger = require('../lib/logger')
Logger.setup(false) // disable Cylon's logger for tests
global.chai = chai;