Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
I
install.api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Script
install.api
Commits
c5bec666
Commit
c5bec666
authored
Mar 21, 2020
by
金凯强
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取日志修改
parent
fcd3f026
Pipeline
#21258
passed with stage
in 22 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
info_service.py
app/info/info_service.py
+9
-3
No files found.
app/info/info_service.py
View file @
c5bec666
# -*- coding:utf-8 -*-
# -*- coding:utf-8 -*-
import
datetime
import
datetime
import
os
import
os
import
re
import
shutil
import
shutil
import
time
import
time
...
@@ -214,11 +215,16 @@ where A.log_id={log_id}'''
...
@@ -214,11 +215,16 @@ where A.log_id={log_id}'''
since_time
=
args
.
get
(
'since_time'
,
None
)
since_time
=
args
.
get
(
'since_time'
,
None
)
if
isinstance
(
since_time
,
str
):
if
isinstance
(
since_time
,
str
):
since_time
=
datetime
.
datetime
.
strptime
(
since_time
,
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
since_time
=
int
(
datetime
.
datetime
.
timestamp
(
datetime
.
datetime
.
strptime
(
since_time
,
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)))
tail
=
'all'
else
:
else
:
since_time
=
None
since_time
=
None
tail
=
'200'
logs
=
docker_client
.
logs
(
'install_api'
,
tail
=
200
,
since
=
since_time
)
logs
=
docker_client
.
logs
(
'install_api'
,
tail
=
tail
,
since
=
since_time
)
if
isinstance
(
logs
,
bytes
):
if
isinstance
(
logs
,
bytes
):
logs
=
logs
.
decode
()
logs
=
logs
.
decode
()
return
logs
# 去除所有含有debug信息的日志
filtered_logs
=
re
.
sub
(
'(
\
[20.*-.*DEBUG.*
\\
n)'
,
''
,
logs
)
return
filtered_logs
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment