phizclip-uniapp-demo/finclip-uniapp-test/nativeplugins/MopSdk/ios/FinApplet.framework/Headers/FATLogEngine.h

80 lines
2.1 KiB
C
Raw Normal View History

2022-06-08 11:57:35 +08:00
//
// FATLogEngine.h
// FATLog
//
// Created by HJH on 2021/1/8.
//
#import <Foundation/Foundation.h>
#import "FATLogger.h"
@class FATLoggerDriver;
@class FATLogFormatter;
typedef NS_ENUM(NSUInteger, FATLogFormatType) {
FATLogFormatTypeSystemLog = 0,
FATLogFormatTypeConsole, //暂时没用
FATLogFormatTypeFile,
};
typedef NS_ENUM(NSUInteger, FATLogType) {
FATLogTypeError = 0,
FATLogTypeWarning,
FATLogTypeInfo,
FATLogTypeDebug,
};
typedef NS_ENUM(NSUInteger, FATLogLevel) {
FATLogLevelOff = 0,
FATLogLevelError,
FATLogLevelWarning,
FATLogLevelInfo,
FATLogLevelDebug,
};
@protocol FATFormatable <NSObject>
- (NSString *)completeLogWithType:(FATLogType)type
tag:(NSString *)tag
message:(NSString *)message
timeInterval:(NSTimeInterval)timeInterval;
@end
@interface FATLogEngine : NSObject
- (void)addDriver:(FATLoggerDriver *)driver;
- (void)removeDriver:(FATLoggerDriver *)driver;
- (void)removeAllDrivers;
- (void)logWithType:(FATLogType)type tag:(NSString *)tag message:(NSString *)message timeInterval:(NSTimeInterval)timeInterval;
- (NSArray<FATLoggerDriver *> *)allDrivers;
@end
@interface FATLoggerDriver : NSObject
@property (strong, nonatomic) id<FATLogger> logger;
@property (strong, nonatomic) id<FATFormatable> formatter;
@property (assign, nonatomic) FATLogLevel level;
- (instancetype)initWithLogger:(id<FATLogger>)logger
formatter:(id<FATFormatable>)formatter
level:(FATLogLevel)level NS_DESIGNATED_INITIALIZER;
- (void)logWithType:(FATLogType)type tag:(NSString *)tag message:(NSString *)message timeInterval:(NSTimeInterval)timeInterval;
@end
@interface FATLogFormatter : NSObject <FATFormatable>
+ (instancetype)formatterWithType:(FATLogFormatType)type;
+ (instancetype)SystemLogFormatter;
+ (instancetype)ConsoleFormatter;
+ (instancetype)FileFormatter;
- (instancetype)initWithType:(FATLogFormatType)type;
@end
@interface FATDateFormatter : NSObject
+ (instancetype)sharedInstance;
- (NSString *)dateStringWithTimeInterval:(NSTimeInterval)timeInterval;
@end