• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Log类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: load

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
void load() {
    id = getIntent().getStringExtra("id");
    name = getIntent().getStringExtra("name");
    display_name = getIntent().getStringExtra("display_name");
    file_name = getIntent().getStringExtra("file_name");
    timeout = getIntent().getLongExtra("timeout", 0);
    Log.d(TAG, "id=" + id + " display_name=" + display_name + " file_name=" + file_name + " timeout=" + timeout);
    setContentView(R.layout.activity_question);
    initQuestionAnswer();
    if(questionAnswers==null || questionAnswers.questionAnswers==null || questionAnswers.questionAnswers.size()==0) {
        Toast.makeText(this, "Can't load file content", Toast.LENGTH_LONG).show();
        finish();
        return;
    }
    initInterviewState();
    initView();
    if(questionAnswers.questionAnswers.get(0).getPrompt_time()<=0) {
        questionAnswers.questionAnswers.get(0).setPrompt_time(DateTime.getDateTime());
        Log.d(TAG,"curPage=0 setprompttime");
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-EMA,代码行数:22,代码来源:ActivityInterview.java


示例17: updateUI

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
void updateUI() {
    if (iteration >= ITERATION) {
        editTextThought.setVisibility(View.GONE);
        textViewThoughtCorrectIncorrect.setVisibility(View.GONE);
        hideKeyboard();
        Log.d(TAG,"updateNext(true)");
        updateNext(true);
    } else {
        Log.d(TAG,"updateNext(false)");
        updateNext(false);
        if (editTextThought.isFocused())
            setEditTextFocused();
        else setEditTextNotFocused();

        textViewThoughtCorrectIncorrect.setText(EVENODD[iteration % ITERATION]);
        textViewThoughtCorrectIncorrect.setTextColor(iteration / 2 == 0 ? getResources().getColor(R.color.blue_400) : getResources().getColor(R.color.orange_600));
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-ThoughtShakeup,代码行数:19,代码来源:FragmentEditSpecial.java


示例18: connectDevice

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
private boolean connectDevice() {
    if (bandClient == null) return false;
    Log.d(TAG, "bandClient=" + bandClient);
    if (bandClient.getConnectionState() == ConnectionState.CONNECTED) return true;
    try {
        ConnectionState state = bandClient.connect().await();
        if (ConnectionState.CONNECTED == state) {
            versionFirmware = bandClient.getFirmwareVersion().await();
            versionHardware = bandClient.getHardwareVersion().await();
            Log.d(TAG, "versionFirmware=" + versionFirmware + " versionHardware=" + versionHardware);
            if (Integer.valueOf(versionHardware) <= 19)
                version = 1;
            else version = 2;
        }
        return ConnectionState.CONNECTED == state;
    } catch (Exception e) {
        if(bandClient.isConnected()) return true;
        Log.d(TAG, deviceId + " exception1");
        Log.d(TAG, deviceId + " ...connectDataKit");
        return false;
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-MicrosoftBand,代码行数:23,代码来源:Device.java


示例19: set

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
public void set() {
    Log.d(TAG, "set()...");
    Status curStatus;
    for (int i = 0; i < appInstallList.size(); i++)
        appInstallList.get(i).set();
    int total = size();
    int install = sizeInstalled();
    int update = sizeUpdate();
    int permissionNotApproved = sizePermissionNotApproved();
    if (update == 0 && permissionNotApproved == 0 && total == install)
        curStatus = new Status(rank, Status.SUCCESS);
    else if (total != install)
        curStatus = new Status(rank, Status.APP_NOT_INSTALLED);
    else if (update != 0)
        curStatus = new Status(rank, Status.APP_UPDATE_AVAILABLE);
    else
        curStatus = new Status(rank, Status.APP_PERMISSION_NOT_APPROVED);
    Log.d(TAG, "status = " + status.log() + " latestStatus=" + curStatus.log());
    notifyIfRequired(curStatus);
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-Study,代码行数:21,代码来源:AppInstallManager.java


示例20: onCreate

import org.md2k.utilities.Report.Log; //导入依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        try {
            packageName = getIntent().getStringExtra("package_name");
            permissionName = getIntent().getStringExtra("permission");
//            permissionName = "org.md2k.utilities.permission.ActivityPermission";
            Intent intent = new Intent();
            intent.setComponent(new ComponentName(packageName, permissionName));
            startActivityForResult(intent, PERMISSION_REQUEST);
        }catch (Exception e){
            Log.d(TAG,"ActivityPermissionGet()...packagename="+packageName+" permissionName="+permissionName+" ... exception");
            Intent sendIntent=new Intent("permission_data");
            sendIntent.putExtra("result", Status.SUCCESS);
//            sendIntent.putExtra("result", Status.APP_PERMISSION_NOT_APPROVED);
            LocalBroadcastManager.getInstance(this).sendBroadcast(sendIntent);
            finish();
        }
    }
 
开发者ID:MD2Korg,项目名称:mCerebrum-Study,代码行数:20,代码来源:ActivityPermissionGet.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AfterBurner类代码示例发布时间:2022-05-22
下一篇:
Java AppAttemptBlock类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap