Glavin001 / battlecode

A scaffold for players of battlecode 2016
3 stars 0 forks source link

created debug class and removed debug from PlayerRobot. #23

Open shawnmacburnie opened 8 years ago

shawnmacburnie commented 8 years ago

Check it out guys, let me know what you think.

Glavin001 commented 8 years ago

The interface should look like what was indicated here: https://github.com/Glavin001/battlecode/issues/7#issuecomment-171373011

Something like:

DEBUG.setLevel(2); // <-- only show errors and warnings
DEBUG.error("always show");
DEBUG.warn("always show");
DEBUG.info("if you want");
DEBUG.verbose("if you really want");
DEBUG.debug("if you really really want");

Levels are prioritized from 0 to 4:

{ error: 0, warn: 1, info: 2, verbose: 3, debug: 4}
shawnmacburnie commented 8 years ago

That doesnt work for what we will use it for. This is for debugging. The way I have it you dont have to see the junk logging for all other peoples testing. I only see mine. I want to only see logging for my tests.

If we do as you say with levels I don't see a reason to have it in at all, and if that is the case we should have print statements and not write a debug class.

The way I have it you write a log message that is associated to a name. So when I am testing my code I only see logging for stuff I am working on, and not logging that everyone else is working on too. because when everything is log. there are thousands of log statements. which is not readable.