Improved logging

This commit is contained in:
M66B
2018-09-04 05:49:58 +00:00
parent de266b1cde
commit 4802a8b2c8
5 changed files with 50 additions and 22 deletions

View File

@@ -28,8 +28,15 @@ import androidx.room.Query;
@Dao
public interface DaoLog {
@Query("SELECT * FROM log ORDER BY time DESC LIMIT 500")
LiveData<List<EntityLog>> liveLogs();
@Query("SELECT * FROM log" +
" WHERE time > :from" +
" ORDER BY time DESC")
LiveData<List<EntityLog>> liveLogs(long from);
@Query("SELECT * FROM log" +
" WHERE time > :from" +
" ORDER BY time DESC")
List<EntityLog> getLogs(long from);
@Insert
long insertLog(EntityLog log);