Bonjour,

Quelqu'un sait-il à quoi sert l'annotation @MessageLogger de Seam ?

Dans la doc ça dit :

The most significant and distinguishing feature of JBoss Logging is support for typed loggers. A typed logger is an interface that defines methods which serve as logging operations. When a method is invoked on one of these interfaces, the message defined in an annotation on the method is interpolated and written to the underlying logging engine.
Il y a même un exemple

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
 
import org.jboss.logging.Message;
import org.jboss.logging.LogMessage;
import org.jboss.logging.MessageLogger;
 
@MessageLogger
public interface CelebritySightingLog {
  @LogMessage @Message("Spotted celebrity %s!")
  void spottedCelebrity(String name);
}
Mais je ne comprend pas du tout ce que c'est censé faire...

Ce que j'imagine, c'est que dans mon code, quand je veux loguer quelque chose, je vais pouvoir faire un truc du style :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
 
CelebritySightingLog monlog = ...
 
public void mamethode() {
   ...
   monlog.spottedCelebrity("Thierry");
}

Est ce que j'ai bon ?

Th.