comparison logging/src/luan/modules/logging/LuanLogger.java @ 221:ec016471c6eb

make LuanTable an interface git-svn-id: https://luan-java.googlecode.com/svn/trunk@222 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Thu, 17 Jul 2014 07:49:26 +0000
parents 8e4ef9134362
children
comparison
equal deleted inserted replaced
220:61afe2a1ce96 221:ec016471c6eb
1 package luan.modules.logging; 1 package luan.modules.logging;
2 2
3 import org.apache.log4j.Logger; 3 import org.apache.log4j.Logger;
4 import luan.Luan;
4 import luan.LuanState; 5 import luan.LuanState;
5 import luan.LuanException; 6 import luan.LuanException;
6 import luan.LuanTable; 7 import luan.LuanTable;
7 import luan.LuanJavaFunction; 8 import luan.LuanJavaFunction;
8 9
29 public void debug(LuanState luan,Object obj) throws LuanException { 30 public void debug(LuanState luan,Object obj) throws LuanException {
30 logger.debug( luan.toString(obj) ); 31 logger.debug( luan.toString(obj) );
31 } 32 }
32 33
33 public LuanTable table() { 34 public LuanTable table() {
34 LuanTable tbl = new LuanTable(); 35 LuanTable tbl = Luan.newTable();
35 try { 36 try {
36 tbl.put( "error", new LuanJavaFunction( 37 tbl.put( "error", new LuanJavaFunction(
37 LuanLogger.class.getMethod( "error", LuanState.class, Object.class ), this 38 LuanLogger.class.getMethod( "error", LuanState.class, Object.class ), this
38 ) ); 39 ) );
39 tbl.put( "warn", new LuanJavaFunction( 40 tbl.put( "warn", new LuanJavaFunction(