-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from sora-vp/fix-processor-log-placement
Memperbaiki penempatan posisi log file
- Loading branch information
Showing
6 changed files
with
49 additions
and
31 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,9 @@ | ||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
|
||
import { consumeMessagesFromQueue } from "./src/index"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
|
||
void consumeMessagesFromQueue(__dirname); |
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 |
---|---|---|
@@ -1,29 +1,26 @@ | ||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
import pino from "pino"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
|
||
export const logger = pino({ | ||
transport: { | ||
targets: [ | ||
{ | ||
target: "pino-pretty", | ||
level: "debug", | ||
options: { | ||
colorize: true, | ||
ignore: "pid,hostname", | ||
translateTime: "SYS:standard", | ||
export const initLogger = (destinationDirectoryPath: string) => | ||
pino({ | ||
transport: { | ||
targets: [ | ||
{ | ||
target: "pino-pretty", | ||
level: "debug", | ||
options: { | ||
colorize: true, | ||
ignore: "pid,hostname", | ||
translateTime: "SYS:standard", | ||
}, | ||
}, | ||
}, | ||
{ | ||
target: "pino/file", | ||
level: "debug", | ||
options: { | ||
destination: path.join(__dirname, "..", "processor.log"), | ||
{ | ||
target: "pino/file", | ||
level: "debug", | ||
options: { | ||
destination: path.join(destinationDirectoryPath, "processor.log"), | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}); | ||
], | ||
}, | ||
}); |