Latest 1.1.0
Homepage https://github.com/BaHui/BHLogFactory
License LICENSE
Platforms ios 7.0, requires ARC
Frameworks Foundation
Authors

使用Pod导入

pod ‘BHLogFactory’, ‘~> 1.1.0’

提示: 利用Runtime, 无需导入如何头文件到项目中;


简介

BHLogFactory 是为了处理控制台打印的中文被unicode编码 。产生类似于 U7ea2U5305U96e8U6d3bU52a8的unicode编码 , 不利于开发的调试 ; 所以, 使用这个工具, 可以将我们不易识别的unicode编码转换为具备可读性的中文.

实现原理: 分别对NSArrayNSDictionary方法进行类别方法重写, 如下

// NSArray (Log)
- (NSString *)debugDescription;
- (NSString *)description;
- (NSString *)descriptionWithLocale:(id)locale;

// NSDictionary (Log)
- (NSString *)debugDescription;
- (NSString *)description;
- (NSString *)descriptionWithLocale:(id)locale
使用前:
{ "create_time" = "2018-08-21 15:03:01";
  "week_time" = "08-21 U661fU671fU4e8c";
}
-------------------
使用后:
{ "create_time" = "2018-08-21 15:03:01";
  "week_time" = "08-21 星期二";
}

交流与建议

Latest podspec

{
    "name": "BHLogFactory",
    "version": "1.1.0",
    "summary": "Format Log Description and DebugDescription !",
    "homepage": "https://github.com/BaHui/BHLogFactory",
    "authors": {
        "BaHuiu00b7Qiao": "[email protected]"
    },
    "license": "LICENSE",
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/BaHui/BHLogFactory.git",
        "tag": "v1.1.0"
    },
    "source_files": [
        "BHLogFactory",
        "BHLogFactory/**/*.{h,m}"
    ],
    "frameworks": "Foundation",
    "requires_arc": true
}

Pin It on Pinterest

Share This