* Logs a deprecation notice at the Level.WARNING log level, once per * `id` for this logger's lifetime — a repeat call with the same `id` is a * no-op, matching the once-only behavior `util.deprecate` gives by call-site * identity, but keyed on a stable id instead so it survives bei
(id, message)
| 414 | * @throws {TypeError} if `id` is empty. |
| 415 | */ |
| 416 | deprecate(id, message) { |
| 417 | if (!id) { |
| 418 | throw new TypeError('Logger#deprecate() requires a non-empty id') |
| 419 | } |
| 420 | if (this.deprecated_.has(id)) { |
| 421 | return |
| 422 | } |
| 423 | if (!this.isLoggable(Level.WARNING)) { |
| 424 | return |
| 425 | } |
| 426 | this.deprecated_.add(id) |
| 427 | this.warning(`[${id}] ${message}`) |
| 428 | } |
| 429 | |
| 430 | /** |
| 431 | * Logs a message at the {@link Level.DEBUG} log level. |
no test coverage detected