PlainApp
API 參考

應用程式日誌

透過 app.capabilities 判斷功能支援,透過 app.access 和主機權限判斷存取授權。範例使用合成值;呼叫前請替換路徑、ID、輸入和篩選條件。

型別定義

graphql
type Mutation {
  clearAppLogs: Boolean!
  exportAppLogs: String
}

type Query {
  appLogFilesSize: Long!
  appLogPath: String!
  appLogs(query: String!, offset: Int!, limit: Int!): [String!]!
}

scalar Long

操作

mutation

clearAppLogs

清理應用程式日誌檔案;遠端呼叫需要開發人員模式。

graphql
mutation clearAppLogs {
  clearAppLogs
}
mutation

exportAppLogs

將應用程式日誌匯出為歸檔檔案,可用時回傳路徑;遠端呼叫需要開發人員模式。

graphql
mutation exportAppLogs {
  exportAppLogs
}
query

appLogFilesSize

讀取應用程式日誌檔案的總位元組數;遠端呼叫需要開發人員模式。

graphql
query appLogFilesSize {
  appLogFilesSize
}
query

appLogPath

讀取目前應用程式日誌路徑;遠端呼叫需要開發人員模式。

graphql
query appLogPath {
  appLogPath
}
query

appLogs

分頁讀取或搜尋應用程式日誌行,最新記錄在前;遠端呼叫需要開發人員模式。

graphql
# Log lines, newest first. A blank `query` pages the buffer directly;
# a non-blank one filters the whole buffer and then pages, so a
# search cannot be cut short by the page size.
query appLogs($query: String!, $offset: Int!, $limit: Int!) {
  appLogs(query: $query, offset: $offset, limit: $limit)
}