Phone country code unique (#9035)

fix #8775
This commit is contained in:
Guillim
2024-12-19 16:42:18 +01:00
committed by GitHub
parent 3f58a41d2f
commit 360c34fd18
47 changed files with 878 additions and 132 deletions

View File

@ -0,0 +1,46 @@
import { Logger } from '@nestjs/common';
interface CommandLoggerOptions {
verbose?: boolean;
constructorName: string;
}
export class CommandLogger {
private logger: Logger;
private verbose: boolean;
constructor(options: CommandLoggerOptions) {
this.logger = new Logger(options.constructorName);
this.verbose = options.verbose ?? true;
}
log(message: string, context?: string) {
if (this.verbose) {
this.logger.log(message, context);
}
}
error(message: string, stack?: string, context?: string) {
if (this.verbose) {
this.logger.error(message, stack, context);
}
}
warn(message: string, context?: string) {
if (this.verbose) {
this.logger.warn(message, context);
}
}
debug(message: string, context?: string) {
if (this.verbose) {
this.logger.debug(message, context);
}
}
verboseLog(message: string, context?: string) {
if (this.verbose) {
this.logger.verbose(message, context);
}
}
}