Adding new logging function
This commit is contained in:
@@ -4,6 +4,7 @@ import cors from "cors";
|
||||
import dotenv from "dotenv";
|
||||
import dataRoutes from "./routes/dataRoutes.js";
|
||||
import inventoryRoutes from "./routes/inventoryRoutes.js";
|
||||
import { LoggingLevel, setLevel, smartLogging } from "./utils/helper.js";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
@@ -16,5 +17,7 @@ app.use(express.json());
|
||||
app.use("/api/data", dataRoutes);
|
||||
app.use("/api/inventory", inventoryRoutes);
|
||||
|
||||
//Set Logging Level
|
||||
setLevel(LoggingLevel.AppTrace); //This should get passed in from the Docker-Compose.
|
||||
const PORT = process.env.PORT || 3000;
|
||||
app.listen(PORT, () => console.log(`Server running on port ${PORT}`));
|
||||
app.listen(PORT, () => smartLogging(LoggingLevel.Logging, `Server running on port ${PORT}`));
|
||||
|
||||
Reference in New Issue
Block a user