org.nuiton.log
Class UserLog

java.lang.Object
  extended by org.nuiton.log.UserLog

public class UserLog
extends Object

Classe permettant d'afficher facillement des messages a l'utilisateur. Si une interface graphique est disponible alors des boites de dialogue sont affichees. Il est aussi possible d'indique des composants a utiliser pour afficher les messages. N'importe quel composant ayant une methode setText convient

Version:
$Revision: 1637 $ Last update: $Date: 2009-06-21 04:53:31 +0200 (dim., 21 juin 2009) $ by : $Author: tchemit $
Author:
poussin

Nested Class Summary
static class UserLog.Level
           
 
Field Summary
protected static boolean graphicUI
           
protected static ListenerSet<Object> listeners
           
 
Constructor Summary
UserLog()
           
 
Method Summary
static void addListeners(ListenerSet<Object> l)
           
static void debug(String msg)
          Log message using commons-logging and display message box if UI is available and non disabled.
static void debug(String msg, Throwable cause)
          Log message using commons-logging and display message box if UI is available and non disabled.
static void error(String msg)
          Log message using commons-logging and display message box if UI is available and non disabled.
static void error(String msg, Throwable cause)
          Log message using commons-logging and display message box if UI is available and non disabled.
static void fatal(String msg)
          Log message using commons-logging and display message box if UI is available and non disabled.
static void fatal(String msg, Throwable cause)
          Log message using commons-logging and display message box if UI is available and non disabled.
static void info(String msg)
          Log message using commons-logging and display message box if UI is available and non disabled.
static void info(String msg, Throwable cause)
          Log message using commons-logging and display message box if UI is available and non disabled.
static boolean isGraphicUI()
          Return true if UI login is enabled and available.
static void removeListeners(ListenerSet<Object> l)
           
static void setGraphicUI(boolean graphicUI)
          Enable/disable UI log display.
protected static void show(UserLog.Level level, String msg, Throwable cause)
          Appel la methode setText de tous les listeners avec le message en parametre et si isGraphicUI() retourne vrai affiche une boite de dialogue avec le message
static void warn(String msg)
          Log message using commons-logging and display message box if UI is available and non disabled.
static void warn(String msg, Throwable cause)
          Log message using commons-logging and display message box if UI is available and non disabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected static ListenerSet<Object> listeners

graphicUI

protected static boolean graphicUI
Constructor Detail

UserLog

public UserLog()
Method Detail

addListeners

public static void addListeners(ListenerSet<Object> l)

removeListeners

public static void removeListeners(ListenerSet<Object> l)

setGraphicUI

public static void setGraphicUI(boolean graphicUI)
Enable/disable UI log display.

Parameters:
graphicUI - true to enable

isGraphicUI

public static boolean isGraphicUI()
Return true if UI login is enabled and available.

Returns:
graphicUI enable

show

protected static void show(UserLog.Level level,
                           String msg,
                           Throwable cause)
Appel la methode setText de tous les listeners avec le message en parametre et si isGraphicUI() retourne vrai affiche une boite de dialogue avec le message

Parameters:
level - le niveau du message
msg - le message
cause - l'exception s'il y en a une

debug

public static void debug(String msg)
Log message using commons-logging and display message box if UI is available and non disabled.

Parameters:
msg - message to display

debug

public static void debug(String msg,
                         Throwable cause)
Log message using commons-logging and display message box if UI is available and non disabled.

Parameters:
msg - message to display
cause - exception cause

info

public static void info(String msg)
Log message using commons-logging and display message box if UI is available and non disabled.

Parameters:
msg - message to display

info

public static void info(String msg,
                        Throwable cause)
Log message using commons-logging and display message box if UI is available and non disabled.

Parameters:
msg - message to display
cause - exception cause

warn

public static void warn(String msg)
Log message using commons-logging and display message box if UI is available and non disabled.

Parameters:
msg - message to display

warn

public static void warn(String msg,
                        Throwable cause)
Log message using commons-logging and display message box if UI is available and non disabled.

Parameters:
msg - message to display
cause - exception cause

error

public static void error(String msg)
Log message using commons-logging and display message box if UI is available and non disabled.

Parameters:
msg - message to display

error

public static void error(String msg,
                         Throwable cause)
Log message using commons-logging and display message box if UI is available and non disabled.

Parameters:
msg - message to display
cause - exception cause

fatal

public static void fatal(String msg)
Log message using commons-logging and display message box if UI is available and non disabled.

Parameters:
msg - message to display

fatal

public static void fatal(String msg,
                         Throwable cause)
Log message using commons-logging and display message box if UI is available and non disabled.

Parameters:
msg - message to display
cause - exception cause


Copyright © 2004-2010 CodeLutin. All Rights Reserved.