Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

20150520 Extensionのログを取ろう 関モバ #2

2,751 views

Published on

関西モバイルアプリ研究会 #2
「Extensionのログを取ろう」の資料です

Published in: Software
  • DOWNLOAD FULL BOOKS INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

20150520 Extensionのログを取ろう 関モバ #2

  1. 1. Extensionの ログを取ろう 2015.5.20 関西モバイルアプリ研究会 #2 @itok_twit
  2. 2. @itok_twit • いとうけい(itok) • 公私共にプログラマ iOS / Mac(たまに Android や Windows) • http://itok.jp/ • 新しい名刺もらってください→
  3. 3. Extension側の ログを取り出したい 実機デバッグ用とか ユーザからのフィードバック用に
  4. 4. App Groupを使おう
  5. 5. 準備 App Group追加 プロジェクトに設定(Extension側も忘れずに)
  6. 6. Log用ライブラリ CocoaLumberjack XCGLogger Objective-C ○ Swift △ ○ ファイル出力 ○ ○ ファイルの ローテーション ○ 今日はこちらを
  7. 7. CocoaLumberjack // AppGroupが使用するパスを取得 NSURL* url = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier: @"group.jp.itok.GroupTest"]; url = [url URLByAppendingPathComponent:@"Library/Caches/Logs" isDirectory:YES]; // ログファイルの出力先に↑のディレクトリを指定 DDLogFileManagerDefault* mgr = [[DDLogFileManagerDefault alloc] initWithLogsDirectory:[url path]]; DDFileLogger* fileLogger = [[DDFileLogger alloc] initWithLogFileManager:mgr]; [DDLog addLogger:fileLogger]; // ログ出力 DDLogInfo(@"[app] launch"); App本体とExtension両方で同じ初期化を実行
  8. 8. ログ結果 Extensionのログ Bundle IDごとにログ出力 あとは自由に料理しましょう Appのログ

×