Shorten logger name #60

Closed
opened 2026-04-09 10:29:58 +02:00 by lars.winzer · 9 comments
lars.winzer commented 2026-04-09 10:29:58 +02:00 (Migrated from git.scicore.unibas.ch)

Feature Request

Summary

Currently, when creating new loggers, the entire classpath is used as the name for the logger, resulting in extremely long names that clutter the console output or log file.

Required workarround

None.

Description

The typical console output resembles this:

10:19:31.649 INFO     ch.unibas.dmi.dbis.cs108.casono.server.ServerApp Starting server at port 5123

However, most of the classpath (ch.unibas.dmi.dbis.cs108.) is irrelevant. Even the project name and distinction between server and client can be omitted.

Applying this to the output above would result in a more readable version:

10:19:31.649 INFO     ServerApp Starting server at port 5123

Checklist

  • I have described the function in detail
  • I searched docs for alternative implementations matching my needs
  • I added relevant labels
## Feature Request <!--The reccommended type is: Task--> ### Summary Currently, when creating new loggers, the entire classpath is used as the name for the logger, resulting in extremely long names that clutter the console output or log file. ### Required workarround None. ### Description The typical console output resembles this: ``` 10:19:31.649 INFO ch.unibas.dmi.dbis.cs108.casono.server.ServerApp Starting server at port 5123 ``` However, most of the classpath (`ch.unibas.dmi.dbis.cs108.`) is irrelevant. Even the project name and distinction between server and client can be omitted. Applying this to the output above would result in a more readable version: ``` 10:19:31.649 INFO ServerApp Starting server at port 5123 ``` ### Checklist - [x] I have described the function in detail - [x] I searched docs for alternative implementations matching my needs - [x] I added relevant labels
lars.winzer commented 2026-04-09 14:46:42 +02:00 (Migrated from git.scicore.unibas.ch)

Moved to MS5 as it offers no real benefit for this milestone.

Moved to MS5 as it offers no real benefit for this milestone.
lars.winzer commented 2026-04-13 21:37:00 +02:00 (Migrated from git.scicore.unibas.ch)

Class.getSimpleName can be used to only get the Name of the class, instead of the classpath.

Alternatively a utility class can be used to sanatize the classpath (i.e. removing ch.unibas.dmi.dbis.cs108. )

[Class.getSimpleName](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getSimpleName--) can be used to only get the Name of the class, instead of the classpath. Alternatively a utility class can be used to sanatize the classpath (i.e. removing `ch.unibas.dmi.dbis.cs108.` )
lars.winzer commented 2026-04-13 22:01:31 +02:00 (Migrated from git.scicore.unibas.ch)

mentioned in task #109

mentioned in task #109
lars.winzer commented 2026-04-27 01:11:53 +02:00 (Migrated from git.scicore.unibas.ch)

Task will be moved to Milestone 6

Task will be moved to Milestone 6
lars.winzer commented 2026-04-27 01:12:46 +02:00 (Migrated from git.scicore.unibas.ch)

assigned to @lars.winzer

assigned to @lars.winzer
lars.winzer commented 2026-05-12 12:49:45 +02:00 (Migrated from git.scicore.unibas.ch)

created branch feat/60-shorten-logger-name to address this issue

created branch [`feat/60-shorten-logger-name`](/cs108-fs26/Gruppe-13/-/compare/main...feat%2F60-shorten-logger-name) to address this issue
lars.winzer commented 2026-05-12 13:02:19 +02:00 (Migrated from git.scicore.unibas.ch)

added 10m of time spent at 2026-05-12 12:00:00 +0200

added 10m of time spent at 2026-05-12 12:00:00 +0200
lars.winzer commented 2026-05-12 13:06:22 +02:00 (Migrated from git.scicore.unibas.ch)

mentioned in merge request !166

mentioned in merge request !166
lars.winzer commented 2026-05-12 19:06:58 +02:00 (Migrated from git.scicore.unibas.ch)

mentioned in commit baa1d51a1f

mentioned in commit baa1d51a1fa78002bfbfa639087fda044bec859f
lars.winzer (Migrated from git.scicore.unibas.ch) closed this issue 2026-05-12 19:06:58 +02:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: University-of-Basel-Studentprojects/Programmierprojekt#60