mauricioaniche / repodriller

a tool to support researchers on mining software repositories studies
174 stars 39 forks source link

Configurable behaviour for user exceptions #80

Open ayaankazerouni opened 7 years ago

ayaankazerouni commented 7 years ago

If there's an error in my code, it'd be nice if I could see Exceptions and stack traces and the like. Currently it seems like RepoDriller masks all of this.

mauricioaniche commented 7 years ago

(Related to #78)

@ayaankazerouni You are right. Up to now, repodriller basically logs your exception and moves on. Just to get more context, what would you want to do with the exception? And why would an exception 'escape' from your study class?

For now, my thoughts were: your study should catch any exceptions that it may throw. If, for some reason, an exception escaped, there's nothing much you can do; we log and move on.

ayaankazerouni commented 7 years ago

I was thinking more about unintended Exceptions whose error messages are useful for debugging issues. Right now, the study just ends if something is wrong. I'm using APIs that I'm not really familiar with (Eclipse JDT, RepoDriller itself), so that stuff would be helpful. More dangerous, if I get output that looks correct, I have no idea if an Exception ended the study early.

If, for some reason, an exception escaped, there's nothing much you can do;

Yes, but I would think the client should decide what to do in this situation, right?

log and move on

Do you mean log4j? I haven't been able to get that working, but that's my lack of expertise and a separate issue :)

mauricioaniche commented 7 years ago

Does it stop? It shouldn't! When an error occurs (let's suppose you forgot to get an exception) and it pops up to repodriller, the framework catches it, and logs the error using log4j!

If you don't see log4j logs on your console, then you are not configuring it! Create the log4.xml in your src/main/resources folder. An example can be found here: https://github.com/mauricioaniche/repodriller/blob/master/src/main/resources/log4j.xml.example

Then, let me know if the log is enough. And if repodriller is really crashing due to an exception, I wanna see your source code. If you are at TU Delft next week, we can meet!

ayaankazerouni commented 7 years ago

Ok, I had my log4j.xml in the project root. I've moved it to src/main/resources/, and things seem to be logging now. I now see some exceptions messages. Thanks for the help!

I would still consider configurable exception behaviours, though.

EDIT: It's a long trek from the US to the Netherlands, so I probably won't be at TU Delft next week :)

mauricioaniche commented 7 years ago

Oh, sorry, @ayaankazerouni! I thought you were one of our current students!! :)

I'll keep this issue open so that we re-visit it soon! Meanwhile, if you wanna contribute with a PR that actually makes this log configuration more explicit, I guess that'd be very helpful!!

ayaankazerouni commented 6 years ago

This seems to have resurfaced in a different way. I've gotten log4j2 configured and working since I first opened this issue. But it's no longer logging any Exceptions that my code throws, which is making debugging kind of difficult. Perhaps one of the recent updates did something?

EDIT: Maybe 'resurfaced' is not the right word...

cc: @davisjam

mauricioaniche commented 6 years ago

Are you sure it's not something wrong in your code? Logs are working on our CI: https://travis-ci.org/mauricioaniche/repodriller

ayaankazerouni commented 6 years ago

Ok, you know what? I think it was an overly-broad catch clause in my own code. Ignore these messages!