mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-07-01 23:23:46 +00:00
feat(issue-77): handle multiple target branches (#78)
fix: https://github.com/kiegroup/git-backporting/issues/77 This enhancement allow users to backport the same change to multiple branches with one single tool invocation
This commit is contained in:
parent
c19a56a9ad
commit
5fc72e127b
25 changed files with 1774 additions and 234 deletions
|
@ -5,32 +5,44 @@ export default class ConsoleLoggerService implements LoggerService {
|
|||
|
||||
private readonly logger: Logger;
|
||||
private readonly verbose: boolean;
|
||||
private context?: string;
|
||||
|
||||
constructor(verbose = true) {
|
||||
this.logger = new Logger();
|
||||
this.verbose = verbose;
|
||||
}
|
||||
|
||||
setContext(newContext: string) {
|
||||
this.context = newContext;
|
||||
}
|
||||
|
||||
clearContext() {
|
||||
this.context = undefined;
|
||||
}
|
||||
|
||||
trace(message: string): void {
|
||||
this.logger.log("TRACE", message);
|
||||
this.logger.log("TRACE", this.fromContext(message));
|
||||
}
|
||||
|
||||
debug(message: string): void {
|
||||
if (this.verbose) {
|
||||
this.logger.log("DEBUG", message);
|
||||
this.logger.log("DEBUG", this.fromContext(message));
|
||||
}
|
||||
}
|
||||
|
||||
info(message: string): void {
|
||||
this.logger.log("INFO", message);
|
||||
this.logger.log("INFO", this.fromContext(message));
|
||||
}
|
||||
|
||||
warn(message: string): void {
|
||||
this.logger.log("WARN", message);
|
||||
this.logger.log("WARN", this.fromContext(message));
|
||||
}
|
||||
|
||||
error(message: string): void {
|
||||
this.logger.log("ERROR", message);
|
||||
this.logger.log("ERROR", this.fromContext(message));
|
||||
}
|
||||
|
||||
private fromContext(msg: string): string {
|
||||
return this.context ? `[${this.context}] ${msg}` : msg;
|
||||
}
|
||||
}
|
|
@ -3,6 +3,10 @@
|
|||
*/
|
||||
export default interface LoggerService {
|
||||
|
||||
setContext(newContext: string): void;
|
||||
|
||||
clearContext(): void;
|
||||
|
||||
trace(message: string): void;
|
||||
|
||||
debug(message: string): void;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue