I have the following classes :
class Task
{
public void DoSomething()
{
var s = new Service();
s.First();
s.Second();
s.Third();
}
}
class Service
{
public void First() {};
public void Second() {};
public void Third() {};
}
If I want to add logging, should I put logging statements like this :
public void DoSomething()
{
Log("new");
var s = new Service();
Log("First");
s.First();
Log("Second");
s.Second();
Log("Third");
s.Third();
}
Or should I put each statement inside the called methods of Service class ?
I know it is quite subjective, and won't change a lot of things, but I'm curious about the pros and cons of each approach.
Update : I'm not asking about verbosity or level, just about placement of the logging statements.