Skip to content

Commit

Permalink
demo app fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVe committed Jan 14, 2025
1 parent b85c476 commit 7ef693c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 40 deletions.
4 changes: 2 additions & 2 deletions DesktopDemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ plugins {
dependencies {
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'

implementation 'ch.qos.logback:logback-classic:1.5.12'
implementation 'ch.qos.logback:logback-classic:1.5.16'

implementation project(':desktop')
}

application {
mainClassName = "com.yubico.yubikit.desktop.app.DesktopApp"
mainClass = "com.yubico.yubikit.desktop.app.DesktopApp"
applicationName = 'DesktopApp'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ public static void main(String[] argv) {
"/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC");
}

System.out.println("Insert YubiKey now...");
logger.info("Insert YubiKey now...");

YubiKitManager manager = new YubiKitManager();
Map<YubiKeyDevice, DeviceInfo> devices = manager.listAllDevices();
logger.debug("Devices: {}", devices);
logger.info("Devices: {}", devices);
for (Map.Entry<YubiKeyDevice, DeviceInfo> entry : devices.entrySet()) {
YubiKeyDevice device = entry.getKey();
DeviceInfo info = entry.getValue();
logger.debug("Found key: {} {}", device, info);
logger.info("Found key: {} {}", device, info);
if (device.supportsConnection(SmartCardConnection.class)) {
logger.debug("Request CCID connection");
device.requestConnection(
SmartCardConnection.class,
value -> {
try {
logger.debug("Got CCID connection {}", value.getValue());
} catch (IOException e) {
logger.info("Got CCID connection {}", value.getValue());
} catch (Exception e) {
logger.error("Failed to get CCID: ", e);
}
});
Expand Down Expand Up @@ -85,9 +85,9 @@ public static void main(String[] argv) {
}
}

logger.debug("Sleeping...");
logger.info("Sleeping...");
try {
Thread.sleep(5000);
Thread.sleep(500);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
Expand Down
31 changes: 0 additions & 31 deletions DesktopDemo/src/main/logback.xml

This file was deleted.

13 changes: 13 additions & 0 deletions DesktopDemo/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%-20thread][%-5level] %msg%n</pattern>
</encoder>
</appender>

<!-- Write DEBUG (and higher-level) messages to console -->
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
</configuration>

0 comments on commit 7ef693c

Please sign in to comment.