mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-23 16:10:24 +00:00
Logging fixes
This commit is contained in:
parent
0c85ba0425
commit
c084a55d15
2 changed files with 10 additions and 7 deletions
|
@ -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
|
||||
? ""
|
||||
|
|
|
@ -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;
|
||||
|
@ -136,7 +139,7 @@ public class TerminalLauncher {
|
|||
var suffix = sc.getOsType() == OsType.MACOS ? "This command is available in the util-linux package which can be installed via homebrew." : "This command is available in the util-linux package.";
|
||||
throw ErrorEvent.expected(new IllegalStateException("Logging requires the script command to be installed. " + suffix));
|
||||
}
|
||||
|
||||
|
||||
var content = sc.getOsType() == OsType.MACOS || sc.getOsType() == OsType.BSD ?
|
||||
"""
|
||||
echo "Transcript started, output file is sessions/%s"
|
||||
|
|
Loading…
Reference in a new issue