Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Yet another simple logger
Kento Nagata
April 19, 2018
Technology
2
1.5k
Yet another simple logger
Kento Nagata
April 19, 2018
Tweet
Share
More Decks by Kento Nagata
See All by Kento Nagata
Generating Accessibility Identifiers Easily and Consistently Using Reflection API
ngtk
3
480
プロダクト改善の施策を提案できるようになろう! / Let's be able to propose measures for product growth!
ngtk
12
14k
施策提案ワークショップ / Measures creation workshop
ngtk
2
12k
Swift API Design learning from Cocoa API changes
ngtk
0
550
Page Object Pattern with XCUITest
ngtk
6
1.7k
Atomic Design の導入と実践プロセス
ngtk
4
1.5k
Share Xcode Templates with team
ngtk
2
930
Read the release note of Rails 5.2
ngtk
0
260
Readable RSpec
ngtk
1
270
Other Decks in Technology
See All in Technology
ログ基盤をCloudWatchLogからNewRelic Logs + S3に変えたら 利便性も上がってコストも下がった話
onohiroshi1
0
150
5分で分かるGoogle Playの新しいサブスクリプション / Google Play new subscription 2022
syarihu
0
180
トランザクションスクリプトはどこから来たのか トランザクションスクリプトは何者か トランザクションスクリプトはどこへ行くのか #sekkeinight
a_suenami
7
2.1k
データエンジニアリングの潮流を俯瞰する
tetsuroito
1
700
JJUG2022_spring_Keycloak (Red Hat Single Sign-on)
tinoue
0
190
コミュニティを育てて会社を変える
shimobayashi
0
1.1k
Build 2022で発表されたWindowsアプリ開発のあれこれ振り返ろう
hatsunea
1
350
モブに早く慣れたい人のためのガイド / A Guide to Getting Started Quickly with Mob Programming
cybozuinsideout
PRO
1
1.3k
OPENLOGI Company Profile
hr01
0
220
出張スクラムマスターとしての FEARLESS CHANGE な生き方
naitosatoshi
1
1.1k
データをモデリングしていたら、組織をモデリングし始めた話 / engineers-in-carta-vol3-data-engineer
pei0804
4
3.1k
覗いてみよう!現場のスクラムチーム
tkredman
0
930
Featured
See All Featured
Teambox: Starting and Learning
jrom
123
7.7k
Designing the Hi-DPI Web
ddemaree
272
32k
Atom: Resistance is Futile
akmur
255
20k
Unsuck your backbone
ammeep
659
55k
Art, The Web, and Tiny UX
lynnandtonic
280
17k
The Web Native Designer (August 2011)
paulrobertlloyd
74
1.9k
4 Signs Your Business is Dying
shpigford
169
20k
Writing Fast Ruby
sferik
612
57k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_i
23
15k
Testing 201, or: Great Expectations
jmmastey
21
5.4k
Bash Introduction
62gerente
597
210k
The Pragmatic Product Professional
lauravandoore
19
2.9k
Transcript
©2018 Wantedly, Inc. Yet another simple logger 19.Apr.2018 - @ngtk,
Kento Nagata
©2018 Wantedly, Inc. Ӭా݈ਓ 8BOUFEMZ *OD&OHJOFFS !OHULOU !OHUL • Wantedly
VisitͷΞϓϦΛ։ൃ͍ͯ͠·͢ • Swift/iOS։ൃΛ͡Ίͯ3ϲ݄͘Β͍ • ͱͱRailsͱ͔React/Reduxͱ͔Σϒͷ։ൃΛ͍ͬͯͨਓ • PotatotipsॳࢀՃ&ॳൃද ☺
©2018 Wantedly, Inc. XcodeͷConsole log׆༻͍ͯ͠·͔͢ʁ
©2018 Wantedly, Inc. ͳΔ͘σόοΨʔΛΘͣʹ ؆୯ʹΛղܾ͍ͨ͠
©2018 Wantedly, Inc. => ϩάΛ׆༻͢Δ
©2018 Wantedly, Inc. ͨͩɺݱঢ়ͷϩάػߏෆຬ͕͋Γ·ͨ͠
©2018 Wantedly, Inc. 1. SwiftͰprint͔͠ͳ͍ͨΊɺ ϥΠϒϥϦͷඪ४ग़ྗίϯτϩʔϧෆՄೳ 2. ϩάϨϕϧ͕ͳ͍ͨΊɺ ͱΓ͋͑ͣprintͰݟͮΒ͘ͳͬͯ͘Δ ϩάػߏͷෆຬ
©2018 Wantedly, Inc. ϥΠϒϥϦͰղܾ͢Δʁ
©2018 Wantedly, Inc. ϩΪϯάͷϥΠϒϥϦ ͍͔ͭ͋͘Γ·͢
©2018 Wantedly, Inc. Swiftybeaver
©2018 Wantedly, Inc. Pros • 3500 Star • ϩάϨϕϧʹରԠ (verbose,
debug, info, warning, error) • ϑΝΠϧίϯιʔϧग़ྗͳͲඪ४Ͱ๛ͳग़ྗઌΦϓγϣϯΛ͍࣋ͬͯΔ • ϩάϨϕϧΛϑΟϧλϦϯάͰ͖ΔΞϓϦ͕͋Δ • ඇಉظͰͷग़ྗʹରԠ͍ͯ͠Δ • ϑΥʔϚοτͷઃఆ Swiftbeaver
©2018 Wantedly, Inc. Cons • ΞϓϦͰจࣈྻΛίϐϖͰ͖ͳ͍ • ༗ྉͷϓϥοτϑΥʔϜ͕͋Γɺྑ͘ѱ͘ϩοΫΠϯ͞ΕΔՄೳੑ͋Γ • ֓Ͷྑ͍͚ͲɺΠϯλʔϑΣΠε͕ඍົͳͱ͜Ζ͕͋Δ
Swiftbeaver
©2018 Wantedly, Inc. ཉ͔ͬͨ͠ͷΛཧ͢Δ
©2018 Wantedly, Inc. 1. ใͷ༏ઌҙຯ͚Λ͢ΔͨΊɺ ϩάϨϕϧ͕΄͍͠ • ඞཁʹԠͯ͡ϑΟϧλϦϯάͯ͠ɺඞཁͳใʹ؆୯ʹΞΫηε͍ͨ͠ 2. ग़ྗઌΛมߋՄೳʹ͍ͨ͠
• ֎෦ʹ͍͛ͨέʔε͕͋Δ • ϑΝΠϧग़ྗͯ͠֎෦ͰϑΟϧλϦϯά͍ͨ͠ ཉ͔ͬͨ͠ͷ
©2018 Wantedly, Inc. 3. σόοάͱϦϦʔεͰڍಈΛ ม͑ΒΕΔΑ͏ʹ͍ͨ͠ • ϦϦʔεςετͰͳʹ͠ͳ͍ͳͲΓସ͍͑ͨ ཉ͔ͬͨ͠ͷ
©2018 Wantedly, Inc. ͜Ε͘Β͍ͩͬͨΒ ࣗͰ͔͚Δ͔ʁ
©2018 Wantedly, Inc. LoggerProtocol
©2018 Wantedly, Inc. LoggerProtocol extension
©2018 Wantedly, Inc. LogContextProtocol and LogContext
©2018 Wantedly, Inc. Logger
©2018 Wantedly, Inc. LogLevel
©2018 Wantedly, Inc. LogDestinationProtocol and StandardOut
©2018 Wantedly, Inc. LogFormatterProtocol
©2018 Wantedly, Inc. ͜͜·Ͱ͕ϥΠϒϥϦίʔυ
©2018 Wantedly, Inc. ϓϩμΫτίʔυͰ ग़ྗઌͱϑΥʔϚολʔΛࢦఆ͢Δ
©2018 Wantedly, Inc. LogDestinationProtocol and StandardOut
©2018 Wantedly, Inc. logger
©2018 Wantedly, Inc. Console output
©2018 Wantedly, Inc. ·ͱΊ
©2018 Wantedly, Inc. 1. γϯϓϧͰ͑ͦ͏ͳͷ͕Ͱ͖ͨ 2. ·࣮ͩݱͰ͖͍ͯͳ͍͜ͱ͋Δ • ඇಉظͷग़ྗ •
ϑΟϧλϦϯάͷγΣϧεΫϦϓτ 3. ຊSwiftͷΤίγεςϜશମͰΘΕΔͷ ͕΄͍͠ʂ ·ͱΊ