Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions netcdf4/src/main/java/ucar/nc2/ffi/netcdf/NetcdfClibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
/** Static methods to load the netcdf C library. */
public class NetcdfClibrary {
private static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(NetcdfClibrary.class);
private static org.slf4j.Logger startupLog = org.slf4j.LoggerFactory.getLogger("serverStartup");

private static final String JNA_PATH = "jna.library.path";
private static final String JNA_PATH_ENV = "JNA_PATH"; // environment var
Expand Down Expand Up @@ -107,7 +106,7 @@ public static synchronized int setLogLevel(int level) {
if (nc4 != null) {
try {
oldlevel = nc4.nc_set_log_level(log_level);
startupLog.info(String.format("NetcdfLoader: set log level: old=%d new=%d", oldlevel, log_level));
log.info(String.format("NetcdfLoader: set log level: old=%d new=%d", oldlevel, log_level));
} catch (UnsatisfiedLinkError e) {
// ignore
}
Expand All @@ -127,13 +126,14 @@ private static Nc4prototypes load() {
// Make the library synchronized
// nc4 = (Nc4prototypes) Native.synchronizedLibrary(nc4);
nc4 = new Nc4wrapper(nc4);
startupLog.info("Nc4Iosp: NetCDF-4 C library loaded (jna_path='{}', libname='{}' version='{}').", jnaPath,
libName, getVersion());
startupLog.debug("Netcdf nc_inq_libvers='{}' isProtected={}", nc4.nc_inq_libvers(), Native.isProtected());
log.info("Nc4Iosp: NetCDF-4 C library loaded (jna_path='{}', libname='{}' version='{}').", jnaPath, libName,
getVersion());
log.debug("Netcdf nc_inq_libvers='{}' isProtected={}", nc4.nc_inq_libvers(), Native.isProtected());
} catch (Throwable t) {
String message =
String.format("Nc4Iosp: NetCDF-4 C library not present (jna_path='%s', libname='%s').", jnaPath, libName);
startupLog.warn(message, t);
log.warn(message);
log.debug("details: ", t);
}
String slevel = Strings.emptyToNull(System.getProperty(JNA_LOG_LEVEL));
if (slevel != null) {
Expand All @@ -144,13 +144,11 @@ private static Nc4prototypes load() {
}
}
try {
int oldlevel = setLogLevel(log_level);
startupLog.info(String.format("Nc4Iosp: set log level: old=%d new=%d", oldlevel, log_level));
setLogLevel(log_level);
} catch (Throwable t) {
String message = String.format("Nc4Iosp: could not set log level (level=%d jna_path='%s', libname='%s').",
log_level, jnaPath, libName);
startupLog.warn("Nc4Iosp: " + t.getMessage());
startupLog.warn(message);
log.debug("Nc4Iosp: " + t.getMessage());
}
}
return nc4;
Expand Down
1 change: 0 additions & 1 deletion netcdf4/src/main/java/ucar/nc2/jni/netcdf/Nc4Iosp.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
@Deprecated
public class Nc4Iosp extends AbstractIOServiceProvider implements IOServiceProviderWriter {
private static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Nc4Iosp.class);
private static org.slf4j.Logger startupLog = org.slf4j.LoggerFactory.getLogger("serverStartup");

public static final boolean DEBUG = false;

Expand Down