PdLogPlatform class abstract

平台接口定义:各平台需实现此接口以接收日志与提供平台信息。

Inheritance
  • Object
  • PlatformInterface
  • PdLogPlatform
Implementers

Constructors

PdLogPlatform.new()
构造函数。

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

configureFileLogging({required bool enabled, int? flushIntervalMs, int? maxBufferEntries, int? maxBufferBytes}) Future<void>
配置原生文件日志系统。
deleteAllLogs() Future<int>
删除所有日志文件(不一定删除空目录)。 返回删除的文件数量。
deleteLogFile(String path) Future<bool>
删除指定路径的日志文件。
flushLogs() Future<void>
请求原生侧立即刷新缓冲区到磁盘,确保日志不丢失。
getLogRootPath() Future<String?>
获取日志根目录路径(由各平台原生实现决定)。
getPlatformVersion() Future<String?>
获取平台版本信息。
listLogFiles() Future<List<Map<String, dynamic>>>
列出所有日志文件及其元信息(路径、大小、修改时间)。
listYearFolders() Future<List<String>>
列出日志根目录下的一级年份目录(不递归子级)。 返回年份目录的绝对路径字符串列表,例如 ["/.../pd_log/2024", "/.../pd_log/2025"]
log({required String level, required String message, String? tag, bool printToConsole = true, bool writeToFile = true}) Future<void>
发送日志到原生平台(可选)。
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance PdLogPlatform
当前使用的默认实现。
getter/setter pair