-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-logger.sh
More file actions
executable file
·33 lines (31 loc) · 775 Bytes
/
test-logger.sh
File metadata and controls
executable file
·33 lines (31 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Test logger script that outputs to both stdout and stderr
echo "Starting test logger..."
sleep 1
echo "INFO: Test service started on port 3000"
sleep 1
echo "DEBUG: Database connection established"
sleep 1
echo "ERROR: Failed to load configuration file" >&2
sleep 1
echo "INFO: Listening on http://localhost:3000"
sleep 1
echo "WARN: Deprecated API endpoint used" >&2
sleep 1
echo "INFO: Request received: GET /api/users"
sleep 1
echo "DEBUG: Query executed in 45ms"
sleep 1
echo "INFO: Response sent: 200 OK"
sleep 1
# Loop forever
while true; do
sleep 2
echo "INFO: Heartbeat - $(date)"
sleep 2
echo "DEBUG: Memory usage: $(( RANDOM % 100 ))MB"
sleep 2
if [ $(( RANDOM % 5 )) -eq 0 ]; then
echo "ERROR: Random error occurred!" >&2
fi
done