Fossil SCM

More improvements to the setup-logmenu page.

drh 2025-02-14 13:33 trunk
Commit 767509f6178b88506718aa582113833f99a40bbb800f50070592d11f18c59b18
1 file changed +36 -21
+36 -21
--- src/setup.c
+++ src/setup.c
@@ -201,33 +201,51 @@
201201
login_needed(0);
202202
return;
203203
}
204204
style_header("Log Menu");
205205
@ <table border="0" cellspacing="3">
206
- setup_menu_entry("Admin Log", "admin_log",
207
- "The admin log records configuration changes to the repository.\n"
208
- "The admin log is stored in the \"admin_log\" table of the repository.\n"
209
- );
210
- setup_menu_entry("Artifact Log", "rcvfromlist",
211
- "The artifact log records when new content is added to the repository.\n"
212
- "The time and date and origin of the new content is entered into the\n"
213
- "Log. The artifact log is always on and is stored in the \"rcvfrom\"\n"
214
- "table of the repository.\n"
215
- );
216
- setup_menu_entry("User Log", "user_log",
217
- "The user log is a record of login attempts. The user log is stored\n"
218
- "in the \"accesslog\" table of the respository.\n"
219
- );
206
+
207
+ if( db_get_boolean("admin-log",0)==0 ){
208
+ blob_appendf(&desc,
209
+ "The admin log records configuration changes to the repository.\n"
210
+ "<b>Disabled</b>: Turn on the "
211
+ " <a href='%R/setup_settings'>admin-log setting</a> to enable."
212
+ );
213
+ setup_menu_entry("Admin Log", 0, blob_str(&desc));
214
+ blob_reset(&desc);
215
+ }else{
216
+ setup_menu_entry("Admin Log", "admin_log",
217
+ "The admin log records configuration changes to the repository\n"
218
+ "in the \"admin_log\" table.\n"
219
+ );
220
+ }
221
+ setup_menu_entry("Artifact Log", "rcvfromlist",
222
+ "The artifact log records when new content is added in the\n"
223
+ "\"rcvfrom\" table.\n"
224
+ );
225
+ if( db_get_boolean("access-log",0) ){
226
+ setup_menu_entry("User Log", "user_log",
227
+ "Login attempts recorded in the \"accesslog\" table."
228
+ );
229
+ }else{
230
+ blob_appendf(&desc,
231
+ "Login attempts recorded in the \"accesslog\" table.\n"
232
+ "<b>Disabled</b>: Turn on the "
233
+ "<a href='%R/setup_settings'>access-log setting</a> to enable."
234
+ );
235
+ setup_menu_entry("User Log", 0, blob_str(&desc));
236
+ blob_reset(&desc);
237
+ }
220238
221239
blob_appendf(&desc,
222
- "The error log is a separate text file to which warning and error\n"
240
+ "A separate text file to which warning and error\n"
223241
"messages are appended. A single error log can and often is shared\n"
224242
"across multiple repositories.\n"
225243
);
226244
if( g.zErrlog==0 || fossil_strcmp(g.zErrlog,"-")==0 ){
227
- blob_appendf(&desc,"The error log is disabled. "
228
- "To activate the error log ");
245
+ blob_appendf(&desc,"<b>Disabled</b>: "
246
+ "To enable the error log ");
229247
if( fossil_strcmp(g.zCmdName, "cgi")==0 ){
230248
blob_appendf(&desc,
231249
"make an entry like \"errorlog: <i>FILENAME</i>\""
232250
" in the CGI script at %h",
233251
P("SCRIPT_FILENAME")
@@ -239,11 +257,11 @@
239257
g.argv[0], g.zCmdName
240258
);
241259
}
242260
bErrLog = 0;
243261
}else{
244
- blob_appendf(&desc,"In this repository, the error log is in the file"
262
+ blob_appendf(&desc,"In this repository, the error log is the file "
245263
"named \"%s\".", g.zErrlog);
246264
bErrLog = 1;
247265
}
248266
setup_menu_entry("Error Log", bErrLog ? "errorlog" : 0, blob_str(&desc));
249267
blob_reset(&desc);
@@ -256,16 +274,13 @@
256274
257275
setup_menu_entry("Panic Log", bErrLog ? "paniclog" : 0,
258276
"Only the most important messages in the Error Log:\n"
259277
"assertion faults, segmentation faults, and similar malfunctions.\n"
260278
);
261
-
262
-
263279
setup_menu_entry("Hack Log", bErrLog ? "hacklog" : 0,
264280
"All code-418 hack attempts in the Error Log"
265281
);
266
-
267282
setup_menu_entry("Non-Hack Log", bErrLog ? "hacklog?not" : 0,
268283
"All log messages that are not code-418 hack attempts"
269284
);
270285
271286
@ </table>
272287
--- src/setup.c
+++ src/setup.c
@@ -201,33 +201,51 @@
201 login_needed(0);
202 return;
203 }
204 style_header("Log Menu");
205 @ <table border="0" cellspacing="3">
206 setup_menu_entry("Admin Log", "admin_log",
207 "The admin log records configuration changes to the repository.\n"
208 "The admin log is stored in the \"admin_log\" table of the repository.\n"
209 );
210 setup_menu_entry("Artifact Log", "rcvfromlist",
211 "The artifact log records when new content is added to the repository.\n"
212 "The time and date and origin of the new content is entered into the\n"
213 "Log. The artifact log is always on and is stored in the \"rcvfrom\"\n"
214 "table of the repository.\n"
215 );
216 setup_menu_entry("User Log", "user_log",
217 "The user log is a record of login attempts. The user log is stored\n"
218 "in the \"accesslog\" table of the respository.\n"
219 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
221 blob_appendf(&desc,
222 "The error log is a separate text file to which warning and error\n"
223 "messages are appended. A single error log can and often is shared\n"
224 "across multiple repositories.\n"
225 );
226 if( g.zErrlog==0 || fossil_strcmp(g.zErrlog,"-")==0 ){
227 blob_appendf(&desc,"The error log is disabled. "
228 "To activate the error log ");
229 if( fossil_strcmp(g.zCmdName, "cgi")==0 ){
230 blob_appendf(&desc,
231 "make an entry like \"errorlog: <i>FILENAME</i>\""
232 " in the CGI script at %h",
233 P("SCRIPT_FILENAME")
@@ -239,11 +257,11 @@
239 g.argv[0], g.zCmdName
240 );
241 }
242 bErrLog = 0;
243 }else{
244 blob_appendf(&desc,"In this repository, the error log is in the file"
245 "named \"%s\".", g.zErrlog);
246 bErrLog = 1;
247 }
248 setup_menu_entry("Error Log", bErrLog ? "errorlog" : 0, blob_str(&desc));
249 blob_reset(&desc);
@@ -256,16 +274,13 @@
256
257 setup_menu_entry("Panic Log", bErrLog ? "paniclog" : 0,
258 "Only the most important messages in the Error Log:\n"
259 "assertion faults, segmentation faults, and similar malfunctions.\n"
260 );
261
262
263 setup_menu_entry("Hack Log", bErrLog ? "hacklog" : 0,
264 "All code-418 hack attempts in the Error Log"
265 );
266
267 setup_menu_entry("Non-Hack Log", bErrLog ? "hacklog?not" : 0,
268 "All log messages that are not code-418 hack attempts"
269 );
270
271 @ </table>
272
--- src/setup.c
+++ src/setup.c
@@ -201,33 +201,51 @@
201 login_needed(0);
202 return;
203 }
204 style_header("Log Menu");
205 @ <table border="0" cellspacing="3">
206
207 if( db_get_boolean("admin-log",0)==0 ){
208 blob_appendf(&desc,
209 "The admin log records configuration changes to the repository.\n"
210 "<b>Disabled</b>: Turn on the "
211 " <a href='%R/setup_settings'>admin-log setting</a> to enable."
212 );
213 setup_menu_entry("Admin Log", 0, blob_str(&desc));
214 blob_reset(&desc);
215 }else{
216 setup_menu_entry("Admin Log", "admin_log",
217 "The admin log records configuration changes to the repository\n"
218 "in the \"admin_log\" table.\n"
219 );
220 }
221 setup_menu_entry("Artifact Log", "rcvfromlist",
222 "The artifact log records when new content is added in the\n"
223 "\"rcvfrom\" table.\n"
224 );
225 if( db_get_boolean("access-log",0) ){
226 setup_menu_entry("User Log", "user_log",
227 "Login attempts recorded in the \"accesslog\" table."
228 );
229 }else{
230 blob_appendf(&desc,
231 "Login attempts recorded in the \"accesslog\" table.\n"
232 "<b>Disabled</b>: Turn on the "
233 "<a href='%R/setup_settings'>access-log setting</a> to enable."
234 );
235 setup_menu_entry("User Log", 0, blob_str(&desc));
236 blob_reset(&desc);
237 }
238
239 blob_appendf(&desc,
240 "A separate text file to which warning and error\n"
241 "messages are appended. A single error log can and often is shared\n"
242 "across multiple repositories.\n"
243 );
244 if( g.zErrlog==0 || fossil_strcmp(g.zErrlog,"-")==0 ){
245 blob_appendf(&desc,"<b>Disabled</b>: "
246 "To enable the error log ");
247 if( fossil_strcmp(g.zCmdName, "cgi")==0 ){
248 blob_appendf(&desc,
249 "make an entry like \"errorlog: <i>FILENAME</i>\""
250 " in the CGI script at %h",
251 P("SCRIPT_FILENAME")
@@ -239,11 +257,11 @@
257 g.argv[0], g.zCmdName
258 );
259 }
260 bErrLog = 0;
261 }else{
262 blob_appendf(&desc,"In this repository, the error log is the file "
263 "named \"%s\".", g.zErrlog);
264 bErrLog = 1;
265 }
266 setup_menu_entry("Error Log", bErrLog ? "errorlog" : 0, blob_str(&desc));
267 blob_reset(&desc);
@@ -256,16 +274,13 @@
274
275 setup_menu_entry("Panic Log", bErrLog ? "paniclog" : 0,
276 "Only the most important messages in the Error Log:\n"
277 "assertion faults, segmentation faults, and similar malfunctions.\n"
278 );
 
 
279 setup_menu_entry("Hack Log", bErrLog ? "hacklog" : 0,
280 "All code-418 hack attempts in the Error Log"
281 );
 
282 setup_menu_entry("Non-Hack Log", bErrLog ? "hacklog?not" : 0,
283 "All log messages that are not code-418 hack attempts"
284 );
285
286 @ </table>
287

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button