Task #169 (closed)
Opened 18 years ago
Closed 9 years ago
Rework logging to use varargs and to silence test output.
Reported by: | jamoore | Owned by: | jamoore |
---|---|---|---|
Priority: | trivial | Milestone: | 5.0.0 |
Component: | General | Version: | 3.0-M2 |
Keywords: | logging, cleanup, build, testing | Cc: | |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | n.a. |
Description (last modified by jmoore)
Now that /common and /client are compiling with Java5 (#154) all references to Commons Logging (private static Log log = Logger...) should be replaced by an internal Log class similar to that in Stripes using varargs to prevent the toString() overhead.
While doing this, all tests should be fixed to use logging as well. Depending on what our Log/LogFactory? solution looks like, something along the lines of :
private static Log TESTLOG = LogFactory.testLogger(MyTest.class); // equivalent to // TESTLOG = LogFactory.logger("TEST-"+MyTest.class.getName());
That way, all testing could be turned off with:
log4j.category.TEST = error
or redirected to a file.
Change History (5)
comment:1 Changed 18 years ago by jmoore
- Description modified (diff)
- Summary changed from Reworking logging to use varargs to Rework logging to use varargs and to silence test output.
- Version changed from 3.0-M1 to 3.0-M2
comment:2 Changed 18 years ago by jmoore
- Keywords build testing added
comment:3 Changed 18 years ago by jmoore
In addition, we may should start injecting loggers to avoid statics. See: http://wiki.apache.org/jakarta-commons/Logging/StaticLog for more.
comment:4 Changed 16 years ago by jmoore
- Type changed from User Story to Task
comment:5 Changed 9 years ago by jamoore
- Milestone changed from Unscheduled to 5.0.0
- Resolution set to fixed
- Status changed from new to closed
with SLF4J this is now done.
"TEST-"<classname> log4j categories won't suffice. Obviously, the tests are calling lots of methods which use the real loggers. Probably the only solution for the test output is a log4j.test_properties file which gets copied to target/classes during testing.