当前位置: 首页>>代码示例>>Java>>正文


Java Log类代码示例

本文整理汇总了Java中org.md2k.utilities.Report.Log的典型用法代码示例。如果您正苦于以下问题:Java Log类的具体用法?Java Log怎么用?Java Log使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Log类属于org.md2k.utilities.Report包,在下文中一共展示了Log类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
public void onCreate() {
    super.onCreate();
    isStopping = false;
    Log.d(TAG, "onCreate()");
    PermissionInfo permissionInfo = new PermissionInfo();
    permissionInfo.getPermissions(this, new ResultCallback<Boolean>() {
        @Override
        public void onResult(Boolean result) {
            if (!result) {
                Toast.makeText(getApplicationContext(), "!PERMISSION DENIED !!! Could not continue...", Toast.LENGTH_SHORT).show();
                stopSelf();
            } else {
                load();
            }
        }
    });
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-StreamProcessor,代码行数:18,代码来源:ServiceStreamProcessor.java

示例2: writeToDataKit

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
private boolean writeToDataKit() {
    try {
        DataKitAPI dataKitAPI = DataKitAPI.getInstance(modelManager.getContext());
        Log.d(TAG, "StudyInfoManager...writeToDataKit()");
        Gson gson = new Gson();
        JsonObject sample = new JsonParser().parse(gson.toJson(studyInfoFile)).getAsJsonObject();

        DataSourceClient dataSourceClient = dataKitAPI.register(createDataSourceBuilder());
        DataTypeJSONObject dataTypeJSONObject = new DataTypeJSONObject(DateTime.getDateTime(), sample);
        dataKitAPI.insert(dataSourceClient, dataTypeJSONObject);
        studyInfoDB = studyInfoFile;
        return true;
    } catch (DataKitException e) {
        LocalBroadcastManager.getInstance(modelManager.getContext()).sendBroadcast(new Intent(Constants.INTENT_RESTART));
        return false;
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-Study,代码行数:18,代码来源:StudyInfoManager.java

示例3: getIconFromApplication

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
private Drawable getIconFromApplication(String icon) {
    try {
        Drawable myIcon = Icon.get(context, icon, ContextCompat.getColor(context, R.color.teal_700), Icon.Size.MEDIUM);
        if (myIcon != null) return myIcon;
        Resources resources = context.getResources();
        Log.d(TAG, "icon=" + icon);
        int resourceId = resources.getIdentifier(icon, "drawable", context.getPackageName());
        if (resourceId != 0)
            return ContextCompat.getDrawable(context, resourceId);
        else {
            String path = Constants.CONFIG_DIRECTORY + icon;
            return Drawable.createFromPath(path);
        }
    }catch (Exception e){
        return null;
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-Study,代码行数:18,代码来源:AppAdapter.java

示例4: onCreateOptionsMenu

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    Log.d(TAG, "Activity -> onCreateOptionsMenu");
    getMenuInflater().inflate(R.menu.menu_exercise_prev_next, menu);
    menu.findItem(R.id.action_previous).setEnabled(mPager.getCurrentItem() > 0);

    // Add either a "next" or "finish" button to the action bar, depending on which page
    // is currently selected.
    MenuItem item = menu.add(Menu.NONE, R.id.action_next, Menu.NONE,
            (mPager.getCurrentItem() == mPagerAdapter.getCount() - 1)
                    ? "Finish"
                    : "Next");
    if (mPager.getCurrentItem() == mPagerAdapter.getCount() - 1)
        item.setTitle("Finish");
    else
        item.setTitle("Next");
    item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
    return super.onCreateOptionsMenu(menu);
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-ThoughtShakeup,代码行数:20,代码来源:ActivityExercise.java

示例5: handleMessage

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
@Override
public void handleMessage(Message incomingMessage) {
    Message outgoingMessage;
    if (messageController == null) {
        Log.d(TAG, "error...messageController=null");
        Bundle bundle = new Bundle();
        bundle.putParcelable(Status.class.getSimpleName(), new Status(Status.INTERNAL_ERROR));
        outgoingMessage = prepareMessage(bundle, incomingMessage.what);
    } else
        outgoingMessage = messageController.execute(incomingMessage);
    if (outgoingMessage != null) {
        replyTo = incomingMessage.replyTo;
        try {
            replyTo.send(outgoingMessage);
        } catch (RemoteException ignored) {
        }
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:19,代码来源:ServiceDataKit.java

示例6: AppServiceManager

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
public AppServiceManager(ModelManager modelManager, String id, int rank) {
    super(modelManager, id, rank);
    Log.d(TAG,"AppServiceManager="+this);
    appServiceList = new ArrayList<>();
    status=new Status(rank,Status.NOT_DEFINED);
    handler=new Handler();
    ArrayList<ConfigApp> apps = modelManager.getConfigManager().getConfig().getApps();
    boolean result=false;
    for (int i = 0; i < apps.size(); i++) {
        if (apps.get(i).getService() != null) {
            AppService appService = new AppService(modelManager.getContext(), apps.get(i).getName(), apps.get(i).getPackage_name(), apps.get(i).getService(), rank);
            appServiceList.add(appService);
            result |= appService.stop();
        }
    }
    if(result){
        try {
            Thread.sleep(2000);
        } catch (InterruptedException ignored) {
        }
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-Study,代码行数:23,代码来源:AppServiceManager.java

示例7: query

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
public synchronized ArrayList<DataType> query(SQLiteDatabase db, int ds_id, long starttimestamp, long endtimestamp) {
    long totalst = System.currentTimeMillis();
    insertDB(db, TABLE_NAME);
    Cursor mCursor;
    ArrayList<DataType> dataTypes = new ArrayList<>();
    String[] columns = new String[]{C_SAMPLE};
    String selection = prepareSelection();
    String[] selectionArgs = prepareSelectionArgs(ds_id, starttimestamp, endtimestamp);
    mCursor = db.query(TABLE_NAME,
            columns, selection, selectionArgs, null, null, null);
    if (mCursor.moveToFirst()) {
        do {
            try {
                dataTypes.add(fromBytes(mCursor.getBlob(mCursor.getColumnIndex(C_SAMPLE))));
            } catch (Exception e) {
                Log.e("DataKit", "Object failed deserialization");
                Log.e("DataKit", "DataSourceID: " + ds_id + " Row: " + mCursor.getLong(mCursor.getColumnIndex(C_ID)));
                e.printStackTrace();
            }
        } while (mCursor.moveToNext());
    }
    mCursor.close();

    return dataTypes;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:26,代码来源:DatabaseTable_Data.java

示例8: initView

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
void initView() {
//        openOptionsMenu();
        // Instantiate a ViewPager and a PagerAdapter.
        mPager = (NonSwipeableViewPager) findViewById(R.id.view_pager);
        mPagerAdapter = new ScreenSlidePagerAdapter(getFragmentManager());
        mPager.setAdapter(mPagerAdapter);
        mPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
            @Override
            public void onPageSelected(int position) {
                // When changing pages, reset the action bar actions since they are dependent
                // on which page is currently active. An alternative approach is to have each
                // fragment expose actions itself (rather than the activity exposing actions),
                // but for simplicity, the activity provides the actions in this sample.
                Log.d(TAG, "viewpager: onPageSelected: position=" + position);
                invalidateOptionsMenu();
            }
        });
    }
 
开发者ID:MD2Korg,项目名称:mCerebrum-EMA,代码行数:19,代码来源:ActivityInterview.java

示例9: querySyncedData

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
public synchronized ArrayList<RowObject> querySyncedData(SQLiteDatabase db, int ds_id, long ageLimit, int limit) {
    long totalst = System.currentTimeMillis();
    insertDB(db, TABLE_NAME);
    ArrayList<RowObject> rowObjects = new ArrayList<>(limit);
    String sql = "select _id, sample from data where cc_sync = 1 and datasource_id=" + Integer.toString(ds_id) + " and datetime <= " + ageLimit + " LIMIT " + Integer.toString(limit);
    Cursor mCursor = db.rawQuery(sql, null);
    if (mCursor.moveToFirst()) {
        do {
            try {
                DataType dt = fromBytes(mCursor.getBlob(mCursor.getColumnIndex(C_SAMPLE)));
                rowObjects.add(new RowObject(mCursor.getLong(mCursor.getColumnIndex(C_ID)), dt));
            } catch (Exception e) {
                Log.e("DataKit", "Object failed deserialization");
                Log.e("DataKit", "DataSourceID: " + ds_id + " Row: " + mCursor.getLong(mCursor.getColumnIndex(C_ID)));
                e.printStackTrace();
            }
        } while (mCursor.moveToNext());
    }
    mCursor.close();
    return rowObjects;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:22,代码来源:DatabaseTable_Data.java

示例10: onCreateView

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    final ViewGroup rootView = (ViewGroup) inflater
            .inflate(R.layout.fragment_screen_edit_special, container, false);
    initializeUI(rootView);
    setEditTextThought(rootView);
    layoutEditTextSpecial = (RelativeLayout) rootView.findViewById(R.id.layoutEditTextSpecial);
    textViewThoughtCorrectIncorrect = (TextView) rootView.findViewById(R.id.textViewThoughtCorrectIncorrect);
    for (int i = 0; i < question.getQuestion_responses_selected().size(); i++)
        addTextToBubble(i);
    iteration = question.getQuestion_responses_selected().size();
    Log.d(TAG, "onCreateView(): iteration=" + iteration);
    updateUI();
    return rootView;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-ThoughtShakeup,代码行数:17,代码来源:FragmentEditSpecial.java

示例11: onCreate

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    Log.d(TAG, "onCreate()");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_privacy);
    new PermissionInfo().getPermissions(this, new ResultCallback<Boolean>() {
        @Override
        public void onResult(Boolean result) {
            isPermission=result;
            if(isPermission==false)
                finish();

        }
    });
    getFragmentManager().beginTransaction().replace(R.id.layout_preference_fragment,
            new PrefsFragmentPrivacySettings()).commit();
    if (getSupportActionBar() != null)
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:20,代码来源:ActivityPrivacy.java

示例12: onCreate

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.d(TAG, "onCreate...");
    if(getActivity().getIntent().hasExtra("REMAINING_TIME")){
        remainingTime=getActivity().getIntent().getLongExtra("REMAINING_TIME",Long.MAX_VALUE);
    }else{
        remainingTime=Long.MAX_VALUE;
    }
    getPreferenceManager().getSharedPreferences().edit().clear().apply();
    privacyConfig=ConfigurationManager.getInstance(getActivity()).configuration.privacy;
    newPrivacyData=new PrivacyData();
    handler = new Handler();
    addPreferencesFromResource(R.xml.pref_privacy);
    try {
        privacyManager=PrivacyManager.getInstance(getActivity());
    } catch (IOException e) {
        e.printStackTrace();
    }
    setupButtonSaveCancel();
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:22,代码来源:PrefsFragmentPrivacySettings.java

示例13: setEditTextThought

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
void setEditTextThought(ViewGroup rootView) {
    editTextThought = (EditText) rootView.findViewById(R.id.editText_thought);
    editTextThought.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
                String response = editTextThought.getText().toString().trim();
                response = response.trim();
                question.getQuestion_responses_selected().clear();
                if (response.length() > 0) {
                    question.getQuestion_responses_selected().add(response);
                }
            }
            return false;
        }
    });
    editTextThought.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View view, boolean b) {
            Log.d(TAG, "Focus=" + b);
            if (b)
                setEditTextFocused();
            else setEditTextNotFocused();

        }
    });
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-ThoughtShakeup,代码行数:27,代码来源:FragmentEdit.java

示例14: run

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
@Override
public void run() {
    int dataQuality;
    Log.d(TAG, "lastReceivedTime=" + lastReceivedTimestamp);
    if (DateTime.getDateTime() - lastReceivedTimestamp > PERIOD)
        dataQuality = DATA_QUALITY.BAND_OFF;
    else if (lastBandContact != 0)
        dataQuality = DATA_QUALITY.NOT_WORN;
    else
        dataQuality = DATA_QUALITY.GOOD;

    DataTypeInt dataTypeInt = new DataTypeInt(DateTime.getDateTime(), dataQuality);
    Log.d(TAG, "DataQuality = " + dataQuality);
    sendDataStatus(dataTypeInt);
    callBack.onReceivedData(dataTypeInt);
    handler.postDelayed(this, PERIOD);
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-MicrosoftBand,代码行数:18,代码来源:DataQuality.java

示例15: getItem

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
@Override
public Fragment getItem(int position) {
    Log.d(TAG, "getItem(): position=" + position);
    if (questionAnswers.questionAnswers.get(position).getQuestion_type() == null)
        fragmentBase = FragmentMultipleChoiceSelect.create(position, id, file_name);

    else if (questionAnswers.questionAnswers.get(position).getQuestion_type().equals(Constants.MULTIPLE_CHOICE) ||
            questionAnswers.questionAnswers.get(position).getQuestion_type().equals(Constants.MULTIPLE_SELECT))
        fragmentBase = FragmentMultipleChoiceSelect.create(position, id, file_name);
    else if (questionAnswers.questionAnswers.get(position).getQuestion_type().equals(Constants.TEXT_NUMERIC))
        fragmentBase = FragmentTextNumeric.create(position, id, file_name);
    else if (questionAnswers.questionAnswers.get(position).getQuestion_type().equals(Constants.HOUR_MINUTE))
        fragmentBase = FragmentHourMinute.create(position, id, file_name);
    else if (questionAnswers.questionAnswers.get(position).getQuestion_type().equals(Constants.HOUR_MINUTE_AMPM))
        fragmentBase = FragmentHourMinuteAMPM.create(position, id, file_name);
    else if (questionAnswers.questionAnswers.get(position).getQuestion_type().equals(Constants.MINUTE_SECOND))
        fragmentBase = FragmentMinuteSecond.create(position, id, file_name);

    else {
        fragmentBase = FragmentMultipleChoiceSelect.create(position, id, file_name);
    }
    return fragmentBase;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-EMA,代码行数:24,代码来源:ActivityInterview.java


注:本文中的org.md2k.utilities.Report.Log类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。