Can my task get the verbosity level? How does the task know what to log?


The right way to log from a task is to log everything, but choose the Importance judiciously. e.g.:
		 [Log.LogMessage(BuildEventImportance.Low,] "foo") 	
	

will be shown by most loggers only in high verbosity modes.

Can a task get the value of verbosity so it can decide whether to log a particular event?


No. It would be messy to allow tasks to have their own concept of verbosity. A few of these are listed below:
* It's sometimes a scenario to have one logger be more verbose than another one (eg for diagnostic vs. everyday logging) at the same time… if the task is deciding what messages to fire, this isn't possible.
* With the current design, you can write your own logger to log the subset of events that you want, and re-use ready made tasks. If the tasks already decided what events to fire at each verbosity, you can't reuse those tasks.
* It keeps tasks simpler to not worry about this.
Microsoft Communities