-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
125 additions
and
122 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
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 was deleted.
Oops, something went wrong.
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,43 @@ | ||
import chalk from 'chalk'; | ||
|
||
import { DEFAULT_OPTIONS } from '../options/default-options'; | ||
|
||
export const messagePrefix = 'svg-to-ts:'; | ||
|
||
export class Logger { | ||
private static verbose = DEFAULT_OPTIONS.verbose; | ||
|
||
public static changeVisibility(verbose: boolean) { | ||
Logger.verbose = verbose; | ||
} | ||
|
||
static printLogo() { | ||
console.log(chalk.blue(`==========================================================`)); | ||
console.log(chalk.blue(`👷 Hi I am svg-to-ts - let's build an awesome icon library`)); | ||
console.log(chalk.blue(`==========================================================`)); | ||
} | ||
|
||
static generationSuccess(path: string) { | ||
Logger.logWithPrefix( | ||
chalk.underline.green(`🏁 Everything is perfect: Icons succesfully generated under ${chalk.blue.underline(path)}`) | ||
); | ||
} | ||
|
||
static info(message: string) { | ||
Logger.logWithPrefix(`ℹ️ ${chalk.blueBright(message)}`); | ||
} | ||
|
||
static verboseInfo(message: string) { | ||
if (Logger.verbose) { | ||
Logger.logWithPrefix(`ℹ️ ${chalk.blueBright(message)}`); | ||
} | ||
} | ||
|
||
static error(message: string) { | ||
Logger.logWithPrefix(chalk.red(message)); | ||
} | ||
|
||
private static logWithPrefix(messageLog: string) { | ||
console.log(chalk.blue(messagePrefix), messageLog); | ||
} | ||
} |
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
Oops, something went wrong.