Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
日
日志记录sdk
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pengguangpu
日志记录sdk
Commits
58a29965
Commit
58a29965
authored
Jun 01, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复,修改删除日志中的后缀判断;
版本号自增;
parent
7702eda0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
MainActivity.java
app/src/main/java/com/miya/miyaloggerdemo/MainActivity.java
+1
-1
build.gradle
miyalogger/build.gradle
+2
-2
MiyaLogger.java
miyalogger/src/main/java/com/miya/miyalogger/MiyaLogger.java
+6
-6
No files found.
app/src/main/java/com/miya/miyaloggerdemo/MainActivity.java
View file @
58a29965
...
...
@@ -47,7 +47,7 @@ public class MainActivity extends AppCompatActivity {
public
void
onClick
(
View
v
)
{
String
daysStr
=
((
EditText
)
findViewById
(
R
.
id
.
etDays
)).
getText
().
toString
();
int
days
=
0
;
if
(
TextUtils
.
isEmpty
(
daysStr
))
{
if
(
!
TextUtils
.
isEmpty
(
daysStr
))
{
days
=
Integer
.
parseInt
(
daysStr
);
}
MiyaLogger
.
deleteLog
(
days
);
...
...
miyalogger/build.gradle
View file @
58a29965
...
...
@@ -6,9 +6,9 @@ def getSDKName() {
}
//发布版本
def
publishVersion
=
"1.0.
0
"
def
publishVersion
=
"1.0.
2
"
//发布版本号
def
publishVersionCode
=
1
def
publishVersionCode
=
3
android
{
compileSdkVersion
28
...
...
miyalogger/src/main/java/com/miya/miyalogger/MiyaLogger.java
View file @
58a29965
...
...
@@ -189,7 +189,7 @@ public class MiyaLogger {
if
(
fileBean
.
fileName
.
endsWith
(
logSuffix
))
{
if
(
fileBean
.
fileName
.
contains
(
logLink
))
{
try
{
String
fileNameWithOutSuffix
=
fileBean
.
fileName
.
substring
(
0
,
fileBean
.
fileName
.
i
ndexOf
(
"."
));
String
fileNameWithOutSuffix
=
fileBean
.
fileName
.
substring
(
0
,
fileBean
.
fileName
.
lastI
ndexOf
(
"."
));
String
fileNameDate
=
fileNameWithOutSuffix
.
substring
(
fileNameWithOutSuffix
.
lastIndexOf
(
logLink
)
+
1
);
long
fileNameLongTimes
=
stringToLong
(
fileNameDate
,
DF_YYYYMMDD
);
if
((
currentLongTimes
-
fileNameLongTimes
)
>=
days
*
24L
*
60L
*
60L
*
1000L
)
{
//符合要求,加入删除列表
...
...
@@ -302,7 +302,7 @@ public class MiyaLogger {
if
(
msg
.
length
()
<=
index
+
maxLength
)
{
sub
=
msg
.
substring
(
index
);
}
else
{
sub
=
msg
.
substring
(
index
,
maxLength
);
sub
=
msg
.
substring
(
index
,
index
+
maxLength
);
}
index
+=
maxLength
;
Log
.
i
(
tag
,
sub
.
trim
());
...
...
@@ -322,7 +322,7 @@ public class MiyaLogger {
if
(
msg
.
length
()
<=
index
+
maxLength
)
{
sub
=
msg
.
substring
(
index
);
}
else
{
sub
=
msg
.
substring
(
index
,
maxLength
);
sub
=
msg
.
substring
(
index
,
index
+
maxLength
);
}
index
+=
maxLength
;
Log
.
v
(
tag
,
sub
.
trim
());
...
...
@@ -342,7 +342,7 @@ public class MiyaLogger {
if
(
msg
.
length
()
<=
index
+
maxLength
)
{
sub
=
msg
.
substring
(
index
);
}
else
{
sub
=
msg
.
substring
(
index
,
maxLength
);
sub
=
msg
.
substring
(
index
,
index
+
maxLength
);
}
index
+=
maxLength
;
Log
.
d
(
tag
,
sub
.
trim
());
...
...
@@ -362,7 +362,7 @@ public class MiyaLogger {
if
(
msg
.
length
()
<=
index
+
maxLength
)
{
sub
=
msg
.
substring
(
index
);
}
else
{
sub
=
msg
.
substring
(
index
,
maxLength
);
sub
=
msg
.
substring
(
index
,
index
+
maxLength
);
}
index
+=
maxLength
;
Log
.
w
(
tag
,
sub
.
trim
());
...
...
@@ -382,7 +382,7 @@ public class MiyaLogger {
if
(
msg
.
length
()
<=
index
+
maxLength
)
{
sub
=
msg
.
substring
(
index
);
}
else
{
sub
=
msg
.
substring
(
index
,
maxLength
);
sub
=
msg
.
substring
(
index
,
index
+
maxLength
);
}
index
+=
maxLength
;
Log
.
e
(
tag
,
sub
.
trim
());
...
...
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