|
12 | 12 | var d3 = require('d3'); |
13 | 13 |
|
14 | 14 | var lib = module.exports = {}; |
15 | | -var config = require('../plot_api/plot_config'); |
16 | 15 |
|
17 | 16 | lib.nestedProperty = require('./nested_property'); |
18 | 17 | lib.isPlainObject = require('./is_plain_object'); |
@@ -59,6 +58,11 @@ lib.extendFlat = extendModule.extendFlat; |
59 | 58 | lib.extendDeep = extendModule.extendDeep; |
60 | 59 | lib.extendDeepAll = extendModule.extendDeepAll; |
61 | 60 |
|
| 61 | +var loggersModule = require('./loggers'); |
| 62 | +lib.log = loggersModule.log; |
| 63 | +lib.warn = loggersModule.warn; |
| 64 | +lib.error = loggersModule.error; |
| 65 | + |
62 | 66 | lib.notifier = require('./notifier'); |
63 | 67 |
|
64 | 68 | /** |
@@ -93,52 +97,6 @@ lib.pauseEvent = function(e) { |
93 | 97 | return false; |
94 | 98 | }; |
95 | 99 |
|
96 | | -/** |
97 | | - * ------------------------------------------ |
98 | | - * debugging tools |
99 | | - * ------------------------------------------ |
100 | | - */ |
101 | | - |
102 | | -/* eslint-disable no-console */ |
103 | | -lib.log = function() { |
104 | | - if(config.logging > 1) { |
105 | | - var messages = ['LOG:']; |
106 | | - |
107 | | - for(var i = 0; i < arguments.length; i++) { |
108 | | - messages.push(arguments[i]); |
109 | | - } |
110 | | - |
111 | | - if(console.trace) { |
112 | | - console.trace.apply(console, messages); |
113 | | - } else { |
114 | | - console.log.apply(console, messages); |
115 | | - } |
116 | | - } |
117 | | -}; |
118 | | - |
119 | | -lib.warn = function() { |
120 | | - if(config.logging > 0) { |
121 | | - var messages = ['WARN:']; |
122 | | - |
123 | | - for(var i = 0; i < arguments.length; i++) { |
124 | | - messages.push(arguments[i]); |
125 | | - } |
126 | | - |
127 | | - if(console.trace) { |
128 | | - console.trace.apply(console, messages); |
129 | | - } else { |
130 | | - console.log.apply(console, messages); |
131 | | - } |
132 | | - } |
133 | | -}; |
134 | | - |
135 | | -lib.error = function() { |
136 | | - if(config.logging > 0) { |
137 | | - console.error.apply(console, arguments); |
138 | | - } |
139 | | -}; |
140 | | -/* eslint-enable no-console */ |
141 | | - |
142 | 100 | // constrain - restrict a number v to be between v0 and v1 |
143 | 101 | lib.constrain = function(v, v0, v1) { |
144 | 102 | if(v0 > v1) return Math.max(v1, Math.min(v0, v)); |
|
0 commit comments