Service | Cocoapods Pod Name | Framework | Dependency | Build Settings |
---|---|---|---|---|
Log & Crash | NHNCloudLogger | NHNCloudLogger.framework | [External & Optional] * CrashReporter.framework (NHNCloud) |
|
Mandatory | NHNCloudCore NHNCloudCommon |
NHNCloudCore.framework NHNCloudCommon.framework |
OTHER_LDFLAGS = ( "-ObjC", "-lc++" ); |
platform :ios, '11.0'
use_frameworks!
target '{YOUR PROJECT TARGET NAME}' do
pod 'NHNCloudLogger'
end
Add -lc++ and -ObjC to Other Linker Flags at Build Settings.
To directly download or build CrashReporter.framework, the Bitcode at Build Settings must be changed to NO.
CrashReporter.framework downloaded from Downloads of NHN Cloud supports bitCode.
if [ "${CONFIGURATION}" = "Debug" ]; then
${PODS_ROOT}/NHNCloudSymbolUploader/nhncloud.ios.sdk-*/run --app-key LOG_N_CRASH_SEARCH_DEV_APPKEY
fi
USAGE: symbol-uploader -ak <ak> -pv <pv> [-sz <sz>] <path> [--verbose]
ARGUMENTS:
<path> dSYM file path is must be entered.
OPTIONS:
-ak, --app-key <ak> [Log & Crash Search]'s AppKey must be entered.
-pv, --project-version <pv>
Project version must be entered.
-sz, --service-zone <sz>
You can choose between real, alpha, and demo. (default: real)
--verbose Show more debugging information
-h, --help Show help information.
./SymbolUploader --app-key {APP_KEY} --project-version {CFBundleShortVersionString || MARKETING_VERSION} {symbol path(~/Project.dSYM)}
If a symbol with the same version has already been uploaded, SymbolUploader removes the uploaded symbol and performs uploading.
At this time, if the filenames of the two symbol files are different, the uploaded symbol will not be removed. You need to remove the uploaded symbol from the Log & Crash Search console. https://console.nhncloud.com/-> Select Organization -> Select Project -> Anaytics -> Log & Crash Search -> Settings -> Symbol Files
// Initialize
+ (void)initWithConfiguration:(NHNCloudLoggerConfiguration *)configuration;
NHNCloudLoggerConfiguration *configuration = [NHNCloudLoggerConfiguration configurationWithAppKey:@"YOUR_APP_KEY"];
[NHNCloudLogger initWithConfiguration:configuration];
// DEBUG level log
+ (void)debug:(NSString *)message;
// INFO level log
+ (void)info:(NSString *)message;
// WARN level log
+ (void)warn:(NSString *)message;
// ERROR level log
+ (void)error:(NSString *)message;
// FATAL level log
+ (void)fatal:(NSString *)message;
[NHNCloudLogger info:@"NHN Cloud Log & Crash Search!"];
// Add User-Defined Field
+ (void)setUserFieldWithValue:(NSString *)value forKey:(NSString *)key;
// Add User-Defined Field
[NHNCloudLogger setUserFieldWithValue:@"USER_VALUE" forKey:@"USER_KEY"];
If the User ID is set, you can check the user-specific crash experience in the 'Crash User' section of the Log & Crash Search console. User ID setting can be checked in Getting Started.
// CrashReporter Enable Configuration
NHNCloudLoggerConfiguration *configuration = [NHNCloudLoggerConfiguration configurationWithAppKey:@"YOUR_APP_KEY" enableCrashReporter:YES];
[NHNCloudLogger initWithConfiguration:configuration];
// CrashReporter Disable Configuration
NHNCloudLoggerConfiguration *configuration = [NHNCloudLoggerConfiguration configurationWithAppKey:@"YOUR_APP_KEY" enableCrashReporter:NO];
[NHNCloudLogger initWithConfiguration:configuration];
+ (void)setShouldReportCrashHandler:(void (^)(void))handler;
[NHNCloudLogger setShouldReportCrashHandler:^{
//Send, via user-defined field, wanted information from crash occurrence
// Add User-Defined Field
[NHNCloudLogger setUserFieldWithValue:@"USER_VALUE" forKey:@"USER_KEY"];
}];
+ (void)setDelegate:(id<NHNCloudLoggerDelegate>) delegate;
@protocol NHNCloudLoggerDelegate <NSObject>
@optional
// Sending logs succeeded
- (void)nhnCloudLogDidSuccess:(NHNCloudLog *)log;
// Sending logs failed
- (void)nhnCloudLogDidFail:(NHNCloudLog *)log error:(NSError *)error;
// Save within SDK for re-sending if log-sending fails due to network errors
- (void)nhnCloudLogDidSave:(NHNCloudLog *)log;
// Filter by filter setting
- (void)nhnCloudLogDidFilter:(NHNCloudLog *)log logFilter:(NHNCloudLogFilter *)logFilter;
@end
#import <NHNCloudLogger/NHNCloudLogger.h>
@interface AppDelegate () <UIApplicationDelegate, NHNCloudLoggerLoggerDelegate>
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// ...
// Initialize
NHNCloudLoggerConfiguration *configuration = [NHNCloudLoggerConfiguration configurationWithAppKey:@"YOUR_APP_KEY" enableCrashReporter:YES];
[NHNCloudLogger initWithConfiguration:configuration];
// Set Delegate
[[NHNCloudLogger setDelegate:self];
return YES;
}
#pragma mark - NHNCloudLoggerDelegate
// Sending logs succeeded
- (void)nhnCloudLogDidSuccess:(NHNCloudLog *)log {
// ...
}
// Sending logs failed
- (void)nhnCloudLogDidFail:(NHNCloudLog *)log error:(NSError *)error {
// ...
}
// Save within SDK for re-sending if log-sending fails due to network errors
- (void)nhnCloudLogDidSave:(NHNCloudLog *)log {
// ...
}
// Filter by filter setting
- (void)nhnCloudLogDidFilter:(NHNCloudLog *)log logFilter:(NHNCloudLogFilter *)logFilter {
// ...
}
@end
With Network Insights enabled in console, it is requested for one time via URL registered in the console when NHN Cloud Logger is initialized.
typedef NS_ENUM(NSInteger, NHNCloudEnvironment) {
NHNCloudEnvironmentPublic = 0,
NHNCloudEnvironmentGovernment = 1,
};
@property (nonatomic) NHNCloudEnvironment cloudEnvironment;
NHNCloudEnvironmentPublic
. NHNCloudLoggerConfiguration *configuration = [NHNCloudLoggerConfiguration configurationWithAppKey:@"YOUR_APP_KEY"];
[configuration setCloudEnvironment:NHNCloudEnvironmentGovernment];
[NHNCloudLogger initWithConfiguration:configuration];