Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Option to reduce file size #260

Open
tcmot opened this issue Sep 21, 2022 · 1 comment
Open

Option to reduce file size #260

tcmot opened this issue Sep 21, 2022 · 1 comment

Comments

@tcmot
Copy link

tcmot commented Sep 21, 2022

I would like to have a core library.

It doesn't contain too much features.

Only core features.

Tinylog is still too fat.

Don't add features,It immediately becomes Log4j2.

@pmwmedia pmwmedia changed the title It's just a suggestion. Reduce to core features Sep 21, 2022
@pmwmedia
Copy link
Member

pmwmedia commented Sep 21, 2022

I agree that it would be nice to further reduce the JAR size of tinylog. However, stop adding features would make tinylog to become a stale project. I have another idea. My idea is having a Maven and Gradle plug-in that can remove features from tinylog.

In tinylog 2, the most features of the logging framework are services. This means that the classes are registered in META-INF/services and there are no references in the tinylog core code itself. If there would be a Maven or Gradle plug-in that could remove not needed features / classes from these service files, any bytecode optimizer like ProGuard could remove the not needed classes and all of their depended classes.

Developing such a Maven and Gradle plug-in would not be that difficult, since service files are just plain text files with fully qualified class names on each line. The plug-in itself should have an include and exclude list for fully qualified class names to keep them or remove them from the service files. Maybe, such plug-in exists already. However, I haven't found any on my quick research.

@pmwmedia pmwmedia changed the title Reduce to core features Reduce feature option to reduce file size Sep 21, 2022
@pmwmedia pmwmedia changed the title Reduce feature option to reduce file size Option to reduce file size Sep 30, 2022
@pmwmedia pmwmedia added this to the 3.0 milestone Oct 3, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Development

No branches or pull requests

2 participants