summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--riscos/gui.c21
-rw-r--r--riscos/scripts/Run5
2 files changed, 25 insertions, 1 deletions
diff --git a/riscos/gui.c b/riscos/gui.c
index 93fc3db65..3850c5b97 100644
--- a/riscos/gui.c
+++ b/riscos/gui.c
@@ -788,9 +788,30 @@ int main(int argc, char** argv)
{
char path[40];
int length;
+ char logging_env[2];
+ os_var_type type;
+ int used = -1; /* slightly better with older OSLib versions */
+ os_error *error;
setbuf(stderr, NULL);
+ /* Consult NetSurf$Logging environment variable to decide if logging
+ * is required. */
+ error = xos_read_var_val_size("NetSurf$Logging", 0, os_VARTYPE_STRING,
+ &used, NULL, &type);
+ if (error != NULL || type != os_VARTYPE_STRING || used != -2) {
+ verbose_log = 1;
+ } else {
+ error = xos_read_var_val("NetSurf$Logging", logging_env,
+ sizeof(logging_env), 0, os_VARTYPE_STRING,
+ &used, NULL, &type);
+ if (error != NULL || logging_env[0] != '0') {
+ verbose_log = 1;
+ } else {
+ verbose_log = 0;
+ }
+ }
+
/* Pass a NULL pointer for Messages path, because until the Choices
* are loaded in netsurf_init, we don't know the Messages path. */
netsurf_init(&argc, &argv, "NetSurf:Choices", NULL);
diff --git a/riscos/scripts/Run b/riscos/scripts/Run
index 8805d11cc..5f59b7ffa 100644
--- a/riscos/scripts/Run
+++ b/riscos/scripts/Run
@@ -9,6 +9,9 @@ Set NetSurf$ForceVars 1
/<Obey$Dir>.!Boot
UnSet NetSurf$ForceVars
+| Configure logging. Set 1 to enable, or 0 to suppress.
+Set NetSurf$Logging 1
+
| Detect if NetSurf is already running and, if so, force the
| current instance to open a new window. Then stop this script.
Set Alias$NetSurfRunning UnSet Alias$NetSurfRunning|mUnSet NetSurf$Running|mObey
@@ -110,7 +113,7 @@ CDir <Wimp$ScrapDir>.WWW.NetSurf
FontInstall NetSurf:Resources.Fonts.
WIMPSLOT
-Run <NetSurf$Dir>.!RunImage -v %*0 2><Wimp$ScrapDir>.WWW.NetSurf.Log
+Run <NetSurf$Dir>.!RunImage %*0 2><Wimp$ScrapDir>.WWW.NetSurf.Log
| Uninstall NetSurf-specific fonts
FontRemove NetSurf:Resources.Fonts.