本文整理汇总了Java中org.md2k.utilities.Report.Log.e方法的典型用法代码示例。如果您正苦于以下问题:Java Log.e方法的具体用法?Java Log.e怎么用?Java Log.e使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.md2k.utilities.Report.Log
的用法示例。
在下文中一共展示了Log.e方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: queryLastKey
import org.md2k.utilities.Report.Log; //导入方法依赖的package包/类
public synchronized ArrayList<RowObject> queryLastKey(SQLiteDatabase db, int ds_id, int limit) {
long totalst = System.currentTimeMillis();
insertDB(db, TABLE_NAME);
ArrayList<RowObject> rowObjects = new ArrayList<>();
String sql = "select _id, sample from data where cc_sync = 0 and datasource_id=" + Integer.toString(ds_id) + " 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;
}
示例3: 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;
}
示例4: run
import org.md2k.utilities.Report.Log; //导入方法依赖的package包/类
@Override
public void run() {
try {
curVibration++;
Log.d(TAG, "vibrate..." + curVibration + " repeat=" + notificationRequestVibration.getRepeat());
if (curVibration <= notificationRequestVibration.getRepeat()) {
bandClient.getNotificationManager().vibrate(VibrationType.ONE_TONE_HIGH).await();
handlerVibration.postDelayed(this, notificationRequestVibration.getDuration() / notificationRequestVibration.getRepeat());
}
} catch (InterruptedException | BandException e) {
Log.e(TAG, "ERROR=" + e.toString());
// handle InterruptedException
}
}
示例5: publishDataStream
import org.md2k.utilities.Report.Log; //导入方法依赖的package包/类
private void publishDataStream(DataSourceClient dsc, CCWebAPICalls ccWebAPICalls, AuthResponse ar, DataStream dsMetadata, DatabaseLogger dbLogger) {
Log.d("abc", "upload start... id=" + dsc.getDs_id() + " source=" + dsc.getDataSource().getType());
boolean cont = true;
int BLOCK_SIZE_LIMIT = Constants.DATA_BLOCK_SIZE_LIMIT;
long count = 0;
while (cont) {
cont = false;
//Computed Data Store
List<RowObject> objects;
objects = dbLogger.queryLastKey(dsc.getDs_id(), Constants.DATA_BLOCK_SIZE_LIMIT);
count = dbLogger.queryCount(dsc.getDs_id(), true).getSample();
if (objects.size() > 0) {
String outputTempFile = FileManager.getDirectory(context, FileManager.INTERNAL_SDCARD_PREFERRED) + "/upload_temp.gz";
File outputfile = new File(outputTempFile);
try {
FileOutputStream output = new FileOutputStream(outputfile, false);
Writer writer = new OutputStreamWriter(new GZIPOutputStream(output), "UTF-8");
for (RowObject obj : objects) {
writer.write(obj.csvString() + "\n");
}
writer.close();
output.close();
} catch (IOException e) {
Log.e("CerebralCortex", "Compressed file creation failed" + e);
e.printStackTrace();
return;
}
messenger("Offloading data: " + dsc.getDs_id() + "(Remaining: " + count + ")");
Boolean resultUpload = ccWebAPICalls.putArchiveDataAndMetadata(ar.getAccessToken().toString(), dsMetadata, outputTempFile);
if (resultUpload) {
dbLogger.setSyncedBit(dsc.getDs_id(), objects.get(objects.size() - 1).rowKey);
} else {
Log.e(TAG, "Error uploading file: " + outputTempFile + " for SQLite database dump");
return;
}
}
if (objects.size() == BLOCK_SIZE_LIMIT) {
cont = true;
}
}
Log.d("abc", "upload done... prune... id=" + dsc.getDs_id() + " source=" + dsc.getDataSource().getType());
}
示例6: publishDataFiles
import org.md2k.utilities.Report.Log; //导入方法依赖的package包/类
private void publishDataFiles(DataSourceClient dsc, CCWebAPICalls ccWebAPICalls, AuthResponse ar, DataStream dsMetadata) {
File directory = new File(raw_directory + "/raw" + dsc.getDs_id());
FilenameFilter ff = new FilenameFilter() {
@Override
public boolean accept(File dir, String filename) {
if (filename.contains("_archive") || filename.contains("_corrupt"))
return false;
return true;
}
};
File[] files = directory.listFiles(ff);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHH");
if (files != null) {
Arrays.sort(files);
for (File file : files) {
Long fileTimestamp = Long.valueOf(file.getName().substring(0, 10));
Long currentTimestamp = Long.valueOf(dateFormat.format(new Date()));
if (fileTimestamp < currentTimestamp) {
Log.d(TAG, file.getAbsolutePath());
Boolean resultUpload = ccWebAPICalls.putArchiveDataAndMetadata(ar.getAccessToken().toString(), dsMetadata, file.getAbsolutePath());
if (resultUpload) {
File newFile = new File(file.getAbsolutePath());
newFile.delete();
/*
File newFile = new File(file.getAbsolutePath().replace(".csv.gz", "_archive.csv.gz"));
if (file.renameTo(newFile)) {
Log.d(TAG, "Successfully renamed file: " + file.getAbsolutePath());
}
*/
} else {
Log.e(TAG, "Error uploading file: " + file.getName());
return;
}
}
}
}
}
示例7: unzip
import org.md2k.utilities.Report.Log; //导入方法依赖的package包/类
public static void unzip(String tempFileName, String destinationPath) {
try {
int index = destinationPath.lastIndexOf("/");
String fileString = destinationPath.substring(index);
File extFile = new File(fileString);
if (!extFile.exists()) {
createDir(extFile);
}
byte[] buffer = new byte[1024];
FileInputStream fin = new FileInputStream(tempFileName);
ZipInputStream zin = new ZipInputStream(fin);
ZipEntry zipentry = null;
if (!(zin.available() == 0)) {
while ((zipentry = zin.getNextEntry()) != null) {
String zipName = zipentry.getName();
if (zipName.startsWith("/")) {
zipName = zipentry.getName();
} else if (zipName.startsWith("\\")) {
zipName = zipentry.getName();
} else {
zipName = "/" + zipentry.getName();
}
String fileName = destinationPath + zipName;
fileName = fileName.replace("\\", "/");
fileName = fileName.replace("//", "/");
if (zipentry.isDirectory()) {
createDir(new File(fileName));
continue;
}
String name = zipentry.getName();
int start, end = 0;
while (true) {
start = name.indexOf('\\', end);
end = name.indexOf('\\', start + 1);
if (start > 0)
"check".toString();
if (end > start && end > -1 && start > -1) {
String dir = name.substring(1, end);
createDir(new File(destinationPath + '/' + dir));
// name = name.substring(end);
} else
break;
}
File file = new File(fileName);
FileOutputStream tempDexOut = new FileOutputStream(file);
int BytesRead = 0;
if (zipentry != null) {
if (zin != null) {
while ((BytesRead = zin.read(buffer)) != -1) {
tempDexOut.write(buffer, 0, BytesRead);
}
tempDexOut.flush();
tempDexOut.close();
}
}
}
}
} catch (Exception e) {
Log.e("Exception", e.getMessage());
}
}