提交 ad836a6a 编写于 作者: Z ZhaoKaiQiang

修改Msg为Object

上级 e0d502a8
......@@ -7,6 +7,7 @@
*.dex
# Java class files
/library/library.iml
*.class
# Generated files
......@@ -22,6 +23,7 @@ build/
local.properties
# Proguard folder generated by Eclipse
/app/app.iml
proguard/
# Log Files
......
......@@ -66,15 +66,18 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/debug" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.github.zhaokaiqiang.klog/library/0.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
......@@ -82,7 +85,7 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-v4-23.1.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.0" level="project" />
<orderEntry type="library" exported="" name="library-0.0.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.1.0" level="project" />
<orderEntry type="module" module-name="library" exported="" />
</component>
</module>
\ No newline at end of file
......@@ -29,5 +29,6 @@ android {
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.github.zhaokaiqiang.klog:library:0.0.1'
// compile 'com.github.zhaokaiqiang.klog:library:0.0.1'
compile project(':library')
}
......@@ -50,6 +50,15 @@ public class MainActivity extends AppCompatActivity {
KLog.a(TAG, LOG_MSG);
}
public void logWithNull(View view){
KLog.v(null);
KLog.d(null);
KLog.i(null);
KLog.w(null);
KLog.e(null);
KLog.a(null);
}
public void logWithJson(View view) {
KLog.json(JSON);
}
......
......@@ -33,4 +33,9 @@
android:layout_height="wrap_content"
android:onClick="logWithJsonTag"
android:text="Log(TAG,JSON)" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="logWithNull"
android:text="Log(NULL)" />
</LinearLayout>
......@@ -140,8 +140,7 @@ public class KLog {
stringBuilder.append("[ (").append(className).append(":").append(lineNumber).append(")#").append(methodName).append(" ] ");
if (objectMsg == null) {
Log.d(tag, "Null Msg Object");
return;
msg = "Log with null Object";
} else {
msg = objectMsg.toString();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册