-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Logging by Tinylog #7
Comments
I can work on this issue |
Sure! ^^ Few rules tho:
Other than that, yeah, replace every |
To clarify, what do you mean auto formatting? Do you mean like from the IDE? |
I'm assuming I shouldn't change replace println logs in try-catch blocks either as this would also cause a conflict. For example, Logger.getLogger.log(...).log() |
Yes, IDE auto-formatting. |
I think we should use slf4j/jdk-logging with tiny log bindings. Also I’m not a big fan of using the global logger. Classes should use their own logger. This way it’s easier to trace back the origin of message. |
I don't care much about logger choice, but I agree that the classes should use their own.
Btw, @koppor, I decided to donate 1 Hacktober PR to JabRef! ❤️ |
@weisJ The recommendation to use TinyLog was that the usage is very Java-beginner friendly: import org.tinylog.Logger;
public class Application {
public static void main(String[] args) {
Logger.info("Hello World!");
}
} No need to instantiate the My proposal of Tinylog was only to be friendly to guys coming from python (I look at you @Foadsf). I am aware that Java-homies are more SLF4-friends (consistency with other Java-projects). |
Ok if we can change the logger i would take log4j2. It is by far the best of all loggers. SLF4J was the one used for every project. The API of log4j2 is much more jdk8 friendly e.g. you can do Logger.withException().log(). This avoids the problem slf4j has with throwable and a message. I assumed Tinylog doesn't have instance logging? |
Sure, I'm fine with it. Our decision to go with tinylog wasn't really thought out anyway. It was dead simple, small size, and performant. But I agree that it's maybe too simple ^^ |
@MaSven Not sure what you mean by "instance logging". The current method and thread are logged. See at the intro of tiny log: https://tinylog.org/v2/getting-started/ Seeing that are Java professionals here used to SLF4J, I don't want to put cognitive load on them to think about another logging framework, I would also opt for SLF4J. - The issues it this project are at so many other places... |
Quote from the docs: When you run this small application, you will see the following output in the console:
|
OK and which logging implementation should be used? Slf4j is only the facade. With instance logging I mean per class logging. I think this is not possible with tinylog. I can't filter out a class for example in the config. Also I think log4j2 has the easier api for beginners. But I can also live with slf4j. |
@MaSven You are right. I would in call cases log errors. https://tinylog.org/v2/configuration/#severity-level and it reads
Thus |
Then we should stick with tinylog it has enough features and we already use it now in many places. The project also looks decent enough and they take performance serious. Just my thought about it. |
Tinylog has sl4j bindings |
As I said the slf4j api has many problems. I would suggest to using tinylog directly. |
I love that the logger choice is the most debated topic currently ^^ So I guess we have consensus, we are using tinylog for now. It's a very easy thing to replace anyway. |
So this is partially solved by #57 . What is missing are proper settings for where to store the logs and also what roation we use. |
Tinylog: https://tinylog.org/v2/getting-started/
Because it's very simple to use.
Alterantives:
The text was updated successfully, but these errors were encountered: