comparison src/luan/modules/ThreadLuan.java @ 1454:219f2b937f2b

remove log4j
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 08 Mar 2020 14:11:30 -0600
parents 42c07ecb0ddc
children 78d937870762
comparison
equal deleted inserted replaced
1453:928be2a4d565 1454:219f2b937f2b
22 import luan.LuanFunction; 22 import luan.LuanFunction;
23 import luan.LuanTable; 23 import luan.LuanTable;
24 import luan.LuanException; 24 import luan.LuanException;
25 import luan.LuanCloner; 25 import luan.LuanCloner;
26 import luan.LuanCloneable; 26 import luan.LuanCloneable;
27 import luan.modules.logging.LuanLogger;
27 import goodjava.logging.Logger; 28 import goodjava.logging.Logger;
28 import goodjava.logging.LoggerFactory; 29 import goodjava.logging.LoggerFactory;
29 30
30 31
31 public final class ThreadLuan { 32 public final class ThreadLuan {
35 public static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); 36 public static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
36 37
37 private static Runnable runnable(final LuanFunction fn) { 38 private static Runnable runnable(final LuanFunction fn) {
38 return new Runnable() { 39 return new Runnable() {
39 public synchronized void run() { 40 public synchronized void run() {
41 LuanLogger.startThreadLogging(fn.luan());
40 try { 42 try {
41 fn.call(); 43 fn.call();
42 } catch(LuanException e) { 44 } catch(LuanException e) {
43 e.printStackTrace(); 45 e.printStackTrace();
46 } finally {
47 LuanLogger.endThreadLogging();
44 } 48 }
45 } 49 }
46 }; 50 };
47 } 51 }
48 52