Remove Logger from global namespace
This commit is contained in:
parent
43a9351921
commit
c22ef95239
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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'),
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
//
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue