Back to index

nordugrid-arc-nox  1.1.0~rc6
Logger.java
Go to the documentation of this file.
00001 /* ----------------------------------------------------------------------------
00002  * This file was automatically generated by SWIG (http://www.swig.org).
00003  * Version 1.3.36
00004  *
00005  * Do not make changes to this file unless you know what you are doing--modify
00006  * the SWIG interface file instead.
00007  * ----------------------------------------------------------------------------- */
00008 
00009 package nordugrid.arc;
00010 
00011 public class Logger {
00012   private long swigCPtr;
00013   protected boolean swigCMemOwn;
00014 
00015   protected Logger(long cPtr, boolean cMemoryOwn) {
00016     swigCMemOwn = cMemoryOwn;
00017     swigCPtr = cPtr;
00018   }
00019 
00020   protected static long getCPtr(Logger obj) {
00021     return (obj == null) ? 0 : obj.swigCPtr;
00022   }
00023 
00024   protected void finalize() {
00025     delete();
00026   }
00027 
00028   public synchronized void delete() {
00029     if(swigCPtr != 0 && swigCMemOwn) {
00030       swigCMemOwn = false;
00031       arcJNI.delete_Logger(swigCPtr);
00032     }
00033     swigCPtr = 0;
00034   }
00035 
00036   public static Logger getRootLogger() {
00037     return new Logger(arcJNI.Logger_getRootLogger(), false);
00038   }
00039 
00040   public Logger(Logger parent, String subdomain) {
00041     this(arcJNI.new_Logger__SWIG_0(Logger.getCPtr(parent), parent, subdomain), true);
00042   }
00043 
00044   public Logger(Logger parent, String subdomain, LogLevel threshold) {
00045     this(arcJNI.new_Logger__SWIG_1(Logger.getCPtr(parent), parent, subdomain, threshold.swigValue()), true);
00046   }
00047 
00048   public void addDestination(LogDestination destination) {
00049     arcJNI.Logger_addDestination(swigCPtr, this, LogDestination.getCPtr(destination), destination);
00050   }
00051 
00052   public void removeDestinations() {
00053     arcJNI.Logger_removeDestinations(swigCPtr, this);
00054   }
00055 
00056   public void setThreshold(LogLevel threshold) {
00057     arcJNI.Logger_setThreshold(swigCPtr, this, threshold.swigValue());
00058   }
00059 
00060   public LogLevel getThreshold() {
00061     return LogLevel.swigToEnum(arcJNI.Logger_getThreshold(swigCPtr, this));
00062   }
00063 
00064   public void msg(LogMessage message) {
00065     arcJNI.Logger_msg__SWIG_0(swigCPtr, this, LogMessage.getCPtr(message), message);
00066   }
00067 
00068   public void msg(LogLevel level, String str) {
00069     arcJNI.Logger_msg__SWIG_1(swigCPtr, this, level.swigValue(), str);
00070   }
00071 
00072 }