Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging: Use LogA class from dexterous #62

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ dependencies {
implementation project(':dexterous')

implementation "com.android.support:appcompat-v7:$supportLibVersion"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation "com.android.support:design:$supportLibVersion"
implementation "com.android.support:support-v13:$supportLibVersion"

implementation "android.arch.persistence.room:runtime:1.0.0"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
implementation "android.arch.persistence.room:runtime:1.1.0"
annotationProcessor "android.arch.persistence.room:compiler:1.1.0"

api 'com.madgag.spongycastle:core:1.54.0.0'
api 'com.madgag.spongycastle:pkix:1.54.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import java.io.InputStream;

import saarland.cispa.artist.artistgui.utils.StringUtils;
import trikita.log.Log;
import saarland.cispa.utils.LogA;

public class InfoFragment extends Fragment {

Expand Down Expand Up @@ -88,7 +88,7 @@ private void setupTextView() {
}

} catch (final IOException e) {
Log.e(TAG, "Could not read Artist Version files from assets.", e);
LogA.e(TAG, "Could not read Artist Version files from assets.", e);
}

mTextView.append("\n\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import saarland.cispa.artist.artistgui.instrumentation.progress.ProgressPublisher;
import saarland.cispa.artist.artistgui.settings.config.ArtistConfigFactory;
import saarland.cispa.artist.artistgui.settings.manager.SettingsManager;
import trikita.log.Log;
import saarland.cispa.utils.LogA;

public class AppDetailsDialogPresenter implements AppDetailsDialogContract.Presenter {

Expand Down Expand Up @@ -174,7 +174,7 @@ private void startInstrumentedAppIfWished() {
final boolean launchActivity = mSettingsManager.shouldLaunchActivityAfterCompilation();
if (launchActivity) {
String packageName = mSelectedPackage.packageName;
Log.d(TAG, "Starting compiled app: " + packageName);
LogA.d(TAG, "Starting compiled app: " + packageName);
final Intent launchIntent = mContext.getPackageManager()
.getLaunchIntentForPackage(packageName);
mContext.startActivity(launchIntent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package saarland.cispa.artist.artistgui.instrumentation;

import saarland.cispa.artist.artistgui.instrumentation.exceptions.ArtistInterruptedException;
import trikita.log.Log;
import saarland.cispa.utils.LogA;

/**
* The ARTist Project (https://artist.cispa.saarland)
Expand Down Expand Up @@ -30,7 +30,7 @@ class ArtistThread {

static void checkThreadCancellation() throws ArtistInterruptedException {
if (Thread.currentThread().isInterrupted()) {
Log.d(TAG, String.format("checkThreadCancellation() interrupted[%b]",
LogA.d(TAG, String.format("checkThreadCancellation() interrupted[%b]",
Thread.currentThread().isInterrupted()));
throw new ArtistInterruptedException("Thread is interrupted.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

import saarland.cispa.artist.artistgui.instrumentation.progress.ProgressPublisher;
import saarland.cispa.utils.LogA;
import trikita.log.Log;

public class InstrumentationService extends Service {

Expand Down Expand Up @@ -76,7 +75,7 @@ public InstrumentationService() {
@Override
public void onCreate() {
super.onCreate();
Log.i(TAG, "CompilationService()");
LogA.i(TAG, "CompilationService()");
LogA.setUserLogLevel(getApplicationContext());
mServiceController = new ServiceController(this);

Expand All @@ -87,11 +86,11 @@ public void onCreate() {

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.d(TAG, "onStartCommand()");
LogA.d(TAG, "onStartCommand()");
if (intent != null) {
final String packageName = intent.getStringExtra(INTENT_KEY_APP_NAME);
if (packageName != null && !packageName.isEmpty()) {
Log.d(TAG, "onStartCommand() Extra: " + packageName);
LogA.d(TAG, "onStartCommand() Extra: " + packageName);
instrumentApp(packageName);
}
}
Expand All @@ -112,15 +111,15 @@ public IBinder onBind(Intent intent) {

@Override
public void onRebind(Intent intent) {
Log.d(TAG, "onRebind()");
LogA.d(TAG, "onRebind()");
// A client is binding to the service with bindService(),
// after onUnbind() has already been called
mClientsBoundToService = true;
}

@Override
public boolean onUnbind(Intent intent) {
Log.d(TAG, "onUnbind()");
LogA.d(TAG, "onUnbind()");
mClientsBoundToService = false;
stopIfNothingToDo();
return ALLOW_REBIND;
Expand All @@ -129,7 +128,7 @@ public boolean onUnbind(Intent intent) {
@Override
public void onDestroy() {
super.onDestroy();
Log.i(TAG, "onDestroy()");
LogA.i(TAG, "onDestroy()");
LocalBroadcastManager.getInstance(this).unregisterReceiver(mResultReceiver);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import saarland.cispa.artist.artistgui.instrumentation.stages.InstrumentationStages;
import saarland.cispa.artist.artistgui.instrumentation.stages.InstrumentationStagesImpl;
import saarland.cispa.artist.artistgui.instrumentation.exceptions.ArtistInterruptedException;
import trikita.log.Log;
import saarland.cispa.utils.LogA;

class InstrumentationTask implements Runnable {

Expand All @@ -50,10 +50,10 @@ class InstrumentationTask implements Runnable {

@Override
public void run() {
Log.i(TAG, "Run() compiling and starting " + mRunConfig.app_package_name);
Log.i(TAG, "> apkPath: " + mRunConfig.app_apk_file_path);
Log.i(TAG, "> codeLibName: " + mRunConfig.codeLibName);
Log.i(TAG, "> Keystore: " + mRunConfig.keystore);
LogA.i(TAG, "Run() compiling and starting " + mRunConfig.app_package_name);
LogA.i(TAG, "> apkPath: " + mRunConfig.app_apk_file_path);
LogA.i(TAG, "> codeLibName: " + mRunConfig.codeLibName);
LogA.i(TAG, "> Keystore: " + mRunConfig.keystore);

try {
ArtistThread.checkThreadCancellation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import saarland.cispa.artist.artistgui.instrumentation.progress.ProgressPublisher;
import saarland.cispa.artist.artistgui.settings.config.ArtistConfigFactory;
import saarland.cispa.artist.artistgui.utils.ProcessExecutor;
import trikita.log.Log;
import saarland.cispa.utils.LogA;

class ServiceController implements IServiceController {

Expand Down Expand Up @@ -67,7 +67,7 @@ public void moveToForeground(Service service) {

@Override
public void instrument(String packageName) {
Log.d(TAG, String.format("instrument(%s)", packageName));
LogA.d(TAG, String.format("instrument(%s)", packageName));
InstrumentationTask task = createInstrumentationTask(packageName);
if (!mInstrumentationQueue.contains(task)) {
createOrRestartThreadPool();
Expand All @@ -90,7 +90,7 @@ private void createOrRestartThreadPool() {

@Override
public void cancel() {
Log.d(TAG, "cancel()");
LogA.d(TAG, "cancel()");
mInstrumentationQueue.clear();
if (mThreadPool != null) {
mThreadPool.shutdownNow();
Expand Down
Loading