protected ConsoleDetector createConsoleDetector(OperatingSystem operatingSystem) {
if (useNativePlatform) {
try {
Terminals terminals = net.rubygrapefruit.platform.Native.get(Terminals.class);
return new NativePlatformConsoleDetector(terminals);
} catch (NativeIntegrationUnavailableException ex) {
LOGGER.debug("Native-platform terminal integration is not available. Continuing with fallback.");
} catch (NativeException ex) {
LOGGER.debug("Unable to load from native-platform backed ConsoleDetector. Continuing with fallback. Failure: {}", format(ex));
}