Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright Telenor Objects AS
  
COOS - Connected Objects Operating System (www.connectedobjects.org). Copyright (C) 2009 Telenor ASA and Tellu AS. All rights reserved. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. You may also contact one of the following for additional information: Telenor ASA, Snaroyveien 30, N-1331 Fornebu, Norway (www.telenor.no) Tellu AS, Hagalokkveien 13, N-1383 Asker, Norway (www.tellu.no)
 
 package org.coos.messaging.util;
 
 import java.util.Date;


This class is a logger class used in environments where j2se is not available

Author(s):
Knut Eilif Husa, Tellu AS
 
 public class DefaultLogger implements Log {
 
     public static final int TRACE = 1;
     public static final int DEBUG = 2;
     public static final int INFO = 3;
     public static final int WARN = 4;
     public static final int ERROR = 5;
     public static final int FATAL = 6;
     private static int level = 1;
 
     private String name = "";
 
     public DefaultLogger(String loggerName) {
         this. = loggerName;
     }
 
     public static int getLevel() {
         return ;
     }
 
     public static void setLevel(int level) {
         . = level;
     }
 
     public void setLoggerName(String loggerName) {
          = loggerName;
     }
 
     public void trace(String arg) {
 
         if ( <= ) {
             StringBuffer buf = new StringBuffer();
             buf.append(new Date());
             buf.append(":[TRACE]:");
             buf.append(arg);
             ..println(buf.toString());
         }
 
     }
 
     public void debug(String arg) {
 
         if ( <= ) {
             StringBuffer buf = new StringBuffer();
             buf.append(new Date());
             buf.append(":[DEBUG]:");
             buf.append(arg);
             ..println(buf.toString());
         }
     }
 
     public void info(String arg) {
 
         if ( <= ) {
             StringBuffer buf = new StringBuffer();
             buf.append(new Date());
             buf.append(":[INFO]:");
             buf.append(arg);
             ..println(buf.toString());
         }
 
     }
    public void warn(String arg) {
        if ( <= ) {
            StringBuffer buf = new StringBuffer();
            buf.append(new Date());
            buf.append(":[WARNING]:");
            buf.append(arg);
            ..println(buf.toString());
        }
    }
    public void warn(String argException e) {
        if ( <= ) {
            warn(arg);
            e.printStackTrace();
        }
    }
    public void error(String arg) {
        if ( <= ) {
            StringBuffer buf = new StringBuffer();
            buf.append(new Date());
            buf.append(":[ERROR]:");
            buf.append(arg);
            ..println(buf.toString());
        }
    }
    public void error(String argException e) {
        if ( <= ) {
            error(arg);
            e.printStackTrace();
        }
    }
    public void putMDC(String keyString value) {
        // No support for MDC
    }
    public void removeMDC(String key) {
        // No support for MDC
    }
    public boolean isInheritMDC() {
        // No support for MDC
        return false;
    }
    public void setInheritMDC(boolean inheritMDC) {
        // No support for MDC
    }
    public void debug(String msgException e) {
        if ( <= ) {
            debug(msg);
            e.printStackTrace();
        }
    }
    public void info(String msgException e) {
        if ( <= ) {
            info(msg);
            e.printStackTrace();
        }
    }
New to GrepCode? Check out our FAQ X