diff --git a/packages/@ember/-internals/console/index.d.ts b/packages/@ember/-internals/console/index.d.ts deleted file mode 100644 index bf03766f40b..00000000000 --- a/packages/@ember/-internals/console/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -declare const Logger: { - log(...args: string[]): void; - warn(...args: string[]): void; - error(...args: string[]): void; - info(...args: string[]): void; - debug(...args: string[]): void; - assert(...args: string[]): void; -}; - -export default Logger; diff --git a/packages/@ember/-internals/console/index.js b/packages/@ember/-internals/console/index.js deleted file mode 100644 index 38bda85f0aa..00000000000 --- a/packages/@ember/-internals/console/index.js +++ /dev/null @@ -1,201 +0,0 @@ -import { deprecate } from '@ember/debug'; -import { LOGGER } from '@ember/deprecated-features'; - -// Deliver message that the function is deprecated - -const DEPRECATION_MESSAGE = 'Use of Ember.Logger is deprecated. Please use `console` for logging.'; -const DEPRECATION_ID = 'ember-console.deprecate-logger'; -const DEPRECATION_URL = - 'https://deprecations.emberjs.com/v3.x#toc_use-console-rather-than-ember-logger'; -/** - @module ember -*/ - -/** - Inside Ember-Metal, simply uses the methods from `imports.console`. - Override this to provide more robust logging functionality. - - @class Logger - @deprecated Use 'console' instead - - @namespace Ember - @public -*/ -let DEPRECATED_LOGGER; - -if (LOGGER) { - DEPRECATED_LOGGER = { - /** - Logs the arguments to the console. - You can pass as many arguments as you want and they will be joined together with a space. - - ```javascript - var foo = 1; - Ember.Logger.log('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console - ``` - - @method log - @for Ember.Logger - @param {*} arguments - @public - */ - log() { - deprecate(DEPRECATION_MESSAGE, false, { - id: DEPRECATION_ID, - until: '4.0.0', - url: DEPRECATION_URL, - for: 'ember-source', - since: { - enabled: '3.2.0', - }, - }); - return console.log(...arguments); // eslint-disable-line no-console - }, - - /** - Prints the arguments to the console with a warning icon. - You can pass as many arguments as you want and they will be joined together with a space. - - ```javascript - Ember.Logger.warn('Something happened!'); - // "Something happened!" will be printed to the console with a warning icon. - ``` - - @method warn - @for Ember.Logger - @param {*} arguments - @public - */ - warn() { - deprecate(DEPRECATION_MESSAGE, false, { - id: DEPRECATION_ID, - until: '4.0.0', - url: DEPRECATION_URL, - for: 'ember-source', - since: { - enabled: '3.2.0', - }, - }); - return console.warn(...arguments); // eslint-disable-line no-console - }, - - /** - Prints the arguments to the console with an error icon, red text and a stack trace. - You can pass as many arguments as you want and they will be joined together with a space. - - ```javascript - Ember.Logger.error('Danger! Danger!'); - // "Danger! Danger!" will be printed to the console in red text. - ``` - - @method error - @for Ember.Logger - @param {*} arguments - @public - */ - error() { - deprecate(DEPRECATION_MESSAGE, false, { - id: DEPRECATION_ID, - until: '4.0.0', - url: DEPRECATION_URL, - for: 'ember-source', - since: { - enabled: '3.2.0', - }, - }); - return console.error(...arguments); // eslint-disable-line no-console - }, - - /** - Logs the arguments to the console. - You can pass as many arguments as you want and they will be joined together with a space. - - ```javascript - var foo = 1; - Ember.Logger.info('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console - ``` - - @method info - @for Ember.Logger - @param {*} arguments - @public - */ - info() { - deprecate(DEPRECATION_MESSAGE, false, { - id: DEPRECATION_ID, - until: '4.0.0', - url: DEPRECATION_URL, - for: 'ember-source', - since: { - enabled: '3.2.0', - }, - }); - return console.info(...arguments); // eslint-disable-line no-console - }, - - /** - Logs the arguments to the console in blue text. - You can pass as many arguments as you want and they will be joined together with a space. - - ```javascript - var foo = 1; - Ember.Logger.debug('log value of foo:', foo); - // "log value of foo: 1" will be printed to the console - ``` - - @method debug - @for Ember.Logger - @param {*} arguments - @public - */ - debug() { - deprecate(DEPRECATION_MESSAGE, false, { - id: DEPRECATION_ID, - until: '4.0.0', - url: DEPRECATION_URL, - for: 'ember-source', - since: { - enabled: '3.2.0', - }, - }); - /* eslint-disable no-console */ - if (console.debug) { - return console.debug(...arguments); - } - return console.info(...arguments); - /* eslint-enable no-console */ - }, - - /** - If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace. - - ```javascript - Ember.Logger.assert(true); // undefined - Ember.Logger.assert(true === false); // Throws an Assertion failed error. - Ember.Logger.assert(true === false, 'Something invalid'); // Throws an Assertion failed error with message. - ``` - - @method assert - @for Ember.Logger - @param {Boolean} bool Value to test - @param {String} message Assertion message on failed - @public - */ - assert() { - deprecate(DEPRECATION_MESSAGE, false, { - id: DEPRECATION_ID, - until: '4.0.0', - url: DEPRECATION_URL, - for: 'ember-source', - since: { - enabled: '3.2.0', - }, - }); - return console.assert(...arguments); // eslint-disable-line no-console - }, - }; -} - -export default DEPRECATED_LOGGER; diff --git a/packages/@ember/deprecated-features/index.ts b/packages/@ember/deprecated-features/index.ts index d38c8bf6697..d750d8b3876 100644 --- a/packages/@ember/deprecated-features/index.ts +++ b/packages/@ember/deprecated-features/index.ts @@ -5,7 +5,6 @@ export const SEND_ACTION = !!'3.4.0'; export const EMBER_EXTEND_PROTOTYPES = !!'3.2.0-beta.5'; -export const LOGGER = !!'3.2.0-beta.1'; export const MERGE = !!'3.6.0-beta.1'; export const ROUTER_EVENTS = !!'4.0.0'; export const COMPONENT_MANAGER_STRING_LOOKUP = !!'3.8.0'; diff --git a/packages/ember/index.js b/packages/ember/index.js index b8f3b854bcd..5038fdeb908 100644 --- a/packages/ember/index.js +++ b/packages/ember/index.js @@ -16,7 +16,6 @@ import { import * as EmberDebug from '@ember/debug'; import { assert, captureRenderTree, deprecate } from '@ember/debug'; import Backburner from 'backburner'; -import Logger from '@ember/-internals/console'; import Controller, { inject as injectController } from '@ember/controller'; import ControllerMixin from '@ember/controller/lib/controller_mixin'; import { @@ -100,7 +99,7 @@ import ApplicationInstance from '@ember/application/instance'; import Engine from '@ember/engine'; import EngineInstance from '@ember/engine/instance'; import { assign, merge } from '@ember/polyfills'; -import { LOGGER, EMBER_EXTEND_PROTOTYPES, JQUERY_INTEGRATION } from '@ember/deprecated-features'; +import { EMBER_EXTEND_PROTOTYPES, JQUERY_INTEGRATION } from '@ember/deprecated-features'; import { templateOnlyComponent, @@ -376,11 +375,6 @@ Object.defineProperty(Ember, 'testing', { Ember._Backburner = Backburner; -// ****@ember/-internals/console**** -if (LOGGER) { - Ember.Logger = Logger; -} - // ****@ember/-internals/runtime**** Ember.A = A; Ember.String = { diff --git a/packages/ember/tests/reexports_test.js b/packages/ember/tests/reexports_test.js index 4bccf517f6b..8960a2a1e1a 100644 --- a/packages/ember/tests/reexports_test.js +++ b/packages/ember/tests/reexports_test.js @@ -519,9 +519,6 @@ let allExports = [ // @ember/-internals/meta ['meta', '@ember/-internals/meta'], - // @ember/-internals/console - ['Logger', '@ember/-internals/console', 'default'], - // @ember/-internals/views ['ViewUtils.isSimpleClick', '@ember/-internals/views', 'isSimpleClick'], ['ViewUtils.getElementView', '@ember/-internals/views', 'getElementView'],