#1001 Cleanup middleware #1068

Merged
c24danli merged 3 commits from #1001-cleanup-middleware into team_2_week_7 2026-05-22 09:13:07 +00:00
Collaborator

Replaced all Console.WriteLine with ILogger, Removed commented out/unused code and fixed typos.

Replaced all Console.WriteLine with ILogger, Removed commented out/unused code and fixed typos.
Replaced all Console.WriteLine with ILogger, Removed commented out code and fixed typos.
a24sakma requested changes 2026-05-21 14:04:03 +00:00
Dismissed
a24sakma left a comment
Collaborator

So middleware is not like the services where you can just easily call ilogger. Can you check if you can find a way for it

So middleware is not like the services where you can just easily call ilogger. Can you check if you can find a way for it
@ -14,3 +12,3 @@
private static string dbUser = Environment.GetEnvironmentVariable("DATABASE_USER");
private static string dbPassword = Environment.GetEnvironmentVariable("DATABASE_PASSWORD");
//private static string connectionString = $"Host=energy-db;Port=5432;Username={dbUser};Password={dbPassword};Database=";
private static ILogger<Program> logger;
Collaborator

Here it throws error

Here it throws error
a24sakma marked this conversation as resolved
@ -23,6 +21,8 @@ public partial class Program
/// <returns></returns>
static async Task Main(string[] args)
{
using var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
Collaborator

same here

same here
a24sakma marked this conversation as resolved
Author
Collaborator

Would need to add 2 new dependencies so I'm just gonna change it back to Console.WriteLine. @a24sakma

Would need to add 2 new dependencies so I'm just gonna change it back to Console.WriteLine. @a24sakma
changed back from the logger to console.writeline.
Collaborator

@c24carso wrote in #1068 (comment):

Would need to add 2 new dependencies so I'm just gonna change it back to Console.WriteLine. @a24sakma

we can write a comment about why we did not change to Ilogger in program.cs why this is not changed in the middleware but it is changed in other places so that the next group do not need to go through the same

@c24carso wrote in https://git.webug.se/Andras/BoundlessFlowCampus2K/pulls/1068#issuecomment-13032: > Would need to add 2 new dependencies so I'm just gonna change it back to Console.WriteLine. @a24sakma we can write a comment about why we did not change to Ilogger in program.cs why this is not changed in the middleware but it is changed in other places so that the next group do not need to go through the same
a24sakma approved these changes 2026-05-22 07:54:39 +00:00
a24sakma left a comment
Collaborator

After some understanding about why Ilogger can not be applied and the need of libraries. It makes sense to go back to console write line like as Carl did.

the update and delete was removed as it was decided in mock up team with leaders.
the project runs as expected.
the services are functioning as expected.
I approve this issue. Good job!

After some understanding about why Ilogger can not be applied and the need of libraries. It makes sense to go back to console write line like as Carl did. the update and delete was removed as it was decided in mock up team with leaders. the project runs as expected. the services are functioning as expected. I approve this issue. Good job!
c24danli merged commit 8815d1e4ba into team_2_week_7 2026-05-22 09:13:07 +00:00
c24danli deleted branch #1001-cleanup-middleware 2026-05-22 12:28:55 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K!1068
No description provided.