Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
ShirasawaSama committed Mar 8, 2023
1 parent 71e282d commit 95e05b9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

group 'com.microsoft.appcenter'
version '1.0.1'
version '1.0.2'

java {
withSourcesJar()
Expand Down
13 changes: 12 additions & 1 deletion src/main/java/android/util/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
//import org.jetbrains.annotations.IntDef;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
//import org.jetbrains.annotations.SystemApi;
//import android.compat.annotation.UnsupportedAppUsage;
//import android.os.DeadSystemException;
Expand Down Expand Up @@ -67,6 +69,7 @@
* a positive value may be considered as a successful invocation.
*/
public final class Log {
public static final Logger LOGGER = LoggerFactory.getLogger(Log.class);
/** @hide */
// @IntDef({ASSERT, ERROR, WARN, INFO, DEBUG, VERBOSE})
@Retention(RetentionPolicy.SOURCE)
Expand Down Expand Up @@ -379,7 +382,15 @@ public static int println(@Level int priority, @Nullable String tag, @NotNull St
*/
// @UnsupportedAppUsage
public static int println_native(int bufID, int priority, String tag, String msg) {
System.out.printf("[%s] %s\n", tag, msg);
org.slf4j.event.Level level;
switch (priority) {
case 0: case 1: case VERBOSE: level = org.slf4j.event.Level.TRACE; break;
case DEBUG: level = org.slf4j.event.Level.DEBUG; break;
case INFO: level = org.slf4j.event.Level.INFO; break;
case WARN: level = org.slf4j.event.Level.WARN; break;
default: level = org.slf4j.event.Level.ERROR;
}
LOGGER.atLevel(level).log("[%s] %s", tag, msg);
return 1;
}
/**
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/microsoft/appcenter/AppCenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import java.util.logging.Logger;

//import static android.content.pm.ApplicationInfo.FLAG_DEBUGGABLE;
import static android.util.Log.VERBOSE;
import static com.microsoft.appcenter.ApplicationContextUtils.getApplicationContext;
import static com.microsoft.appcenter.Constants.DEFAULT_TRIGGER_COUNT;
import static com.microsoft.appcenter.Constants.DEFAULT_TRIGGER_INTERVAL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package com.microsoft.appcenter.utils;

import static android.util.Log.ERROR;
import static android.util.Log.VERBOSE;

import android.util.Log;
Expand Down Expand Up @@ -39,7 +40,7 @@ public class AppCenterLog {
/**
* Current log level.
*/
private static int sLogLevel = VERBOSE;
private static int sLogLevel = ERROR;

/**
* Custom logger.
Expand Down

0 comments on commit 95e05b9

Please sign in to comment.