Skip to content

Commit

Permalink
Log stack and SDK versions once when client/server are initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinherron committed Jan 27, 2018
1 parent 545f807 commit a81fff3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Expand Up @@ -29,6 +29,7 @@
import org.eclipse.milo.opcua.stack.core.AttributeId;
import org.eclipse.milo.opcua.stack.core.Identifiers;
import org.eclipse.milo.opcua.stack.core.NamespaceTable;
import org.eclipse.milo.opcua.stack.core.Stack;
import org.eclipse.milo.opcua.stack.core.UaServiceFaultException;
import org.eclipse.milo.opcua.stack.core.serialization.UaRequestMessage;
import org.eclipse.milo.opcua.stack.core.serialization.UaResponseMessage;
Expand Down Expand Up @@ -113,6 +114,7 @@
import org.eclipse.milo.opcua.stack.core.types.structured.WriteResponse;
import org.eclipse.milo.opcua.stack.core.types.structured.WriteValue;
import org.eclipse.milo.opcua.stack.core.util.ExecutionQueue;
import org.eclipse.milo.opcua.stack.core.util.ManifestUtil;
import org.eclipse.milo.opcua.stack.core.util.Unit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -123,6 +125,15 @@

public class OpcUaClient implements UaClient {

public static final String SDK_VERSION =
ManifestUtil.read("X-SDK-Version").orElse("dev");

static {
Logger logger = LoggerFactory.getLogger(OpcUaClient.class);
logger.info("Eclipse Milo OPC UA Stack version: {}", Stack.VERSION);
logger.info("Eclipse Milo OPC UA Client SDK version: {}", SDK_VERSION);
}

private final Logger logger = LoggerFactory.getLogger(getClass());

private final List<ServiceFaultListener> faultListeners = newCopyOnWriteArrayList();
Expand Down
Expand Up @@ -71,6 +71,12 @@ public class OpcUaServer {
public static final String SDK_VERSION =
ManifestUtil.read("X-SDK-Version").orElse("dev");

static {
Logger logger = LoggerFactory.getLogger(OpcUaServer.class);
logger.info("Eclipse Milo OPC UA Stack version: {}", Stack.VERSION);
logger.info("Eclipse Milo OPC UA Server SDK version: {}", SDK_VERSION);
}

private final Logger logger = LoggerFactory.getLogger(getClass());

private final Map<ByteString, BrowseContinuationPoint> browseContinuationPoints = Maps.newConcurrentMap();
Expand Down Expand Up @@ -189,9 +195,6 @@ public OpcUaServer(OpcUaServerConfig config) {
}

eventBus = new AsyncEventBus("server", stackServer.getExecutorService());

logger.info("eclipse milo opc-ua stack version: {}", Stack.VERSION);
logger.info("eclipse milo opc-ua sdk version: {}", SDK_VERSION);
}

public CompletableFuture<OpcUaServer> startup() {
Expand Down

0 comments on commit a81fff3

Please sign in to comment.