Commit 58a29965 authored by pengguangpu's avatar pengguangpu

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

版本号自增;
parent 7702eda0
......@@ -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);
......
......@@ -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
......
......@@ -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.indexOf("."));
String fileNameWithOutSuffix = fileBean.fileName.substring(0, fileBean.fileName.lastIndexOf("."));
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());
......
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