forked from emberjs/rfcs
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
- Start Date: 2015-06-14 | ||
- RFC PR: (leave this empty) | ||
- Ember Issue: (leave this empty) | ||
|
||
# Summary | ||
|
||
Publicize Log Level API for `Ember.deprecate` to allow different log levels. | ||
|
||
# Motivation | ||
|
||
Currently a call to `Ember.deprecate()` either logs the deprecation message or | ||
throws an error, depending on the `ENV['RAISE_ON_DEPRECATION']` flag. Some | ||
deprecations need much work so the code base is fully transitioned into the | ||
new, preferred way. In [PR #1141](https://github.com/emberjs/ember.js/pull/11419) | ||
a private log level API has been introduced, which allows finer grained control | ||
if specific deprecations should be logged, throwing an error or be silenced | ||
completely: | ||
|
||
|
||
Ember.Debug._addDeprecationLevel('my-feature', Ember.Debug._deprecationLevels.LOG); | ||
... | ||
Ember.deprecate("x is deprecated, use Y instead", false, { id: 'my-feature' }); | ||
|
||
|
||
Since this is currently a private API, its use is discouraged outside internals | ||
of Ember.js, though a certain usefulness is given. | ||
|
||
# Detailed design | ||
|
||
Publicize the current private APIs by simple rename: | ||
|
||
Ember.Debug._addDeprecationLevel -> Ember.Debug.addDeprecationLevel | ||
Ember.Debug._deprecationLevels -> Ember.Debug.deprecationLevels | ||
|
||
# Drawbacks | ||
|
||
Unsure of any at this time. | ||
|
||
# Alternatives | ||
|
||
- custom depreaction handling | ||
|
||
# Unresolved questions | ||
|
||
- Change API besides a simple rename? |