File tree Expand file tree Collapse file tree 1 file changed +32
-18
lines changed Expand file tree Collapse file tree 1 file changed +32
-18
lines changed Original file line number Diff line number Diff line change 1
1
import { pino } from "pino" ;
2
2
3
- // Always use the full logger configuration regardless of environment
4
- const logger : pino . Logger = pino ( {
5
- level : "trace" ,
6
- transport : {
7
- targets : [
8
- {
9
- level : "trace" ,
10
- target : "pino-pretty" ,
11
- options : {
12
- colorize : true ,
13
- levelFirst : true ,
14
- destination :
15
- process . platform === "win32"
16
- ? "C:\\Windows\\Temp\\browserstack-mcp-server.log"
17
- : "/tmp/browserstack-mcp-server.log" ,
3
+ let logger : pino . Logger ;
4
+
5
+ if ( process . env . NODE_ENV === "development" ) {
6
+ logger = pino ( {
7
+ level : "debug" ,
8
+ transport : {
9
+ targets : [
10
+ {
11
+ level : "debug" ,
12
+ target : "pino-pretty" ,
13
+ options : {
14
+ colorize : true ,
15
+ levelFirst : true ,
16
+ destination :
17
+ process . platform === "win32"
18
+ ? "C:\\Windows\\Temp\\browserstack-mcp-server.log"
19
+ : "/tmp/browserstack-mcp-server.log" ,
20
+ } ,
18
21
} ,
22
+ ] ,
23
+ } ,
24
+ } ) ;
25
+ } else {
26
+ // NULL logger
27
+ logger = pino ( {
28
+ level : "info" ,
29
+ transport : {
30
+ target : "pino/file" ,
31
+ options : {
32
+ destination : process . platform === "win32" ? "NUL" : "/dev/null" ,
19
33
} ,
20
- ] ,
21
- } ,
22
- } ) ;
34
+ } ,
35
+ } ) ;
36
+ }
23
37
24
38
export default logger ;
You can’t perform that action at this time.
0 commit comments