GCKLogger 类
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
供框架用于日志记录的单例对象。
如果分配了委托,则格式化的日志消息会传递给委托。否则,消息会在调试 build 中使用 NSLog() 写入,并在其他情况下被舍弃。
如需查看委托协议,请参阅 GCKLoggerDelegate。
此类继承 NSObject。
- (void) logFromFunction: |
|
(const char *) |
function |
message: |
|
(NSString *) |
format |
, |
|
|
... |
|
|
| |
记录消息。
- Parameters
-
function | The calling function, normally __func__ . |
format | The format string. |
用于启用或停用日志记录的标志。
默认处于开启状态。
- 开始时间
- 3.0
- (BOOL) fileLoggingEnabled |
|
readwritenonatomicassign |
用于启用或停用文件日志记录的标志。
默认处于关闭状态。
- 开始时间
- 3.1
- (NSUInteger) maxLogFileSize |
|
readwritenonatomicassign |
日志文件的大小上限(以字节为单位)。
最小值为 32 KiB。如果值为 0,则会使用默认的最大大小 2 MiB。
- 开始时间
- 3.1
- (NSUInteger) maxLogFileCount |
|
readwritenonatomicassign |
日志文件的最大数量。
最小值为 2。
- 开始时间
- 3.1
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eGCKLogger is a singleton object used for logging within the framework, using NSLog() in debug builds or a delegate if assigned.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to log messages, control logging levels, and configure file logging.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize logging behavior by setting a delegate, filter, and minimum logging level.\u003c/p\u003e\n"],["\u003cp\u003eGCKLogger provides properties to enable/disable logging, control file logging size and count.\u003c/p\u003e\n"]]],["The GCKLogger, a singleton object, manages framework logging. It directs formatted log messages to a delegate or uses NSLog() in debug builds. Key actions include retrieving the singleton instance via `sharedInstance`, and logging messages using `logFromFunction:message:`. Properties control logging behavior: `delegate`, `filter`, `loggingEnabled`, `fileLoggingEnabled`, `maxLogFileSize`, `maxLogFileCount`, and `minimumLevel`. These allow setting a message receiver, applying a filter, enabling/disabling logging, managing file logging, setting log file limits, and setting the minimum logging level.\n"],null,[]]