mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-11-04 11:22:10 +08:00 
			
		
		
		
	close console log
This commit is contained in:
		
							parent
							
								
									f2574eb4fe
								
							
						
					
					
						commit
						921c3a9c1d
					
				@ -2,6 +2,7 @@ package log
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"Open_IM/pkg/common/config"
 | 
						"Open_IM/pkg/common/config"
 | 
				
			||||||
 | 
						"bufio"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
@ -32,12 +33,12 @@ func loggerInit(moduleName string) *Logger {
 | 
				
			|||||||
	//All logs will be printed
 | 
						//All logs will be printed
 | 
				
			||||||
	logger.SetLevel(logrus.Level(config.Config.Log.RemainLogLevel))
 | 
						logger.SetLevel(logrus.Level(config.Config.Log.RemainLogLevel))
 | 
				
			||||||
	//Close std console output
 | 
						//Close std console output
 | 
				
			||||||
	// src, err := os.OpenFile(os.DevNull, os.O_APPEND|os.O_WRONLY, os.ModeAppend)
 | 
						src, err := os.OpenFile(os.DevNull, os.O_APPEND|os.O_WRONLY, os.ModeAppend)
 | 
				
			||||||
	// if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
	// 	panic(err.Error())
 | 
							panic(err.Error())
 | 
				
			||||||
	// }
 | 
						}
 | 
				
			||||||
	// writer := bufio.NewWriter(src)
 | 
						writer := bufio.NewWriter(src)
 | 
				
			||||||
	// logger.SetOutput(writer)
 | 
						logger.SetOutput(writer)
 | 
				
			||||||
	logger.SetOutput(os.Stdout)
 | 
						logger.SetOutput(os.Stdout)
 | 
				
			||||||
	//Log Console Print Style Setting
 | 
						//Log Console Print Style Setting
 | 
				
			||||||
	logger.SetFormatter(&nested.Formatter{
 | 
						logger.SetFormatter(&nested.Formatter{
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user