Urbi SDK Remote for Java  2.7.5
Log.java
00001 /*
00002  * Copyright (C) 2010-2011, Gostai S.A.S.
00003  *
00004  * This software is provided "as is" without warranty of any kind,
00005  * either expressed or implied, including but not limited to the
00006  * implied warranties of fitness for a particular purpose.
00007  *
00008  * See the LICENSE file for more information.
00009  */
00010 
00011 package urbi;
00012 
00013 import java.lang.StackTraceElement;
00014 import java.lang.Exception;
00015 
00016 public class Log
00017 {
00018     private static String default_category = "UObjectJava";
00019 
00020     public static native void info(String category,
00021                                    String msg,
00022                                    String functionname,
00023                                    String filename,
00024                                    int linenumber);
00025 
00026     public static void info(String category, String msg)
00027     {
00028         StackTraceElement elt = new Exception().getStackTrace()[0];
00029         info(category, msg,
00030              elt.getClassName() + "." + elt.getMethodName(),
00031              elt.getFileName(),
00032              elt.getLineNumber());
00033     }
00034 
00035     public static void info(String msg)
00036     {
00037         info(default_category, msg);
00038     }
00039 
00040     public static native void error(String category,
00041                                     String msg,
00042                                     String functionname,
00043                                     String filename,
00044                                     int linenumber);
00045 
00046     public static void error(String category, String msg)
00047     {
00048         StackTraceElement elt = new Exception().getStackTrace()[0];
00049         error(category, msg,
00050               elt.getClassName() + "." + elt.getMethodName(),
00051               elt.getFileName(),
00052               elt.getLineNumber());
00053     }
00054 
00055     public static void error(String msg)
00056     {
00057         error(default_category, msg);
00058     }
00059 }