Log process ID

This commit is contained in:
M66B 2021-01-22 17:34:50 +01:00
parent b71f8a0246
commit 05f11818bf
4 changed files with 12 additions and 4 deletions

View File

@ -78,7 +78,8 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
@Override
protected void onCreate(Bundle savedInstanceState) {
EntityLog.log(this, "Activity create " + this.getClass().getName() +
" version=" + BuildConfig.VERSION_NAME);
" version=" + BuildConfig.VERSION_NAME +
" process=" + android.os.Process.myPid());
Intent intent = getIntent();
if (intent != null)
EntityLog.log(this, intent +

View File

@ -78,7 +78,10 @@ public class ApplicationEx extends Application
super.onCreate();
long start = new Date().getTime();
Log.logMemory(this, "App create version=" + BuildConfig.VERSION_NAME);
EntityLog.log(this, "App create" +
" version=" + BuildConfig.VERSION_NAME +
" process=" + android.os.Process.myPid());
Log.logMemory(this, "App");
getMainLooper().setMessageLogging(new Printer() {
@Override

View File

@ -157,7 +157,9 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
@Override
public void onCreate() {
EntityLog.log(this, "Service create version=" + BuildConfig.VERSION_NAME);
EntityLog.log(this, "Service create" +
" version=" + BuildConfig.VERSION_NAME +
" process=" + android.os.Process.myPid());
super.onCreate();
if (isBackgroundService(this))

View File

@ -63,7 +63,9 @@ public class WorkerCleanup extends Worker {
@NonNull
@Override
public Result doWork() {
Log.i("Running " + getName());
EntityLog.log(getApplicationContext(),
"Running " + getName() +
" process=" + android.os.Process.myPid());
Thread.currentThread().setPriority(THREAD_PRIORITY_BACKGROUND);
cleanup(getApplicationContext(), false);