feat(logging): Debug logging
This commit is contained in:
		
							
								
								
									
										5
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								main.go
									
									
									
									
									
								
							@@ -98,6 +98,8 @@ func initLogger() error {
 | 
			
		||||
	defer zapLogger.Sync()
 | 
			
		||||
	logger = zapLogger.Sugar()
 | 
			
		||||
 | 
			
		||||
	logger.Debug("Initialized logger")
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -151,6 +153,7 @@ func main() {
 | 
			
		||||
			BaseUrl: config.GotenbergBaseUrl,
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
	logger.Debug("Initialized services")
 | 
			
		||||
 | 
			
		||||
	// Create a new Fiber instance
 | 
			
		||||
	app := fiber.New(fiber.Config{
 | 
			
		||||
@@ -176,9 +179,11 @@ func main() {
 | 
			
		||||
	pdfv1.Post("/certificates", handler.GenerateCertificate)
 | 
			
		||||
 | 
			
		||||
	v1.Get("/barcodes/:type/:content", handler.GenerateBarcode)
 | 
			
		||||
	logger.Debug("Initialized routes")
 | 
			
		||||
 | 
			
		||||
	app.Use(handler.NotFoundHandler)
 | 
			
		||||
	docs.SwaggerInfo.BasePath = "/"
 | 
			
		||||
 | 
			
		||||
	logger.Infow("Starting server", "port", config.Port)
 | 
			
		||||
	logger.Error(app.Listen("0.0.0.0:" + config.Port))
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user