Skip to content

Commit

Permalink
move filelogger from wpiutil to datalog (java)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaDizzy committed Jan 26, 2025
1 parent 5ff89bf commit 80b1ce8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 23 deletions.
23 changes: 20 additions & 3 deletions libdatalog/src/main/java/edu/wpi/first/datalog/DataLogJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

package edu.wpi.first.datalog;

import edu.wpi.first.util.RuntimeLoader;
import edu.wpi.first.util.WPIUtilJNI;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.concurrent.atomic.AtomicBoolean;

import edu.wpi.first.util.RuntimeLoader;
import edu.wpi.first.util.WPIUtilJNI;

/**
* DataLog wpiutil JNI Functions.
*
Expand Down Expand Up @@ -354,6 +353,24 @@ private static native void appendRawBuffer(
*/
static native void appendStringArray(long impl, int entry, String[] value, long timestamp);

/**
* Create a native FileLogger. When the specified file is modified, appended data will be appended
* to the specified data log.
*
* @param file path to the file
* @param log data log implementation handle
* @param key log key to append data to
* @return The FileLogger handle.
*/
public static native long createFileLogger(String file, long log, String key);

/**
* Free a native FileLogger. This causes the FileLogger to stop appending data to the log.
*
* @param fileTail The FileLogger handle.
*/
public static native void freeFileLogger(long fileTail);

/** Utility class. */
private DataLogJNI() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

package edu.wpi.first.networktables;

import edu.wpi.first.util.WPIUtilJNI;
import edu.wpi.first.datalog.DataLog;
import edu.wpi.first.util.WPIUtilJNI;
import edu.wpi.first.util.concurrent.Event;
import edu.wpi.first.util.protobuf.Protobuf;
import edu.wpi.first.util.struct.Struct;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions wpiutil/src/main/java/edu/wpi/first/util/WPIUtilJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,24 +220,6 @@ public static native boolean waitForObjectTimeout(int handle, double timeout)
public static native int[] waitForObjectsTimeout(int[] handles, double timeout)
throws InterruptedException;

/**
* Create a native FileLogger. When the specified file is modified, appended data will be appended
* to the specified data log.
*
* @param file path to the file
* @param log data log implementation handle
* @param key log key to append data to
* @return The FileLogger handle.
*/
public static native long createFileLogger(String file, long log, String key);

/**
* Free a native FileLogger. This causes the FileLogger to stop appending data to the log.
*
* @param fileTail The FileLogger handle.
*/
public static native void freeFileLogger(long fileTail);

/** Utility class. */
protected WPIUtilJNI() {}
}

0 comments on commit 80b1ce8

Please sign in to comment.