// Copyright Acelet Corp. 2000. All rights reserved

package com.acelet.opensource.logging;

import com.acelet.logging.Logging;

/**
 * Copyright Acelet Corp. 2000. All rights reserved
 * <p>
 * License agreement begins >>>>>>>>>> <br>
 * <b>
 * This program (com.acelet.opensource.logging.Alog) ("Software") is an 
 * open source software. <p>
 * 
 * LICENSE GRANT. The Software is owned by Acelet Corporation ("Acelet"). 
 * The Software is licensed to you ("Licensee"). You are granted a 
 * non-exclusive right to use, modify, distribute the Software for either
 * commercial or non-commercial use for free, as long as: <br>
 * 1. this copyright paragraph remains with this file. <br>
 * 2. this source code (this file) must be included with distributed 
 * binary code.<br>
 * 
 * NO WARRANTY. This comes with absolutely no warranty. <p>
 * </b>
 * <<<<<<<<<< License agreement ends <p><p>
 * 
 * The purpose of releasing this open source program is to prevent vendor 
 * lock in. <p>
 * 
 * You can code your program using this class to indirectly use Acelet 
 * SuperLogging (com.acelet.logging). If later you want to swith to other
 * logging package, you do not need to modify your program. All you have
 * to do is: <p>
 * 1. modify this file to redirect to other logging packages. <br>
 * 2. replace existing com.acelet.opensource.Alog with your modified one. <br>
 * 3. you may have to reboot your EJB server to make the changes effect.<br>
 * <p>
 *
 * This program is just a wrapper. For detail information about the methods
 * see documents of underline package, such as com.acelet.logging.Logging.
 *
 * <p>
 * Visit http://www.ACElet.com for more information.
**/

public final class Alog {

  /**
   * Log level value: something will prevent normal program execution.
   */
  public static int SEVERE = 1000;

  /**
   * Log level value: something has potential problems.
   */
  public static int WARNING = 900;

  /**
   * Log level value: for significant messages.
   */
  public static int INFO = 800;

  /**
   * Log level value: for config information in debugging.
   */
  public static int CONFIG = 700;

  /**
   * Log level value: for information such as recoverable failures.
   */
  public static int FINE = 500;

  /**
   * Log level value: for information about entering or returning a 
   * method, or throwing an exception.
   */
  public static int FINER = 400;

  /**
   * Log level value: for detail tracing information.
   */
  public static int FINEST = 300;


  public Alog() {
  }

  public static void alert(String subject, String message) {
    Logging.alert(subject, message);
  }

  public static void error(String text, int level, String fullClassName, 
  String methodName, String baseFileName, int lineNumber) {
    Logging.error(text, level, fullClassName, methodName, baseFileName, 
      lineNumber);
  }

  public static void log(String text, int level, String fullClassName, 
  String methodName, String baseFileName, int lineNumber) {
    Logging.log(text, level, fullClassName, methodName, baseFileName, 
      lineNumber);
  }

  public static void sendMail(String to, String from, String subject, 
  String text) throws Exception {
    Logging.sendMail(to, from, subject, text);
  }

  public static void sendMail(String to, String cc, String bcc, String from, 
  String subject, String text) throws Exception {
    Logging.sendMail(to, cc, bcc, from, subject, text);
  }
}
