Show TOC Start of Content Area

This graphic is explained in the accompanying text Example of Working on a Location Object  Locate the document in its SAP Library structure

 

package com.sap.fooPackage;

 

import com.sap.tc.logging.*;

 

public class Node {

   private static final Location loc =

      Location.getLocation("com.sap.fooPackage.Node");

   public void announce(Object o) {

      String method = "announce(java.lang.Object)";

      try {

      // do something...eg. connecting to DB, perform certain actions

      loc.debugT(method, "Connecting to ….“);

      //minor error in writing something

      loc.warningT(method,

                          "Problems in row {0} to {1}“,

                           new Object[] {row1, rowN});

      //finish successfully

      loc.infoT(method, "DB action done successfully“);

   }   

   catch (Exception e) {

   }

  }  // method announce

}  // class Node

 

Potential output, assuming the simplest case with ConsoleLog and default TraceFormatter:

May 3, 2003 6:54:18 PM com.sap.fooPackage.Node.announce [main] Debug: Connecting to ….

May 3, 2003 6:54:18 PM com.sap.fooPackage.Node.announce [main] Warning: Problems in row 15 to 18

May 3, 2003 6:54:18 PM com.sap.fooPackage.Node.announce [main] Info: DB action done successfully

 

End of Content Area