首次提交

This commit is contained in:
启星
2025-08-08 11:05:33 +08:00
parent 1b3bb91b4a
commit adc1a2a25d
8803 changed files with 708874 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>AgoraComponetLog.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>AgoraComponetLog.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>

View File

@@ -0,0 +1,23 @@
//
// AgoraComponetConsoleLogger.h
// AgoraComponetLogger
//
// Created by ZYP on 2023/12/6.
//
#import <Foundation/Foundation.h>
#import "AgoraComponetLogProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface AgoraComponetConsoleLogger : NSObject <AgoraComponetLogger>
- (instancetype)initWithDomainName:(NSString *)domainName;
- (void)onLogWithContent:(NSString *)content
tag:(NSString * _Nullable)tag
time:(NSString *)time
level:(AgoraComponetLoggerLevel)level;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,50 @@
//
// AgoraComponetFileLogger.h
// AgoraComponetLogger
//
// Created by ZYP on 2023/12/6.
//
#import <Foundation/Foundation.h>
#import "AgoraComponetLogProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface AgoraComponetFileLogger : NSObject <AgoraComponetLogger>
#pragma mark - public
/// init
/// - Parameters:
/// - logFilePath: custom file path, use default value if set nil
/// - filePrefixName: the prefixName of file, use default value if set nil
/// - maxFileSizeOfBytes: maxFileSize in every file
/// - maxFileCount: the number of file that save in local, no less than 2
/// - domainName: a flag of your domain
- (instancetype)initWithLogFilePath:(NSString * _Nullable)logFilePath
filePrefixName:(NSString * _Nullable)prefixName
maxFileSizeOfBytes:(uint64_t)maxFileSizeOfBytes
maxFileCount:(NSUInteger)maxFileCount
domainName:(NSString *)domainName;
- (instancetype)init __attribute__((unavailable("Use initWithLogFilePath instead")));
- (void)onLogWithContent:(NSString *)content
tag:(NSString * _Nullable)tag
time:(NSString *)time
level:(AgoraComponetLoggerLevel)level;
#pragma mark - only for unit test
/// ⚠️⚠️⚠️⚠️⚠️ this method only for unit test ⚠️⚠️⚠️⚠️⚠️
- (NSString *)makeFilePathAtNum:(NSUInteger)num;
/// ⚠️⚠️⚠️⚠️⚠️ this method only for unit test ⚠️⚠️⚠️⚠️⚠️
- (uint64_t)fileSizeWithPath:(NSString *)path;
/// ⚠️⚠️⚠️⚠️⚠️ this method only for unit test ⚠️⚠️⚠️⚠️⚠️
- (NSString *)getDefaultFilePath;
/// ⚠️⚠️⚠️⚠️⚠️ this method only for unit test ⚠️⚠️⚠️⚠️⚠️
- (instancetype)initWithLogFilePath:(NSString * _Nullable)logFilePath
filePrefixName:(NSString * _Nullable)prefixName
maxFileSizeOfBytes:(uint64_t)maxFileSizeOfBytes
maxFileCount:(NSUInteger)maxFileCount
domainName:(NSString *)domainName
internalLogSaveInFile:(BOOL)internalLogSaveInFile;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,20 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "AgoraComponetLog.h"
#import "AgoraComponetConsoleLogger.h"
#import "AgoraComponetFileLogger.h"
#import "AgoraComponetLogProtocol.h"
FOUNDATION_EXPORT double AgoraComponetLogVersionNumber;
FOUNDATION_EXPORT const unsigned char AgoraComponetLogVersionString[];

View File

@@ -0,0 +1,21 @@
//
// EntLogger.h
//
//
// Created by ZYP on 2023/9/25.
//
#import <Foundation/Foundation.h>
#import "AgoraComponetLogProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface AgoraComponetLog : NSObject
+ (void)setLoggers:(NSArray<id<AgoraComponetLogger>> *)loggers;
+ (void)errorWithText:(NSString *)text tag:(NSString * _Nullable)tag;
+ (void)infoWithText:(NSString *)text tag:(NSString * _Nullable)tag;
+ (void)debugWithText:(NSString *)text tag:(NSString * _Nullable)tag;
+ (void)warningWithText:(NSString *)text tag:(NSString * _Nullable)tag;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,26 @@
//
// AgoraComponetLogProtocol.h
// AgoraComponetLogger
//
// Created by ZYP on 2023/12/6.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, AgoraComponetLoggerLevel) {
AgoraComponetLoggerLevelDebug,
AgoraComponetLoggerLevelInfo,
AgoraComponetLoggerLevelWarning,
AgoraComponetLoggerLevelError
};
@protocol AgoraComponetLogger <NSObject>
- (void)onLogWithContent:(NSString *)content
tag:(NSString * _Nullable)tag
time:(NSString *)time
level:(AgoraComponetLoggerLevel)level;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,6 @@
framework module AgoraComponetLog {
umbrella header "AgoraComponetLog-umbrella.h"
export *
module * { export * }
}

View File

@@ -0,0 +1,23 @@
//
// AgoraComponetConsoleLogger.h
// AgoraComponetLogger
//
// Created by ZYP on 2023/12/6.
//
#import <Foundation/Foundation.h>
#import "AgoraComponetLogProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface AgoraComponetConsoleLogger : NSObject <AgoraComponetLogger>
- (instancetype)initWithDomainName:(NSString *)domainName;
- (void)onLogWithContent:(NSString *)content
tag:(NSString * _Nullable)tag
time:(NSString *)time
level:(AgoraComponetLoggerLevel)level;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,50 @@
//
// AgoraComponetFileLogger.h
// AgoraComponetLogger
//
// Created by ZYP on 2023/12/6.
//
#import <Foundation/Foundation.h>
#import "AgoraComponetLogProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface AgoraComponetFileLogger : NSObject <AgoraComponetLogger>
#pragma mark - public
/// init
/// - Parameters:
/// - logFilePath: custom file path, use default value if set nil
/// - filePrefixName: the prefixName of file, use default value if set nil
/// - maxFileSizeOfBytes: maxFileSize in every file
/// - maxFileCount: the number of file that save in local, no less than 2
/// - domainName: a flag of your domain
- (instancetype)initWithLogFilePath:(NSString * _Nullable)logFilePath
filePrefixName:(NSString * _Nullable)prefixName
maxFileSizeOfBytes:(uint64_t)maxFileSizeOfBytes
maxFileCount:(NSUInteger)maxFileCount
domainName:(NSString *)domainName;
- (instancetype)init __attribute__((unavailable("Use initWithLogFilePath instead")));
- (void)onLogWithContent:(NSString *)content
tag:(NSString * _Nullable)tag
time:(NSString *)time
level:(AgoraComponetLoggerLevel)level;
#pragma mark - only for unit test
/// ⚠️⚠️⚠️⚠️⚠️ this method only for unit test ⚠️⚠️⚠️⚠️⚠️
- (NSString *)makeFilePathAtNum:(NSUInteger)num;
/// ⚠️⚠️⚠️⚠️⚠️ this method only for unit test ⚠️⚠️⚠️⚠️⚠️
- (uint64_t)fileSizeWithPath:(NSString *)path;
/// ⚠️⚠️⚠️⚠️⚠️ this method only for unit test ⚠️⚠️⚠️⚠️⚠️
- (NSString *)getDefaultFilePath;
/// ⚠️⚠️⚠️⚠️⚠️ this method only for unit test ⚠️⚠️⚠️⚠️⚠️
- (instancetype)initWithLogFilePath:(NSString * _Nullable)logFilePath
filePrefixName:(NSString * _Nullable)prefixName
maxFileSizeOfBytes:(uint64_t)maxFileSizeOfBytes
maxFileCount:(NSUInteger)maxFileCount
domainName:(NSString *)domainName
internalLogSaveInFile:(BOOL)internalLogSaveInFile;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,20 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "AgoraComponetLog.h"
#import "AgoraComponetConsoleLogger.h"
#import "AgoraComponetFileLogger.h"
#import "AgoraComponetLogProtocol.h"
FOUNDATION_EXPORT double AgoraComponetLogVersionNumber;
FOUNDATION_EXPORT const unsigned char AgoraComponetLogVersionString[];

View File

@@ -0,0 +1,21 @@
//
// EntLogger.h
//
//
// Created by ZYP on 2023/9/25.
//
#import <Foundation/Foundation.h>
#import "AgoraComponetLogProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface AgoraComponetLog : NSObject
+ (void)setLoggers:(NSArray<id<AgoraComponetLogger>> *)loggers;
+ (void)errorWithText:(NSString *)text tag:(NSString * _Nullable)tag;
+ (void)infoWithText:(NSString *)text tag:(NSString * _Nullable)tag;
+ (void)debugWithText:(NSString *)text tag:(NSString * _Nullable)tag;
+ (void)warningWithText:(NSString *)text tag:(NSString * _Nullable)tag;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,26 @@
//
// AgoraComponetLogProtocol.h
// AgoraComponetLogger
//
// Created by ZYP on 2023/12/6.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, AgoraComponetLoggerLevel) {
AgoraComponetLoggerLevelDebug,
AgoraComponetLoggerLevelInfo,
AgoraComponetLoggerLevelWarning,
AgoraComponetLoggerLevelError
};
@protocol AgoraComponetLogger <NSObject>
- (void)onLogWithContent:(NSString *)content
tag:(NSString * _Nullable)tag
time:(NSString *)time
level:(AgoraComponetLoggerLevel)level;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,6 @@
framework module AgoraComponetLog {
umbrella header "AgoraComponetLog-umbrella.h"
export *
module * { export * }
}

View File

@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Headers/AgoraComponetConsoleLogger.h</key>
<data>
rWMMF7eepKvq4bytD0A0pl+hjfY=
</data>
<key>Headers/AgoraComponetFileLogger.h</key>
<data>
XEllTj96Qxxd98QpgLO4fg+xcdg=
</data>
<key>Headers/AgoraComponetLog-umbrella.h</key>
<data>
DsJrrf72ovk303sNjCk12VG1yzg=
</data>
<key>Headers/AgoraComponetLog.h</key>
<data>
8KQgQ3gq9X7+wuy97utf2ZXQ9LE=
</data>
<key>Headers/AgoraComponetLogProtocol.h</key>
<data>
WRlVBe2axNlbSz5zB+QP3Vz/t8E=
</data>
<key>Info.plist</key>
<data>
e0phcUDXjOANLNnFRrS38Wpa0us=
</data>
<key>Modules/module.modulemap</key>
<data>
LXEG0x9oCt6dS9fRXxMReAo+Dic=
</data>
</dict>
<key>files2</key>
<dict>
<key>Headers/AgoraComponetConsoleLogger.h</key>
<dict>
<key>hash</key>
<data>
rWMMF7eepKvq4bytD0A0pl+hjfY=
</data>
<key>hash2</key>
<data>
xK8qgtogNRO14mrR1X5vVFCRODsBbRY8v0En3oWhiXg=
</data>
</dict>
<key>Headers/AgoraComponetFileLogger.h</key>
<dict>
<key>hash</key>
<data>
XEllTj96Qxxd98QpgLO4fg+xcdg=
</data>
<key>hash2</key>
<data>
/14HA3jVCgpKCoTpAa3UU3vmiyMxIA4SYf4Ofph4eug=
</data>
</dict>
<key>Headers/AgoraComponetLog-umbrella.h</key>
<dict>
<key>hash</key>
<data>
DsJrrf72ovk303sNjCk12VG1yzg=
</data>
<key>hash2</key>
<data>
fAYleJZkYsXpblpGj7OLpWnV6DHxr0tHUiWc63macTU=
</data>
</dict>
<key>Headers/AgoraComponetLog.h</key>
<dict>
<key>hash</key>
<data>
8KQgQ3gq9X7+wuy97utf2ZXQ9LE=
</data>
<key>hash2</key>
<data>
QsOLVqldhK2nYn9QOnsONSqOG001+uuYqY9deiFAUWQ=
</data>
</dict>
<key>Headers/AgoraComponetLogProtocol.h</key>
<dict>
<key>hash</key>
<data>
WRlVBe2axNlbSz5zB+QP3Vz/t8E=
</data>
<key>hash2</key>
<data>
WV2H+iP0zzAkCd5SBqs7JyV5Xvwq3+jnpj1idCNOI7g=
</data>
</dict>
<key>Modules/module.modulemap</key>
<dict>
<key>hash</key>
<data>
LXEG0x9oCt6dS9fRXxMReAo+Dic=
</data>
<key>hash2</key>
<data>
xME0ypa+p7dIZXpZwaBGW+qdbeafvhs/byLaPlhX5o8=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>