-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JavaScript (v3): libs - Move Prompter.logSeparator to Logger.logSepar…
…ator.
- Loading branch information
1 parent
bf45b05
commit 2a4257a
Showing
7 changed files
with
75 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export class Logger { | ||
/** | ||
* @param {string} message | ||
*/ | ||
log(message) { | ||
console.log(message); | ||
return Promise.resolve(); | ||
} | ||
|
||
/** | ||
* Log a horizontal rule to the console. If a message is provided, | ||
* log a section header. | ||
* @param {string?} message | ||
*/ | ||
logSeparator(message) { | ||
if (!message) { | ||
console.log("\n", "*".repeat(80), "\n"); | ||
} else { | ||
console.log( | ||
"\n", | ||
"*".repeat(80), | ||
"\n", | ||
"** ", | ||
message, | ||
" ".repeat(80 - message.length - 8), | ||
"**\n", | ||
"*".repeat(80), | ||
"\n", | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters