Skip to content

Commit

Permalink
Improved logMessages, added more colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Netfloex committed May 6, 2022
1 parent 76b2b8a commit 9952e0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/logMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ export const logMessages = defineLogList({
nginxConfNotFound: ({ nginxPath }: { nginxPath: string }) => [
Log.warn,
Tag.nginx,
chalk`nginx.conf does not exist: {dim ${nginxPath}}`
chalk`Could not find nginx.conf: {dim ${nginxPath}}`
],

// Certbot and certificates

noCertbotEmail: () => [
Log.error,
Tag.certbot,
chalk`{red You must set the {reset {bold {dim CERBOT_EMAIL}}} environment variable, certbot can not run without it.}`
chalk`{red You must set the {reset {dim CERBOT_EMAIL}} environment variable, certbot can not run without it.}`
],
noCertbotBinary: () => [
Log.error,
Expand Down Expand Up @@ -139,17 +139,17 @@ export const logMessages = defineLogList({
certbotError: ({ messages = [] }: { messages: string[] }) => [
Log.error,
Tag.certbot,
chalk`Certbot ran into an error:\n {dim ${messages.join("\n")}}`
chalk`{red Certbot ran into an error:}\n {dim ${messages.join("\n")}}`
],
missingSSLFiles: ({ serverName }: { serverName: string }) => [
Log.info,
Tag.certbot,
chalk`{dim ${serverName}} does not have all necessary certificate files, disabled until created.`
chalk`{yellow The server {dim ${serverName}} has missing certificate files, requesting...}`
],
missingSSLFilesFinal: ({ serverName }: { serverName: string }) => [
Log.error,
Tag.certbot,
chalk`The certificate files for {dim ${serverName}} could not be created, please see the error above. ${
chalk`{red The certificate files for {dim ${serverName}} could not be created, please see the error above.} ${
settings.enableConfigMissingCerts
? chalk`This domain will still be {bold enabled}`
: "This domain is now disabled."
Expand Down Expand Up @@ -221,7 +221,7 @@ export const logMessages = defineLogList({

// Nginx Config

configDone: ({ server }: { server: SimpleServer }) => [
configDone: ({ server = {} as SimpleServer }: { server: SimpleServer }) => [
Log.done,
Tag.nginx,
server.proxy_pass
Expand Down
2 changes: 2 additions & 0 deletions src/lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,5 @@ export const logger: Logger = (
}),
{} as Logger
);

// Object.values(logger).forEach((log) => log({}));

0 comments on commit 9952e0b

Please sign in to comment.