当前位置:网站首页>Shell logs and printouts
Shell logs and printouts
2022-06-23 00:37:00 【ghostwritten】
Shell Log and printout
good shell The script records the log contents from , Start by normalizing the log format .
1
write_log()
{
LOG_FILE=$LOGDIR/cckiller_$(date +%Y-%m-%d).log
logout=""
for((i=2;i<=$#;i++)); do
j=${
!i}
logout="${logout} $j "
done
if [[ $LOG_LEVEL == "INFO" ]] && [[ "$1" == "INFO" ]];then
echo "[`date "+%Y-%m-%d %H:%M:%S"`][$1]: ${logout}" | tee -ai $LOG_FILE
elif [[ $LOG_LEVEL == "DEBUG" ]];then
echo "[`date "+%Y-%m-%d %H:%M:%S"`][$1]: ${logout}" | tee -ai $LOG_FILE
else
echo "[`date "+%Y-%m-%d %H:%M:%S"`][$1]: ${logout}"
fi
}
边栏推荐
- How to set the power-off auto start of easycvr hardware box
- Express, route, request object, response object, middleware, EJS template
- Which platform is safer to buy stocks on?
- 事务系统的隔离级别
- 声网多人视频录制与合成支持掉线再录制 | 掘金技术征文
- Flowable global listener monitors the start and end of a process
- 2022天梯赛-全国总决赛复盘赛
- ROS2暑期学校 ROS2 Summer School 2022-转-
- 在一条DML语句中插入/更新/删除/获取几百万行数据,你会特别注意什么?
- Daily question brushing record (I)
猜你喜欢

C sqlsugar, hisql, FreeSQL ORM framework all-round performance test vs. sqlserver performance test

权限想要细化到按钮,怎么做?

最安全的现货白银的心理分析

KunlunDB备份和恢复
![[go] go mod mode, package 12import/add is not in goroot](/img/b5/4cf5d3f04d0e5cc6f5a957959022ec.png)
[go] go mod mode, package 12import/add is not in goroot

SAP UI5 应用开发教程之一百零三 - 如何在 SAP UI5 应用中消费第三方库

Kunlundb query optimization (III) sort push down

一文读懂基于Redis的Amazon MemoryDB数据库

Oracle ASM uses the CP command in asmcmd to perform remote replication

OpenCvSharp (C# OpenCV) 微信QRCode解码功能使用介绍(附源码)
随机推荐
二叉树转字符串及字符串转二叉树
Some thoughts about the technology of test / development programmers are very advanced, and they can't go on
Is it reliable to get new debts? Is it safe?
SwiftUI Swift 教程之 14 个有用的数组运算符
【GO】Go Modules入門
MD5加密+盐值工具类
在一条DML语句中插入/更新/删除/获取几百万行数据,你会特别注意什么?
SAP MM 事务代码VL04为STO创建外向交货单
Brief introduction: how much do you know about fishing attacks
【首发】请求一下子太多了,数据库危
07 项目成本管理
事物系统的几种异常场景
C sqlsugar, hisql, FreeSQL ORM framework all-round performance test vs. sqlserver performance test
手机上券商开户哪个券商平台更好更安全,如果需要佣金低的怎么办
New paradigm of semantic segmentation! Structtoken: Rethinking the per pixel classification paradigm
OLAP - Druid introduction
Dig three feet to solve the data consistency problem between redis and MySQL
KunlunDB备份和恢复
详解openGauss多线程架构启动过程
LeetCode刷题——715. Range 模块