mirror of
https://github.com/bitwarden/browser
synced 2026-02-25 09:03:28 +00:00
* introduce extension service * deprecate legacy forwarder types * eliminate repeat algorithm emissions * extend logging to preference management * align forwarder ids with vendor ids * fix duplicate policy emissions; debugging required logger enhancements ----- Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
25 lines
731 B
TypeScript
25 lines
731 B
TypeScript
import { Jsonify } from "type-fest";
|
|
|
|
import { deepFreeze } from "../util";
|
|
|
|
import { SemanticLogger } from "./semantic-logger.abstraction";
|
|
|
|
/** All disabled loggers emitted by this module are `===` to this logger. */
|
|
export const DISABLED_LOGGER: SemanticLogger = deepFreeze({
|
|
debug<T>(_content: Jsonify<T>, _message?: string): void {},
|
|
|
|
info<T>(_content: Jsonify<T>, _message?: string): void {},
|
|
|
|
warn<T>(_content: Jsonify<T>, _message?: string): void {},
|
|
|
|
error<T>(_content: Jsonify<T>, _message?: string): void {},
|
|
|
|
panic<T>(content: Jsonify<T>, message?: string): never {
|
|
if (typeof content === "string" && !message) {
|
|
throw new Error(content);
|
|
} else {
|
|
throw new Error(message);
|
|
}
|
|
},
|
|
});
|