on 02-23-2008 7:27 PM
Hi!
I have a java File *.java which is inside of Developments
src/packages/.......
The problem is now that I would like trace some methods and variables of this class(*.java ).
But I can't use - > wdThis.wdGetIPersonController().getLocation() in the mentioned java File.
What can I use instead of ?
mLocation =
Location.getLocation(????????????????)
The standard usage of Logging at WebDynpro is as follows:
I have to implement a getLocation method:
public com.sap.tc.logging.Location getLocation( )
{
//@@begin getLocation()
mLocation =
Location.getLocation( wdThis.wdGetIPersonController().getLocation(),
"im.IPersonMainView");
return getLocation();
}
return mLocation;
//@@end
}
Sas-
You do not have to create a getLocation() method. When you create a component/view/custom controllers. Each controller has a private Location reference:
private static final com.sap.tc.logging.Location logger =
com.sap.tc.logging.Location.getLocation(TableCompView.class);
Just use this reference logger for all your logging needs. For example:
logger.debugT("The number of rows fetched is " + numRows);
Cheers-
Atul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Atul
is it really true that I don' t need "getLocation()" method.
But please notice this java class what I'm talking about is not a component/view/custom controller.
It is a java class with some needful functions. It's location is inside of Developments
src/packages/.......
regards
sas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sas-
If you are not using a standard web dynpro controller you will have to explicitely create your own logger. However you do not have to create a getLocation() method. In your java class create a private attribute of type Location.
private static final com.sap.tc.logging.Location logger = com.sap.tc.logging.Location.getLocation(__YourClassName__.class);
Where __YourClassName__ is the name of your class.
Now you can use this reference logger for all your logging needs as described in my previous post.
Cheers-
Atul
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.