Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #169 (closed)

Opened 13 years ago

Closed 4 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 13 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 13 years ago by jmoore

  • Keywords build testing added

"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.

comment:3 Changed 13 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 11 years ago by jmoore

  • Type changed from User Story to Task

comment:5 Changed 4 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.

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.76222 sec.)

We're Hiring!