Bonjour,
Quelqu'un sait-il à quoi sert l'annotation @MessageLogger de Seam ?
Dans la doc ça dit :
Il y a même un exempleThe 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.
Mais je ne comprend pas du tout ce que c'est censé faire...
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); }
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.
Partager