Logging fixes

This commit is contained in:
crschnick 2024-10-17 08:21:57 +00:00
parent 0c85ba0425
commit c084a55d15
2 changed files with 10 additions and 7 deletions

View file

@ -7,6 +7,7 @@ import io.xpipe.app.fxcomps.Comp;
import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.app.util.DesktopHelper;
import io.xpipe.app.util.LicenseProvider;
import io.xpipe.app.util.LicensedFeature;
import io.xpipe.app.util.OptionsBuilder;
import java.io.IOException;
@ -22,9 +23,8 @@ public class LoggingCategory extends AppPrefsCategory {
@Override
protected Comp<?> create() {
var prefs = AppPrefs.get();
var supported = LicenseProvider.get()
.getFeature("logging")
.isSupported();
var feature = LicenseProvider.get().getFeature("logging");
var supported = feature.isSupported() || feature.isPreviewSupported();
var title = AppI18n.observable("sessionLogging")
.map(s -> s + (supported
? ""

View file

@ -96,10 +96,13 @@ public class TerminalLauncher {
var launcherScript = d.terminalLauncherScript(request, adjustedTitle);
var preparationScript = ScriptHelper.createLocalExecScript(launcherScript);
var supported = LicenseProvider.get()
.getFeature("logging")
var feature = LicenseProvider.get().getFeature("logging");
var supported = feature
.isSupported();
if (!AppPrefs.get().enableTerminalLogging().get() || !supported) {
if (!supported) {
throw new LicenseRequiredException(feature);
}
if (!AppPrefs.get().enableTerminalLogging().get()) {
var config = new ExternalTerminalType.LaunchConfiguration(
entry != null ? color : null, adjustedTitle, cleanTitle, preparationScript, d);
return config;