Commit 58a29965 authored by pengguangpu's avatar pengguangpu

bug修复,修改删除日志中的后缀判断;

版本号自增;
parent 7702eda0
...@@ -47,7 +47,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -47,7 +47,7 @@ public class MainActivity extends AppCompatActivity {
public void onClick(View v) { public void onClick(View v) {
String daysStr = ((EditText) findViewById(R.id.etDays)).getText().toString(); String daysStr = ((EditText) findViewById(R.id.etDays)).getText().toString();
int days = 0; int days = 0;
if (TextUtils.isEmpty(daysStr)) { if (!TextUtils.isEmpty(daysStr)) {
days = Integer.parseInt(daysStr); days = Integer.parseInt(daysStr);
} }
MiyaLogger.deleteLog(days); MiyaLogger.deleteLog(days);
......
...@@ -6,9 +6,9 @@ def getSDKName() { ...@@ -6,9 +6,9 @@ def getSDKName() {
} }
//发布版本 //发布版本
def publishVersion = "1.0.0" def publishVersion = "1.0.2"
//发布版本号 //发布版本号
def publishVersionCode = 1 def publishVersionCode = 3
android { android {
compileSdkVersion 28 compileSdkVersion 28
......
...@@ -189,7 +189,7 @@ public class MiyaLogger { ...@@ -189,7 +189,7 @@ public class MiyaLogger {
if (fileBean.fileName.endsWith(logSuffix)) { if (fileBean.fileName.endsWith(logSuffix)) {
if (fileBean.fileName.contains(logLink)) { if (fileBean.fileName.contains(logLink)) {
try { try {
String fileNameWithOutSuffix = fileBean.fileName.substring(0, fileBean.fileName.indexOf(".")); String fileNameWithOutSuffix = fileBean.fileName.substring(0, fileBean.fileName.lastIndexOf("."));
String fileNameDate = fileNameWithOutSuffix.substring(fileNameWithOutSuffix.lastIndexOf(logLink) + 1); String fileNameDate = fileNameWithOutSuffix.substring(fileNameWithOutSuffix.lastIndexOf(logLink) + 1);
long fileNameLongTimes = stringToLong(fileNameDate, DF_YYYYMMDD); long fileNameLongTimes = stringToLong(fileNameDate, DF_YYYYMMDD);
if ((currentLongTimes - fileNameLongTimes) >= days * 24L * 60L * 60L * 1000L) {//符合要求,加入删除列表 if ((currentLongTimes - fileNameLongTimes) >= days * 24L * 60L * 60L * 1000L) {//符合要求,加入删除列表
...@@ -302,7 +302,7 @@ public class MiyaLogger { ...@@ -302,7 +302,7 @@ public class MiyaLogger {
if (msg.length() <= index + maxLength) { if (msg.length() <= index + maxLength) {
sub = msg.substring(index); sub = msg.substring(index);
} else { } else {
sub = msg.substring(index, maxLength); sub = msg.substring(index, index + maxLength);
} }
index += maxLength; index += maxLength;
Log.i(tag, sub.trim()); Log.i(tag, sub.trim());
...@@ -322,7 +322,7 @@ public class MiyaLogger { ...@@ -322,7 +322,7 @@ public class MiyaLogger {
if (msg.length() <= index + maxLength) { if (msg.length() <= index + maxLength) {
sub = msg.substring(index); sub = msg.substring(index);
} else { } else {
sub = msg.substring(index, maxLength); sub = msg.substring(index, index+maxLength);
} }
index += maxLength; index += maxLength;
Log.v(tag, sub.trim()); Log.v(tag, sub.trim());
...@@ -342,7 +342,7 @@ public class MiyaLogger { ...@@ -342,7 +342,7 @@ public class MiyaLogger {
if (msg.length() <= index + maxLength) { if (msg.length() <= index + maxLength) {
sub = msg.substring(index); sub = msg.substring(index);
} else { } else {
sub = msg.substring(index, maxLength); sub = msg.substring(index, index+maxLength);
} }
index += maxLength; index += maxLength;
Log.d(tag, sub.trim()); Log.d(tag, sub.trim());
...@@ -362,7 +362,7 @@ public class MiyaLogger { ...@@ -362,7 +362,7 @@ public class MiyaLogger {
if (msg.length() <= index + maxLength) { if (msg.length() <= index + maxLength) {
sub = msg.substring(index); sub = msg.substring(index);
} else { } else {
sub = msg.substring(index, maxLength); sub = msg.substring(index, index+maxLength);
} }
index += maxLength; index += maxLength;
Log.w(tag, sub.trim()); Log.w(tag, sub.trim());
...@@ -382,7 +382,7 @@ public class MiyaLogger { ...@@ -382,7 +382,7 @@ public class MiyaLogger {
if (msg.length() <= index + maxLength) { if (msg.length() <= index + maxLength) {
sub = msg.substring(index); sub = msg.substring(index);
} else { } else {
sub = msg.substring(index, maxLength); sub = msg.substring(index, index+maxLength);
} }
index += maxLength; index += maxLength;
Log.e(tag, sub.trim()); Log.e(tag, sub.trim());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment