mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-26 19:34:25 +03:00
Allow setup of verbose logging from environment variable.
This commit is contained in:
parent
36f23e424e
commit
621721417d
21
riscos/gui.c
21
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);
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user