mirror of
https://github.com/10h30/kazewp.git
synced 2026-05-12 23:31:27 +09:00
Add logging function with improved output formatting
- Introduced a log() function to capture console output to a file - Added date separator and blank lines for better readability - Stripped ANSI color codes to avoid strange characters in the log
This commit is contained in:
+13
-4
@@ -1,4 +1,13 @@
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
if [ -t 1 ]; then
|
||||
# Terminal supports colors
|
||||
NC='\033[0m' # No Color
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
else
|
||||
# Disable colors for non-terminal outputs (like logs)
|
||||
NC=''
|
||||
RED=''
|
||||
GREEN=''
|
||||
BLUE=''
|
||||
fi
|
||||
Reference in New Issue
Block a user