"WEBNMS_5 API Docs"

com.adventnet.management.log
Class LogUser

java.lang.Object
  extended by com.adventnet.management.log.LogUser
Direct Known Subclasses:
DefaultLogUser, LogErrUser

public class LogUser
extends java.lang.Object

This class provides methods for writing Logout messages.All the methods in this class calls the methods of the corresponding Writer class( LogBasewriter or LogFileWriter or LogStreamWriter).


Field Summary
 boolean m_is_enabled
           
 int m_level
          Returns the level of log.
 LogBaseWriter m_log_writer
           
 java.lang.String m_name
           
 
Constructor Summary
LogUser(java.lang.String name, int level, LogBaseWriter log_writer)
          Constructor to create a LogUser with the Name, LogLevel and LogWriter as arguments.
 
Method Summary
 void abort(java.lang.String fail_msg, java.lang.Throwable exception)
          Deprecated.  
 void assert1(boolean condition, java.lang.String fail_msg)
          Deprecated.  
 void fail(java.lang.String fail_msg, java.lang.Throwable exception)
          calls the log method of the LogUser class.
 void flush()
          Calls the flush method of the Corresponding Writer class.
 int getLevel()
          Returns the level of the log.
 boolean isEnabled()
          Returns the status of the log.
 boolean isSuppressModuleNameLogging()
          Returns true if suppressModuleName enabled.
 void log(java.lang.String message, int level)
          This method calls the log method of the corresponding Writer class.
 void logException(java.lang.Throwable exception, int level)
          This method calls the logException method of the corresponding Writer class.
 void logStackTrace(int level)
          This method calls the logStackTrace method of the corresponding Writer class.
 void setDisplayName(java.lang.String displaytag)
          The Display Name for this LogUser
 void setLevel(int level)
          Sets the level of the log message.
 void setStatus(boolean stat)
          Sets the status of the log.
 void setSuppressModuleNameLogging(boolean bFlag)
          Determines wheather to log ModuleName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_name

public java.lang.String m_name

m_level

public int m_level
Returns the level of log. By default, it returns Log.NONE.


m_is_enabled

public boolean m_is_enabled

m_log_writer

public LogBaseWriter m_log_writer
Constructor Detail

LogUser

public LogUser(java.lang.String name,
               int level,
               LogBaseWriter log_writer)
Constructor to create a LogUser with the Name, LogLevel and LogWriter as arguments.

Parameters:
name - The Name of the LogUser.
level - The LogLevel of the LogUser.
log_writer - The LogWriter for this LogUser.
Method Detail

setSuppressModuleNameLogging

public void setSuppressModuleNameLogging(boolean bFlag)
Determines wheather to log ModuleName.

Parameters:
bFlag - a boolean value, where true indicates to suppress ModuleName in the log file.

isSuppressModuleNameLogging

public boolean isSuppressModuleNameLogging()
Returns true if suppressModuleName enabled.

Returns:
true if suppressModuleName is enabled, else false

log

public void log(java.lang.String message,
                int level)
This method calls the log method of the corresponding Writer class. This method checks, status and level of the log before calling it.

Parameters:
message - Message to be printed
level - level of the log.

logException

public void logException(java.lang.Throwable exception,
                         int level)
This method calls the logException method of the corresponding Writer class. This method checks, status and level of the log before calling it.

Parameters:
exception - Exception message to be printed
level - level of the log.

logStackTrace

public void logStackTrace(int level)
This method calls the logStackTrace method of the corresponding Writer class. This method checks level of the log before calling it.

Parameters:
level - level of the log.

fail

public void fail(java.lang.String fail_msg,
                 java.lang.Throwable exception)
calls the log method of the LogUser class. LogUser's log() method is called for the String fail_msg argument. LogUser's logStackTrace() method is called for the Exception exception argument.

Parameters:
fail_msg - a String to be printed.
exception - an Exception that is raised.

flush

public void flush()
Calls the flush method of the Corresponding Writer class.


setLevel

public void setLevel(int level)
Sets the level of the log message.

Parameters:
level - an integer.
See Also:
getLevel()

setStatus

public void setStatus(boolean stat)
Sets the status of the log.

Parameters:
stat - a boolean to enable or disable the LogUser
See Also:
setLevel(int)

getLevel

public int getLevel()
Returns the level of the log.

Returns:
an integer that indicates the level of the log.

isEnabled

public boolean isEnabled()
Returns the status of the log.

Returns:
a boolean that indicates the status of the log.

abort

public void abort(java.lang.String fail_msg,
                  java.lang.Throwable exception)
Deprecated. 

Calls the fail method.

Parameters:
fail_msg - a string to be printed.
exception - an Exception that is raised.

assert1

public void assert1(boolean condition,
                    java.lang.String fail_msg)
Deprecated. 

Calls the fail method if argument condition is false.

otherwise, no error message will be printed.

Parameters:
condition - either true - it returns to calling to the method with out printing or false - it calls the fail method.
fail_msg - message to be printed.

setDisplayName

public void setDisplayName(java.lang.String displaytag)
The Display Name for this LogUser

Parameters:
displayTag - The String representing the Display Name for this LogUser

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.