Skip to content

Commit

Permalink
fix log format
Browse files Browse the repository at this point in the history
  • Loading branch information
vernesong committed Oct 7, 2024
1 parent 92909d7 commit 1d1f98b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions luci-app-openclash/luasrc/view/openclash/log.htm
Original file line number Diff line number Diff line change
Expand Up @@ -225,20 +225,20 @@
var cn = 0;
var sn = 0;
str.trim().split('\n').forEach(function(v, i) {
var regex = /(time=|msg=)"([^"]*)"/g;
var regex = /(time=)"([^"]*)"/g;
var res = regex.exec(v);
if (res) {
var dt = new Date(res[1]);
var dt = new Date(res[2]);
}
else {
var dtt = new Date(v.substring(0,19));
}
if (dt && dt != "Invalid Date"){
if (v.indexOf("level=") != -1) {
var log_info = v.substring(res[1].length + 7);
var log_info = v.substring(res[2].length + 7);
}
else {
var log_info = v.substring(res[1].length + 2);
var log_info = v.substring(res[2].length + 2);
}
cstrt[cn]=dt.getFullYear()+"-"+p(dt.getMonth()+1)+"-"+p(dt.getDate())+" "+p(dt.getHours())+":"+p(dt.getMinutes())+":"+p(dt.getSeconds())+log_info;
cn = cn + 1;
Expand Down

0 comments on commit 1d1f98b

Please sign in to comment.