1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class Logger extends CommonBase {
10 final bindings.LDKLogger bindings_instance;
11 Logger(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
12 private Logger(bindings.LDKLogger arg) {
13 super(bindings.LDKLogger_new(arg));
14 this.ptrs_to.add(arg);
15 this.bindings_instance = arg;
17 @Override @SuppressWarnings("deprecation")
18 protected void finalize() throws Throwable {
19 if (ptr != 0) { bindings.Logger_free(ptr); } super.finalize();
22 public static interface LoggerInterface {
23 void log(String record);
25 private static class LDKLoggerHolder { Logger held; }
26 public static Logger new_impl(LoggerInterface arg) {
27 final LDKLoggerHolder impl_holder = new LDKLoggerHolder();
28 impl_holder.held = new Logger(new bindings.LDKLogger() {
29 @Override public void log(String record) {
33 return impl_holder.held;