1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-25 09:03:28 +00:00
Files
browser/libs/common/src/tools/log/disabled-logger.ts
✨ Audrey ✨ 97a591e738 [PM-16793] port credential generator service to providers (#14071)
* 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>
2025-05-27 09:51:14 -04:00

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);
}
},
});