changeset 63:3d9903900a71

logging
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 19 Aug 2025 09:29:54 +0900
parents bd3f16f7b8b7
children 7fc224013c8b
files src/error_log.js.luan src/private/tools/error.html
diffstat 2 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/error_log.js.luan	Tue Aug 19 07:40:27 2025 +0900
+++ b/src/error_log.js.luan	Tue Aug 19 09:29:54 2025 +0900
@@ -11,8 +11,14 @@
 local logger = Logging.logger "error_log.js"
 
 
+local bad_agents = {
+	[[Firefox/]]
+}
+local bad_agents_ptn = regex(concat(bad_agents,"|"))
 
 local function priority(err)
+	local agent = Http.request.headers["user-agent"]
+	if agent~=nil and bad_agents_ptn.matches(agent) then return "info" end
 	return "error"
 end
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/private/tools/error.html	Tue Aug 19 09:29:54 2025 +0900
@@ -0,0 +1,16 @@
+<!doctype html>
+<html lang="en">
+	<head>
+		<meta name="viewport" content="width=device-width, initial-scale=1">
+		<script src=/site.js></script>
+		<script>
+			function err() {
+				qqq();
+				//ajax('/qqq');
+			}
+		</script>
+	</head>
+	<body>
+		<button onclick="err()">error</button>
+	</body>
+</html>