Skip to content

Commit

Permalink
Log where a config proxy passes
Browse files Browse the repository at this point in the history
  • Loading branch information
Netfloex committed May 3, 2022
1 parent 6ca976b commit 64e6e08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/lib/logMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ import { msToDays } from "@utils/msToDays";
import settings from "@utils/settings";
import { startedToSeconds } from "@utils/startedToSeconds";

import { SimpleServer } from "@models/ParsedConfig";

/*
Typescript helper function
Input must be a valid Log Item
Output type is inferred
*/

export const defineLogList = <
T extends Record<
string,
Expand Down Expand Up @@ -218,10 +221,12 @@ export const logMessages = defineLogList({

// Nginx Config

configDone: ({ serverName }: { serverName: string }) => [
configDone: ({ server }: { server: SimpleServer }) => [
Log.done,
Tag.nginx,
chalk`${serverName}`
server.proxy_pass
? chalk`{dim ${server.server_name}} {yellow {bold >}} {dim ${server.proxy_pass}}`
: chalk`${server.server_name}`
],

// User Config
Expand Down
2 changes: 1 addition & 1 deletion src/utils/createConfigFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ export const createConfigFiles = (

await outputFile(fileName, nginxConfig);

logger.configDone({ serverName: server.server_name });
logger.configDone({ server });
});
};

0 comments on commit 64e6e08

Please sign in to comment.