mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 07:54:22 +00:00
Simplify logging
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"novamd/internal/logging"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
)
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
type Server struct {
|
||||
router *chi.Mux
|
||||
options *Options
|
||||
logger *slog.Logger
|
||||
}
|
||||
|
||||
// NewServer creates a new server instance with the given options
|
||||
@@ -19,7 +18,6 @@ func NewServer(options *Options) *Server {
|
||||
return &Server{
|
||||
router: setupRouter(*options),
|
||||
options: options,
|
||||
logger: options.Logger.App(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +25,7 @@ func NewServer(options *Options) *Server {
|
||||
func (s *Server) Start() error {
|
||||
// Start server
|
||||
addr := ":" + s.options.Config.Port
|
||||
s.logger.Info("Starting server", "address", addr)
|
||||
logging.Info("Starting server", "address", addr)
|
||||
return http.ListenAndServe(addr, s.router)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user