Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ロギング
Search
Jamie Birch
June 25, 2025
Technology
0
8
ロギング
I gave this lightning talk at
React Native Meetup #22
.
Jamie Birch
June 25, 2025
Tweet
Share
More Decks by Jamie Birch
See All by Jamie Birch
View Transition API
shirakaba
1
1.5k
ビルド・プロファイリング
shirakaba
0
26
Build profiling
shirakaba
0
53
React Native, Meet Node.js native addons
shirakaba
0
18
Expo Prebuild, Demystified
shirakaba
0
33
A History of JavaScript on Mobile
shirakaba
0
730
SvelteでMacアプリを作りましょう!
shirakaba
0
100
Hello, NativeScript
shirakaba
0
160
最後のネイティブ・モジュール
shirakaba
0
69
Other Decks in Technology
See All in Technology
開発者を支える Internal Developer Portal のイマとコレカラ / To-day and To-morrow of Internal Developer Portals: Supporting Developers
aoto
PRO
1
440
5分でカオスエンジニアリングを分かった気になろう
pandayumi
0
210
企業の生成AIガバナンスにおけるエージェントとセキュリティ
lycorptech_jp
PRO
2
160
「全員プロダクトマネージャー」を実現する、Cursorによる仕様検討の自動運転
applism118
19
9k
おやつは300円まで!の最適化を模索してみた
techtekt
PRO
0
290
新アイテムをどう使っていくか?みんなであーだこーだ言ってみよう / 20250911-rpi-jam-tokyo
akkiesoft
0
160
EncryptedSharedPreferences が deprecated になっちゃった!どうしよう! / Oh no! EncryptedSharedPreferences has been deprecated! What should I do?
yanzm
0
200
2025年夏 コーディングエージェントを統べる者
nwiizo
0
140
CDK CLIで使ってたあの機能、CDK Toolkit Libraryではどうやるの?
smt7174
4
120
AI開発ツールCreateがAnythingになったよ
tendasato
0
120
S3アクセス制御の設計ポイント
tommy0124
3
190
Webブラウザ向け動画配信プレイヤーの 大規模リプレイスから得た知見と学び
yud0uhu
0
230
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Making the Leap to Tech Lead
cromwellryan
135
9.5k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Bash Introduction
62gerente
615
210k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Done Done
chrislema
185
16k
Automating Front-end Workflow
addyosmani
1370
200k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.6k
A Modern Web Designer's Workflow
chriscoyier
696
190k
Embracing the Ebb and Flow
colly
87
4.8k
For a Future-Friendly Web
brad_frost
180
9.9k
Gamification - CAS2011
davidbonilla
81
5.4k
Transcript
ϩΪϯά Jamie Birch δΣΠϛʔ ό ʔ ν ໊ බ
React Native ͷϩΪϯά͕Γͳ͍ w w w w
ୈҰͷྫ ΦϒδΣΫτɾϩΪϯά
const result = hoge(); // ᶃ ίϯιʔϧ console.log(result); // ᶄ
όοΫΤϯυ fetch('https://ore-no-backend.jp', { method: 'POST', body: `${result}`, }); 192.168.1.1 - - 200 POST / [object Object] (NOBRIDGE) LOG {"1": {"2": {"3": [Object]}}}
ཧͳΞτϓοτ {"1": {"2": {"3": { "4": 1234}}}} ᶃ Χϥʔ ᶄ
ೖΕࢠʹ͞ΕͨཁૉΛද͢
ୈೋͷྫ ΤϥʔɾϩΪϯά
try { hoge(); } catch (error) { // ᶃ ίϯιʔϧ
console.error(error); // ᶄ όοΫΤϯυ fetch('https://ore-no-backend.jp', { method: 'POST', body: `${error}`, }); } 192.168.1.1 - - 200 POST / Error hoge (NOBRIDGE) ERROR [Error: hoge]
Error: hoge at file:///Users/shirakaba/demo.js:4:23 at ModuleJob.run (node:internal/modules/esm/module_job:274:25) at async onImport.tracePromise.__proto__
(node:internal/modules/esm/loader:644:26) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) { [cause]: Error: fuga at file:///Users/shirakaba/demo.js:4:51 at ModuleJob.run (node:internal/modules/esm/module_job:274:25) at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) } ཧͳΞτϓοτ ᶃ ελοΫτϨʔε ᶄ ݪҼ
JSON.stringify() Λ͑ʁ
JSON.stringify() ͷऑ console.log(JSON.stringify(error)); (NOBRIDGE) LOG {} const hoge = {
fuga: {} }; hoge.fuga = hoge; console.log(JSON.stringify(hoge)); (NOBRIDGE) ERROR [TypeError: cyclical structure in JSON object]
͡ΌɺͲ͏͢Ε͍͍͔ʁ
util.inspect() Λհ͠Α͏ • import { inspect } from 'node:util';
Node.js ͷίΞϞδϡʔϧɻ • σʔλܕΛέʔεόΠέʔεͰจࣈྻʹγϦΞϥΠζ͢ΔͨΊͷͷɻ • ԿͰରԠͰ͖Δʂ • React Native Ͱ͑Δͱ͍͍ͳ…
ˎ5000ߦҎ্ͷίʔυ Λநग़ͨ͠
import { inspect } from "util-inspect-isomorphic"; // ⭐ error.causeΛγϦΞϥΠζ͢Δ ⭐
console.error(inspect(new Error("hoge", { cause: new Error("fuga") }))); // Error: hoge // at file:///Users/shirakaba/demo.js:4:23 // at ModuleJob.run (node:internal/modules/esm/module_job:274:25) // at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26) // at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) { // [cause]: Error: fuga // at file:///Users/shirakaba/demo.js:4:51 // at ModuleJob.run (node:internal/modules/esm/module_job:274:25) // at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26) // at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) // } // ⭐ ਂ͘ωετͨ͠ΦϒδΣΫτΛϓϦϯτ͢Δ ⭐ console.log(inspect({ a: { b: { c: { d: {} } } } }, { depth: null })); // { // a: { b: { c: { d: {} } } } // } // ⭐ ΧϥʔΛ͚Δ ⭐ console.log(inspect(["hoge", new Date(), true], { colors: true })); // [ 'hoge', 2025-06-07T11:35:11.755Z, true ] // ⭐ φϯόʔʹΞϯμʔείΞΛ͚Δ ⭐ console.log(inspect(1000000000, { numericSeparator: true })); // 1_000_000_000
݁ • σʔλܕΛదʹϩάग़ྗ͢ΔʹɺέʔεόΠέʔεͰରԠ͕ඞཁɻ • React Native Ͱ error.cause Λϩάʹग़ͤͳ͍ͨΊɺ΄ͱΜͲΘΕͯ ͍ͳ͍ͣɻ
• util-inspect-isomorphic Λ͏ͱɺԿͷσʔλܕͰରԠͰ͖Δɻ
ϓϩϑΟϧ ౦ژ ͷΤϯδχΞ @shirakaba @birch_js @shirakaba.bsky.social ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ Jamie Birch δΣΠϛʔ
ό ʔ ν ໊ බ