Просмотр исходного кода

提交1.0.4版本,修复kotlin调用打印方法只填msg时报错问题,将android support转成androidx支持,并将Maven库存放到个人服务器上

yanyi 6 лет назад
Родитель
Сommit
c23dfae3d6

+ 109 - 25
.idea/codeStyles/Project.xml

@@ -1,29 +1,113 @@
 <component name="ProjectCodeStyleConfiguration">
   <code_scheme name="Project" version="173">
-    <Objective-C-extensions>
-      <file>
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
-      </file>
-      <class>
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
-      </class>
-      <extensions>
-        <pair source="cpp" header="h" fileNamingConvention="NONE" />
-        <pair source="c" header="h" fileNamingConvention="NONE" />
-      </extensions>
-    </Objective-C-extensions>
+    <codeStyleSettings language="XML">
+      <arrangement>
+        <rules>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>xmlns:android</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>xmlns:.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*:id</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*:name</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>name</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>style</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>ANDROID_ATTRIBUTE_ORDER</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>.*</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+        </rules>
+      </arrangement>
+    </codeStyleSettings>
   </code_scheme>
 </component>

+ 2 - 0
.idea/gradle.xml

@@ -1,8 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>
+        <option name="testRunner" value="PLATFORM" />
         <option name="distributionType" value="DEFAULT_WRAPPED" />
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
         <option name="modules">

+ 0 - 80
.idea/misc.xml

@@ -20,86 +20,6 @@
       </map>
     </option>
   </component>
-  <component name="MarkdownProjectSettings" wasCopied="true">
-    <PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="NONE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true" verticallyAlignSourceAndPreviewSyncPosition="true" showSearchHighlightsInPreview="false" showSelectionInPreview="true" openRemoteLinks="true" replaceUnicodeEmoji="false" lastLayoutSetsDefault="false">
-      <PanelProvider>
-        <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" />
-      </PanelProvider>
-    </PreviewSettings>
-    <ParserSettings gitHubSyntaxChange="false" emojiShortcuts="1" emojiImages="0">
-      <PegdownExtensions>
-        <option name="ABBREVIATIONS" value="false" />
-        <option name="ANCHORLINKS" value="true" />
-        <option name="ASIDE" value="false" />
-        <option name="ATXHEADERSPACE" value="true" />
-        <option name="AUTOLINKS" value="true" />
-        <option name="DEFINITIONS" value="false" />
-        <option name="DEFINITION_BREAK_DOUBLE_BLANK_LINE" value="false" />
-        <option name="FENCED_CODE_BLOCKS" value="true" />
-        <option name="FOOTNOTES" value="false" />
-        <option name="HARDWRAPS" value="false" />
-        <option name="HTML_DEEP_PARSER" value="false" />
-        <option name="INSERTED" value="false" />
-        <option name="QUOTES" value="false" />
-        <option name="RELAXEDHRULES" value="true" />
-        <option name="SMARTS" value="false" />
-        <option name="STRIKETHROUGH" value="true" />
-        <option name="SUBSCRIPT" value="false" />
-        <option name="SUPERSCRIPT" value="false" />
-        <option name="SUPPRESS_HTML_BLOCKS" value="false" />
-        <option name="SUPPRESS_INLINE_HTML" value="false" />
-        <option name="TABLES" value="true" />
-        <option name="TASKLISTITEMS" value="true" />
-        <option name="TOC" value="false" />
-        <option name="WIKILINKS" value="false" />
-      </PegdownExtensions>
-      <ParserOptions>
-        <option name="ADMONITION_EXT" value="false" />
-        <option name="ATTRIBUTES_EXT" value="false" />
-        <option name="COMMONMARK_LISTS" value="true" />
-        <option name="DUMMY" value="false" />
-        <option name="EMOJI_SHORTCUTS" value="true" />
-        <option name="ENUMERATED_REFERENCES_EXT" value="false" />
-        <option name="FLEXMARK_FRONT_MATTER" value="false" />
-        <option name="GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA" value="false" />
-        <option name="GFM_TABLE_RENDERING" value="true" />
-        <option name="GITBOOK_URL_ENCODING" value="false" />
-        <option name="GITHUB_LISTS" value="false" />
-        <option name="GITHUB_WIKI_LINKS" value="false" />
-        <option name="GITLAB_EXT" value="false" />
-        <option name="GITLAB_MATH_EXT" value="false" />
-        <option name="GITLAB_MERMAID_EXT" value="false" />
-        <option name="HEADER_ID_NON_ASCII_TO_LOWERCASE" value="false" />
-        <option name="HEADER_ID_NO_DUPED_DASHES" value="false" />
-        <option name="JEKYLL_FRONT_MATTER" value="false" />
-        <option name="MACROS_EXT" value="false" />
-        <option name="NO_TEXT_ATTRIBUTES" value="false" />
-        <option name="PARSE_HTML_ANCHOR_ID" value="false" />
-        <option name="SIM_TOC_BLANK_LINE_SPACER" value="true" />
-      </ParserOptions>
-    </ParserSettings>
-    <HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true" embedImages="false" embedHttpImages="false" imageUriSerials="false" addDocTypeHtml="true" noParaTags="false">
-      <GeneratorProvider>
-        <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" />
-      </GeneratorProvider>
-      <headerTop />
-      <headerBottom />
-      <bodyTop />
-      <bodyBottom />
-    </HtmlSettings>
-    <CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssUriSerial="true" isCssTextEnabled="false" isDynamicPageWidth="true">
-      <StylesheetProvider>
-        <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" />
-      </StylesheetProvider>
-      <ScriptProviders />
-      <cssText />
-      <cssUriHistory />
-    </CssSettings>
-    <HtmlExportSettings updateOnSave="false" parentDir="" targetDir="" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetPathType="2" targetExt="" useTargetExt="false" noCssNoScripts="false" useElementStyleAttribute="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" linkFormatType="HTTP_ABSOLUTE" />
-    <LinkMapSettings>
-      <textMaps />
-    </LinkMapSettings>
-  </component>
   <component name="NullableNotNullManager">
     <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
     <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />

+ 3 - 3
.idea/modules.xml

@@ -2,9 +2,9 @@
 <project version="4">
   <component name="ProjectModuleManager">
     <modules>
-      <module fileurl="file://$PROJECT_DIR$/Logger.iml" filepath="$PROJECT_DIR$/Logger.iml" />
-      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
-      <module fileurl="file://$PROJECT_DIR$/loglib/loglib.iml" filepath="$PROJECT_DIR$/loglib/loglib.iml" />
+      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" group="logger/app" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/logger.iml" filepath="$PROJECT_DIR$/.idea/logger.iml" group="logger" />
+      <module fileurl="file://$PROJECT_DIR$/loglib/loglib.iml" filepath="$PROJECT_DIR$/loglib/loglib.iml" group="logger/loglib" />
     </modules>
   </component>
 </project>

+ 31 - 18
README.md

@@ -1,26 +1,39 @@
 # Logger
 ## log封装
 
-### 使用方法
-
-module 下添加
-
-     implementation 'com.yanyi.benyanyi:loglib:1.0.3'
-
-<br/>
-
-    可设置是否打印JLog.init(boolean),默认debug版本apk打印,release版本apk不打印
-    设置打印方式JLog.fileType(FileType),默认FileType为FileType.JAVA,说明为java类打印
+## 使用方法
+### 根目录下build.gradle添加Maven地址
+~~~
+repositories {
+        maven {
+            url "http://maven.yanyi.online:8081/nexus/content/repositories/mylove/"
+        }
+    }
+~~~
+### module 下添加
+~~~
+implementation 'com.yanyi.benyanyi:Logger:1.0.4'
+~~~
+
+或者
+~~~
+<dependency>
+  <groupId>com.yanyi.benyanyi</groupId>
+  <artifactId>Logger</artifactId>
+  <version>1.0.4</version>
+  <type>aar</type>
+</dependency>
+~~~
+### 参数介绍
+* JLog.init(boolean) 设置是否打印,默认debug版本apk打印,release版本apk不打印
+* JLog.fileType(FileType) 设置打印方式,默认FileType为FileType.JAVA,说明为java类打印
     
-<br/>
-
-### 更新
-
-* 2019-07-01 更新1.0.3,判断代码类型,添加kotlin类打印方式
-* 2019-06-13 更新1.0.2,优化代码,修改包名,统一开源库包名
+## 更新
+* 2020-05-18 更新1.0.4,修复kotlin调用打印方法只填msg时报错问题,将android support转成androidx支持,并将Maven库存放到个人服务器上
+* 2019-07-01 更新1.0.3,判断代码类型,添加kotlin类打印方式
+* 2019-06-13 更新1.0.2,优化代码,修改包名,统一开源库包名
 * 2019-03-06 更新1.0.1,更改默认不打印为默认debug版本apk打印release版本apk不打印
-
-
+---
 若在使用过程中出现什么问题,可以联系作者<br/>
 作者:演绎<br/>
 QQ:1541612424<br/>

+ 6 - 6
app/build.gradle

@@ -1,14 +1,14 @@
 apply plugin: 'com.android.application'
 
 android {
-    compileSdkVersion 26
+    compileSdkVersion 29
     defaultConfig {
         applicationId "com.mylove.logger"
         minSdkVersion 14
-        targetSdkVersion 26
+        targetSdkVersion 29
         versionCode 1
         versionName "1.0"
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
     }
     signingConfigs {
         release {
@@ -35,10 +35,10 @@ android {
 
 dependencies {
     implementation fileTree(include: ['*.jar'], dir: 'libs')
-    implementation 'com.android.support:appcompat-v7:26.1.0'
+    implementation 'androidx.appcompat:appcompat:1.0.0'
     testImplementation 'junit:junit:4.12'
-    androidTestImplementation 'com.android.support.test:runner:1.0.1'
-    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
     implementation project(':loglib')
 }
 repositories {

+ 2 - 2
app/src/androidTest/java/com/mylove/logger/ExampleInstrumentedTest.java

@@ -1,8 +1,8 @@
 package com.mylove.logger;
 
 import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;

+ 3 - 2
app/src/main/java/com/mylove/logger/MainActivity.java

@@ -4,10 +4,11 @@ import android.annotation.SuppressLint;
 import android.app.Application;
 import android.content.pm.ApplicationInfo;
 import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v7.app.AppCompatActivity;
 import android.widget.TextView;
 
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
 import com.benyanyi.loglib.Jlog;
 
 /**

+ 3 - 2
build.gradle

@@ -1,15 +1,16 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
 
 buildscript {
-    
+
     repositories {
         google()
         jcenter()
+        maven { url 'http://maven.yanyi.online:8081/nexus/content/repositories/mylove/' }
     }
     dependencies {
         classpath 'com.android.tools.build:gradle:3.2.1'
         classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
-        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.2'
+//        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.2'
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files

+ 2 - 0
gradle.properties

@@ -9,6 +9,8 @@
 
 # Specifies the JVM arguments used for the daemon process.
 # The setting is particularly useful for tweaking memory settings.
+android.enableJetifier=true
+android.useAndroidX=true
 org.gradle.jvmargs=-Xmx1536m
 
 # When configured, Gradle will run in incubating parallel mode.

+ 15 - 67
loglib/bintrayUpload.gradle

@@ -1,80 +1,28 @@
-// 这里添加下面两行代码。
-apply plugin: 'com.github.dcendents.android-maven'
-apply plugin: 'com.jfrog.bintray'
+apply plugin: 'maven-publish'
+apply plugin: 'maven'
 
-// 定义两个链接,下面会用到。
-def siteUrl = 'http://www.yanyis.space/yanyi/logger' // 项目主页。
-def gitUrl = 'http://www.yanyis.space/yanyi/logger.git' // Git仓库的url。
+Properties properties = new Properties()
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+uploadArchives {
+    repositories {
+        mavenDeployer {
+            repository(url: properties.getProperty("POM_URL")) {
+                authentication(userName: properties.getProperty("nexus.user"), password: properties.getProperty("nexus.password"))
+            }
 
-group = "com.yanyi.benyanyi"// 唯一包名,比如compile 'com.ansen.http:okhttpencapsulation:1.0.1'中的com.ansen.http就是这里配置的。
-version = "1.0.3"//项目引用的版本号,比如compile 'com.ansen.http:okhttpencapsulation:1.0.1'中的1.0.1就是这里配置的。
-install {
-    repositories.mavenInstaller {
-        // This generates POM.xml with proper parameters
-        pom {
-            project {
-                packaging 'aar'
-                // Add your description here
-                name 'multi-format 1D/2D barcode image processing use zxing.'
-                url siteUrl
-                // Set your license
+            pom.groupId = properties.getProperty("POM_GROUP_ID")
+            pom.artifactId = properties.getProperty("POM_ATRIFACT_ID")
+            pom.version = properties.getProperty("POM_VERSION")
+
+            pom.project {
                 licenses {
                     license {
                         name 'The Apache Software License, Version 2.0'
                         url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                     }
                 }
-                developers {
-                    developer {
-                        id 'benyanyi'     //填写的一些基本信息
-                        name 'benyanyi'
-                        email 'git@yanyi.red'
-                    }
-                }
-                scm {
-                    connection gitUrl
-                    developerConnection gitUrl
-                    url siteUrl
-                }
             }
         }
     }
 }
-task sourcesJar(type: Jar) {
-    from android.sourceSets.main.java.srcDirs
-    classifier = 'sources'
-}
-task javadoc(type: Javadoc) {
-    source = android.sourceSets.main.java.srcDirs
-    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
-}
-task javadocJar(type: Jar, dependsOn: javadoc) {
-    classifier = 'javadoc'
-    from javadoc.destinationDir
-}
-artifacts {
-    archives javadocJar
-    archives sourcesJar
-}
-Properties properties = new Properties()
-properties.load(project.rootProject.file('local.properties').newDataInputStream())
-bintray {
-    user = properties.getProperty("bintray.user")
-    key = properties.getProperty("bintray.apikey")
-    configurations = ['archives']
-    pkg {
-        repo = "Logger"
-        name = "Logger"   //发布到JCenter上的项目名字
-        websiteUrl = siteUrl
-        vcsUrl = gitUrl
-        licenses = ["Apache-2.0"]
-        publish = true
-    }
-}
-javadoc { //jav doc采用utf-8编码否则会报“GBK的不可映射字符”错误
-    options{
-        encoding "UTF-8"
-        charSet 'UTF-8'
-    }
-}
 //gradlew bintrayUpload    terminal中输入

+ 6 - 6
loglib/build.gradle

@@ -1,17 +1,17 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 26
+    compileSdkVersion 29
 
 
 
     defaultConfig {
         minSdkVersion 14
-        targetSdkVersion 26
+        targetSdkVersion 29
         versionCode 1
         versionName "1.0"
 
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 
     }
 
@@ -27,9 +27,9 @@ android {
 dependencies {
     implementation fileTree(dir: 'libs', include: ['*.jar'])
 
-    implementation 'com.android.support:appcompat-v7:26.1.0'
+    implementation 'androidx.appcompat:appcompat:1.0.0'
     testImplementation 'junit:junit:4.12'
-    androidTestImplementation 'com.android.support.test:runner:1.0.1'
-    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
 }
 apply from: 'bintrayUpload.gradle'

+ 2 - 2
loglib/src/androidTest/java/com/mylove/loglib/ExampleInstrumentedTest.java

@@ -1,8 +1,8 @@
 package com.mylove.loglib;
 
 import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;

+ 2 - 2
loglib/src/main/java/com/benyanyi/loglib/FileLog.java

@@ -1,7 +1,7 @@
 package com.benyanyi.loglib;
 
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import android.util.Log;
 
 import java.io.File;

+ 21 - 19
loglib/src/main/java/com/benyanyi/loglib/Jlog.java

@@ -3,9 +3,11 @@ package com.benyanyi.loglib;
 import android.annotation.SuppressLint;
 import android.app.Application;
 import android.content.pm.ApplicationInfo;
-import android.support.annotation.Nullable;
 import android.text.TextUtils;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
 import java.io.File;
 import java.io.PrintWriter;
 import java.io.StringWriter;
@@ -73,7 +75,7 @@ public final class Jlog {
         printLog(V, null, msg);
     }
 
-    public static void v(String tag, Object... objects) {
+    public static void v(Object tag, @NonNull Object... objects) {
         printLog(V, tag, objects);
     }
 
@@ -85,7 +87,7 @@ public final class Jlog {
         printLog(D, null, msg);
     }
 
-    public static void d(String tag, Object... objects) {
+    public static void d(Object tag, Object... objects) {
         printLog(D, tag, objects);
     }
 
@@ -97,7 +99,7 @@ public final class Jlog {
         printLog(I, null, msg);
     }
 
-    public static void i(String tag, Object... objects) {
+    public static void i(Object tag, Object... objects) {
         printLog(I, tag, objects);
     }
 
@@ -109,7 +111,7 @@ public final class Jlog {
         printLog(W, null, msg);
     }
 
-    public static void w(String tag, Object... objects) {
+    public static void w(Object tag, Object... objects) {
         printLog(W, tag, objects);
     }
 
@@ -121,7 +123,7 @@ public final class Jlog {
         printLog(E, null, msg);
     }
 
-    public static void e(String tag, Object... objects) {
+    public static void e(Object tag, Object... objects) {
         printLog(E, tag, objects);
     }
 
@@ -133,23 +135,23 @@ public final class Jlog {
         printLog(A, null, msg);
     }
 
-    public static void a(String tag, Object... objects) {
+    public static void a(Object tag, Object... objects) {
         printLog(A, tag, objects);
     }
 
-    public static void json(String jsonFormat) {
+    public static void json(Object jsonFormat) {
         printLog(JSON, null, jsonFormat);
     }
 
-    public static void json(String tag, String jsonFormat) {
+    public static void json(Object tag, String jsonFormat) {
         printLog(JSON, tag, jsonFormat);
     }
 
-    public static void xml(String xml) {
+    public static void xml(Object xml) {
         printLog(XML, null, xml);
     }
 
-    public static void xml(String tag, String xml) {
+    public static void xml(Object tag, String xml) {
         printLog(XML, tag, xml);
     }
 
@@ -157,11 +159,11 @@ public final class Jlog {
         printFile(null, targetDirectory, null, msg);
     }
 
-    public static void file(String tag, File targetDirectory, Object msg) {
+    public static void file(Object tag, File targetDirectory, Object msg) {
         printFile(tag, targetDirectory, null, msg);
     }
 
-    public static void file(String tag, File targetDirectory, String fileName, Object msg) {
+    public static void file(Object tag, File targetDirectory, String fileName, Object msg) {
         printFile(tag, targetDirectory, fileName, msg);
     }
 
@@ -173,7 +175,7 @@ public final class Jlog {
         printDebug(null, msg);
     }
 
-    public static void debug(String tag, Object... objects) {
+    public static void debug(Object tag, Object... objects) {
         printDebug(tag, objects);
     }
 
@@ -213,7 +215,7 @@ public final class Jlog {
         BaseLog.printDefault(D, tag, headString + msg);
     }
 
-    private static void printLog(int type, String tagStr, Object... objects) {
+    private static void printLog(int type, Object tagStr, Object... objects) {
 
         if (!IS_SHOW_LOG) {
             return;
@@ -246,7 +248,7 @@ public final class Jlog {
 
     }
 
-    private static void printDebug(String tagStr, Object... objects) {
+    private static void printDebug(Object tagStr, Object... objects) {
         String[] contents = wrapperContent(STACK_TRACE_INDEX_5, tagStr, objects);
         String tag = contents[0];
         String msg = contents[1];
@@ -255,7 +257,7 @@ public final class Jlog {
     }
 
 
-    private static void printFile(String tagStr, File targetDirectory, String fileName, Object objectMsg) {
+    private static void printFile(Object tagStr, File targetDirectory, String fileName, Object objectMsg) {
 
         if (!IS_SHOW_LOG) {
             return;
@@ -271,7 +273,7 @@ public final class Jlog {
         FileLog.printFile(tag, targetDirectory, fileName, headString, msg);
     }
 
-    private static String[] wrapperContent(int stackTraceIndex, String tagStr, Object... objects) {
+    private static String[] wrapperContent(int stackTraceIndex, Object tagStr, Object... objects) {
 
         if (FILE_TYPE == FileType.KOTLIN) {
             SUFFIX = ".kt";
@@ -299,7 +301,7 @@ public final class Jlog {
             lineNumber = 0;
         }
 
-        String tag = (tagStr == null ? className : tagStr);
+        String tag = (tagStr == null ? className : tagStr).toString();
 
         if (mIsGlobalTagEmpty && TextUtils.isEmpty(tag)) {
             tag = TAG_DEFAULT;