forked from Hilaver/MockGPS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
669 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file renamed
BIN
+490 KB
...s/arm64-v8a/libBaiduMapSDK_base_v5_1_0.so → ...s/arm64-v8a/libBaiduMapSDK_base_v5_3_2.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+333 KB
...armeabi-v7a/libBaiduMapSDK_base_v5_1_0.so → ...armeabi-v7a/libBaiduMapSDK_base_v5_3_2.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+349 KB
...ibs/armeabi/libBaiduMapSDK_base_v5_1_0.so → ...ibs/armeabi/libBaiduMapSDK_base_v5_3_2.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+506 KB
...libs/x86_64/libBaiduMapSDK_base_v5_1_0.so → ...libs/x86_64/libBaiduMapSDK_base_v5_3_2.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.9.4","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] | ||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.9.5","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package com.example.log4j; | ||
|
||
import org.apache.log4j.AppenderSkeleton; | ||
import org.apache.log4j.Layout; | ||
import org.apache.log4j.PatternLayout; | ||
import org.apache.log4j.spi.LoggingEvent; | ||
|
||
import android.util.Log; | ||
|
||
/** | ||
* 源自 android-logging-log4j-1.0.3.jar | ||
* | ||
* @author Administrator | ||
*/ | ||
public class LogCatAppender extends AppenderSkeleton { | ||
protected Layout tagLayout; | ||
|
||
public LogCatAppender(Layout messageLayout, Layout tagLayout) { | ||
this.tagLayout = tagLayout; | ||
setLayout(messageLayout); | ||
} | ||
|
||
public LogCatAppender(Layout messageLayout) { | ||
//这里定义的是Tag名称 | ||
this(messageLayout, new PatternLayout("%c")); | ||
} | ||
|
||
public LogCatAppender() { | ||
this(new PatternLayout("%c")); | ||
} | ||
|
||
protected void append(LoggingEvent le) { | ||
switch (le.getLevel().toInt()) { | ||
case 5000: | ||
if (le.getThrowableInformation() != null) { | ||
Log.v(getTagLayout().format(le), getLayout().format(le), le.getThrowableInformation().getThrowable()); | ||
} else { | ||
Log.v(getTagLayout().format(le), getLayout().format(le)); | ||
} | ||
break; | ||
case 10000: | ||
if (le.getThrowableInformation() != null) { | ||
Log.d(getTagLayout().format(le), getLayout().format(le), le.getThrowableInformation().getThrowable()); | ||
} else { | ||
Log.d(getTagLayout().format(le), getLayout().format(le)); | ||
} | ||
break; | ||
case 20000: | ||
if (le.getThrowableInformation() != null) { | ||
Log.i(getTagLayout().format(le), getLayout().format(le), le.getThrowableInformation().getThrowable()); | ||
} else { | ||
Log.i(getTagLayout().format(le), getLayout().format(le)); | ||
} | ||
break; | ||
case 30000: | ||
if (le.getThrowableInformation() != null) { | ||
Log.w(getTagLayout().format(le), getLayout().format(le), le.getThrowableInformation().getThrowable()); | ||
} else { | ||
Log.w(getTagLayout().format(le), getLayout().format(le)); | ||
} | ||
break; | ||
case 40000: | ||
if (le.getThrowableInformation() != null) { | ||
Log.e(getTagLayout().format(le), getLayout().format(le), le.getThrowableInformation().getThrowable()); | ||
} else { | ||
Log.e(getTagLayout().format(le), getLayout().format(le)); | ||
} | ||
break; | ||
case 50000: | ||
if (le.getThrowableInformation() != null) { | ||
Log.wtf(getTagLayout().format(le), getLayout().format(le), le.getThrowableInformation().getThrowable()); | ||
} else | ||
Log.wtf(getTagLayout().format(le), getLayout().format(le)); | ||
break; | ||
} | ||
} | ||
|
||
public void close() { | ||
} | ||
|
||
public boolean requiresLayout() { | ||
return true; | ||
} | ||
|
||
public Layout getTagLayout() { | ||
return this.tagLayout; | ||
} | ||
|
||
public void setTagLayout(Layout tagLayout) { | ||
this.tagLayout = tagLayout; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,218 @@ | ||
package com.example.log4j; | ||
|
||
import java.io.IOException; | ||
|
||
import org.apache.log4j.Layout; | ||
import org.apache.log4j.Level; | ||
import org.apache.log4j.LogManager; | ||
import org.apache.log4j.Logger; | ||
import org.apache.log4j.PatternLayout; | ||
import org.apache.log4j.RollingFileAppender; | ||
import org.apache.log4j.helpers.LogLog; | ||
|
||
|
||
/** | ||
* 源自 android-logging-log4j-1.0.3.jar | ||
* | ||
* @author Administrator | ||
*/ | ||
public class LogConfig { | ||
private Level rootLevel = Level.DEBUG; | ||
/** | ||
* ### log文件的格式 | ||
* | ||
* ### 输出格式解释: | ||
* ### [%-d{yyyy-MM-dd HH:mm:ss}][Class: %c.%M(%F:%L)] %n[Level: %-5p] - Msg: %m%n | ||
* | ||
* ### %d{yyyy-MM-dd HH:mm:ss}: 时间,大括号内是时间格式 | ||
* ### %c: 全类名 | ||
* ### %M: 调用的方法名称 | ||
* ### %F:%L 类名:行号(在控制台可以追踪代码) | ||
* ### %n: 换行 | ||
* ### %p: 日志级别,这里%-5p是指定的5个字符的日志名称,为的是格式整齐 | ||
* ### %m: 日志信息 | ||
* ### 输出的信息大概如下: | ||
* ### [时间{时间格式}][信息所在的class.method(className:lineNumber)] 换行 | ||
* ### [Level: 5个字符的等级名称] - Msg: 输出信息 换行 | ||
*/ | ||
private String filePattern = "[%-d{yyyy-MM-dd HH:mm:ss}][Class: %c.%M(%F:%L)] %n[Level: %-5p] - Msg: %m%n"; | ||
|
||
/** | ||
* ### LogCat控制台输出格式 | ||
* | ||
* ### [Class: 信息所在的class.method(className:lineNumber)] 换行 | ||
* ### [Level: 5个字符的等级名称] - Msg: 输出信息 换行 | ||
*/ | ||
private String logCatPattern = "[Class: %c.%M(%F:%L)] %n[Level: %-5p] - Msg: %m%n"; | ||
private String fileName = "android-log4j.log"; | ||
private int maxBackupSize = 5; | ||
private long maxFileSize = 1024 * 1024 * 5L; | ||
private boolean immediateFlush = true; | ||
private boolean useLogCatAppender = true; | ||
private boolean useFileAppender = true; | ||
private boolean resetConfiguration = true; | ||
private boolean internalDebugging = false; | ||
|
||
public LogConfig() { | ||
} | ||
|
||
public LogConfig(String fileName) { | ||
setFileName(fileName); | ||
} | ||
|
||
public LogConfig(String fileName, Level rootLevel) { | ||
this(fileName); | ||
setRootLevel(rootLevel); | ||
} | ||
|
||
public LogConfig(String fileName, Level rootLevel, String filePattern) { | ||
this(fileName); | ||
setRootLevel(rootLevel); | ||
setFilePattern(filePattern); | ||
} | ||
|
||
public LogConfig(String fileName, int maxBackupSize, long maxFileSize, String filePattern, Level rootLevel) { | ||
this(fileName, rootLevel, filePattern); | ||
setMaxBackupSize(maxBackupSize); | ||
setMaxFileSize(maxFileSize); | ||
} | ||
|
||
public void configure() { | ||
Logger root = Logger.getRootLogger(); | ||
|
||
if (isResetConfiguration()) { | ||
LogManager.getLoggerRepository().resetConfiguration(); | ||
} | ||
|
||
LogLog.setInternalDebugging(isInternalDebugging()); | ||
|
||
if (isUseFileAppender()) { | ||
configureFileAppender(); | ||
} | ||
|
||
if (isUseLogCatAppender()) { | ||
configureLogCatAppender(); | ||
} | ||
|
||
root.setLevel(getRootLevel()); | ||
} | ||
|
||
public void setLevel(String loggerName, Level level) { | ||
Logger.getLogger(loggerName).setLevel(level); | ||
} | ||
|
||
private void configureFileAppender() { | ||
Logger root = Logger.getRootLogger(); | ||
|
||
Layout fileLayout = new PatternLayout(getFilePattern()); | ||
RollingFileAppender rollingFileAppender; | ||
try { | ||
rollingFileAppender = new RollingFileAppender(fileLayout, getFileName()); | ||
} catch (IOException e) { | ||
throw new RuntimeException("Exception configuring log system", e); | ||
} | ||
|
||
rollingFileAppender.setMaxBackupIndex(getMaxBackupSize()); | ||
rollingFileAppender.setMaximumFileSize(getMaxFileSize()); | ||
rollingFileAppender.setImmediateFlush(isImmediateFlush()); | ||
|
||
root.addAppender(rollingFileAppender); | ||
} | ||
|
||
private void configureLogCatAppender() { | ||
Logger root = Logger.getRootLogger(); | ||
Layout logCatLayout = new PatternLayout(getLogCatPattern()); | ||
LogCatAppender logCatAppender = new LogCatAppender(logCatLayout); | ||
|
||
root.addAppender(logCatAppender); | ||
} | ||
|
||
public Level getRootLevel() { | ||
return this.rootLevel; | ||
} | ||
|
||
public void setRootLevel(Level level) { | ||
this.rootLevel = level; | ||
} | ||
|
||
public String getFilePattern() { | ||
return this.filePattern; | ||
} | ||
|
||
public void setFilePattern(String filePattern) { | ||
this.filePattern = filePattern; | ||
} | ||
|
||
public String getLogCatPattern() { | ||
return this.logCatPattern; | ||
} | ||
|
||
public void setLogCatPattern(String logCatPattern) { | ||
this.logCatPattern = logCatPattern; | ||
} | ||
|
||
public String getFileName() { | ||
return this.fileName; | ||
} | ||
|
||
public void setFileName(String fileName) { | ||
this.fileName = fileName; | ||
} | ||
|
||
public int getMaxBackupSize() { | ||
return this.maxBackupSize; | ||
} | ||
|
||
public void setMaxBackupSize(int maxBackupSize) { | ||
this.maxBackupSize = maxBackupSize; | ||
} | ||
|
||
public long getMaxFileSize() { | ||
return this.maxFileSize; | ||
} | ||
|
||
public void setMaxFileSize(long maxFileSize) { | ||
this.maxFileSize = maxFileSize; | ||
} | ||
|
||
public boolean isImmediateFlush() { | ||
return this.immediateFlush; | ||
} | ||
|
||
public void setImmediateFlush(boolean immediateFlush) { | ||
this.immediateFlush = immediateFlush; | ||
} | ||
|
||
public boolean isUseFileAppender() { | ||
return this.useFileAppender; | ||
} | ||
|
||
public void setUseFileAppender(boolean useFileAppender) { | ||
this.useFileAppender = useFileAppender; | ||
} | ||
|
||
public boolean isUseLogCatAppender() { | ||
return this.useLogCatAppender; | ||
} | ||
|
||
public void setUseLogCatAppender(boolean useLogCatAppender) { | ||
this.useLogCatAppender = useLogCatAppender; | ||
} | ||
|
||
public void setResetConfiguration(boolean resetConfiguration) { | ||
this.resetConfiguration = resetConfiguration; | ||
} | ||
|
||
public boolean isResetConfiguration() { | ||
return this.resetConfiguration; | ||
} | ||
|
||
public void setInternalDebugging(boolean internalDebugging) { | ||
this.internalDebugging = internalDebugging; | ||
} | ||
|
||
public boolean isInternalDebugging() { | ||
return this.internalDebugging; | ||
} | ||
} |
Oops, something went wrong.