Skip to content

Commit

Permalink
Merge pull request #54 from wagenet/fix-logger
Browse files Browse the repository at this point in the history
Switch from Ember.Logger to console
  • Loading branch information
rwjblue authored Aug 10, 2018
2 parents 904d158 + 9710316 commit 6f38c47
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions tests/acceptance/workflow-config-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ let originalWarn;

module("workflow config", {
beforeEach() {
originalWarn = Ember.Logger.warn;
originalWarn = console.warn;
},
afterEach() {
Ember.ENV.RAISE_ON_DEPRECATION = false;
window.deprecationWorkflow.deprecationLog = { messages: { } };
Ember.Logger.warn = originalWarn;
console.warn = originalWarn;
}
});

Expand All @@ -25,7 +25,7 @@ test('deprecation logs with string matcher', (assert) => {
assert.expect(1);

let message = 'log-me';
Ember.Logger.warn = function(passedMessage) {
console.warn = function(passedMessage) {
assert.ok(passedMessage.indexOf('DEPRECATION: ' + message) === 0, 'deprecation logs');
};
Ember.deprecate(message, false, { until: 'forever', id: 'test' });
Expand All @@ -42,7 +42,7 @@ test('deprecation logs with id matcher', (assert) => {

let message = 'log-id',
options = { id: 'ember.workflow', until: '3.0.0' };
Ember.Logger.warn = function(passedMessage) {
console.warn = function(passedMessage) {
assert.equal(passedMessage, 'DEPRECATION: ' + message, 'deprecation logs');
};
Ember.deprecate(message, false, options);
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/deprecation-collector-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ let originalWarn;

module("deprecation collector", {
beforeEach() {
originalWarn = Ember.Logger.warn;
originalWarn = console.warn;
},
afterEach() {
Ember.ENV.RAISE_ON_DEPRECATION = false;
window.deprecationWorkflow.config = null;
window.deprecationWorkflow.deprecationLog = { messages: {} };
Ember.Logger.warn = originalWarn;
console.warn = originalWarn;
}
});

Expand Down Expand Up @@ -121,7 +121,7 @@ test('deprecation logs with string matcher', (assert) => {
assert.expect(1);

let message = 'Interesting';
Ember.Logger.warn = function(passedMessage) {
console.warn = function(passedMessage) {
assert.ok(passedMessage.indexOf('DEPRECATION: ' + message) === 0, 'deprecation logs');
};
window.deprecationWorkflow.config = {
Expand Down Expand Up @@ -158,7 +158,7 @@ test('deprecation logs with regex matcher', (assert) => {
assert.expect(1);

let message = 'Interesting';
Ember.Logger.warn = function(passedMessage) {
console.warn = function(passedMessage) {
assert.equal(passedMessage, 'DEPRECATION: ' + message, 'deprecation logs');
};
window.deprecationWorkflow.config = {
Expand Down Expand Up @@ -210,7 +210,7 @@ test('deprecation logs with id matcher', (assert) => {
assert.expect(1);

let message = 'Slightly interesting';
Ember.Logger.warn = function(passedMessage) {
console.warn = function(passedMessage) {
assert.equal(passedMessage, 'DEPRECATION: ' + message, 'deprecation logs');
};
window.deprecationWorkflow.config = {
Expand Down
2 changes: 1 addition & 1 deletion vendor/ember-cli-deprecation-workflow/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
// no-op
break;
case 'log':
Ember.Logger.warn('DEPRECATION: ' + message);
console.warn('DEPRECATION: ' + message);
break;
case 'throw':
throw new Error(message);
Expand Down

0 comments on commit 6f38c47

Please sign in to comment.