Skip to content

Commit

Permalink
Added "nginx" log tag for nginx config related messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Netfloex committed May 1, 2022
1 parent 345444c commit 06d81a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/lib/logMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,24 @@ export const logMessages = defineLogList({

removeOldConfigs: () => [
Log.info,
Tag.main,
Tag.nginx,
chalk`{yellow Removing old generated configs...} {dim ${settings.nginxConfigPath}}`
],

noOldConfigs: () => [
Log.error,
Tag.main,
Tag.nginx,
chalk`{red Nginx Config Path not found:} {dim ${settings.nginxConfigPath}}`
],
configsLocationHint: () => [
Log.info,
Tag.main,
Tag.nginx,
chalk`You can set {dim NGINX_CONFIG_PATH} env variable to customize this location.`
],

nginxConfNotFound: ({ nginxPath }: { nginxPath: string }) => [
Log.warn,
Tag.main,
Tag.nginx,
chalk`nginx.conf does not exist: {dim ${nginxPath}}`
],

Expand Down Expand Up @@ -208,7 +208,7 @@ export const logMessages = defineLogList({

configDone: ({ serverName }: { serverName: string }) => [
Log.done,
Tag.main,
Tag.nginx,
chalk`${serverName}`
],

Expand Down
6 changes: 4 additions & 2 deletions src/lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export enum Tag {
css,
js,
cloudflare,
env
env,
nginx
}

const TagList: Record<Tag, string> = {
Expand All @@ -34,7 +35,8 @@ const TagList: Record<Tag, string> = {
"4": chalk`[{blue CSS}]`,
"5": chalk`[{yellow JS}]`,
"6": chalk`[{hex("#FF8800") CLOUDFLARE}]`,
"7": chalk`[{blue ENV}]`
"7": chalk`[{blue ENV}]`,
"8": chalk`[{green NGINX}]`
};

const TypeList: Record<Log, string> = {
Expand Down

0 comments on commit 06d81a5

Please sign in to comment.