DebugMenu 0.0.1

DebugMenu 0.0.1

s1ddok 维护。



DebugMenu 0.0.1

DebugMenu

一个具有增强日志记录、网络信息和崩溃报告等功能的 In-App iOS 调试工具。

Platform iOS

License MIT

适用于 iOS 开发者的调试工具。显示使用应用程序时的 日志网络请求设备信息崩溃日志。通过 其气泡图标按钮 容易访问。🔘。易于集成到任何应用程序中,更轻松地处理开发或测试应用程序。第一版,有大量改进的空间。


用法

AppDelegate 中实例化 DebugMenu 管理器。请注意,仅将 DebugMenu 用于开发目的。

   func application(_ application: UIApplication,
   didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        #if DEBUG
            DebugMenu.sharedManager.enable()
        #endif
        return true
   }

日志

DebugMenu 覆盖了 print,因此您可以使用它并查看日志。否则,您可以添加级别,并获取更多日志的详细信息(文件和行)。使用框架提供的 Logger 类。在徽章上获取新日志的数量,或在气泡图标上收到 警告/错误 通知。

print("logs")
Logger.verbose("some logs")
Logger.info("infos")
Logger.warning("warning ! ⚠️")
Logger.error("error ❌")

网络

DebugMenu 使用 URLProcessor 记录请求。您可以在自定义的 URLSessionConfiguration 中添加记录器。它与 AlamofireURLSession.shared 都兼容。您可以在设置界面中禁用网络记录。当请求启动时,您将收到通知。🚀,当请求启动时。

//Your custom configuration
let configuration = URLSessionConfiguration.default

///Add the network logger on the configuration
DebugMenu.sharedManager.addLogger(session: configuration)

//Use it:
//For Alamofire
let sessionManager = Alamofire.SessionManager(configuration: configuration)

//For URLSession
let session = URLSession(configuration: configuration)

安装

CocoaPods

您可以使用 CocoaPods 在您的 Podfile 中添加 DebugMenu 来安装它。

platform :ios, '9.0'
use_frameworks!
pod 'DebugMenu'

手动

将源文件拖入您的项目。

联系方式

许可证

DebugMenu 在 MIT 许可证 下发布。