5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Emojiでログをたのしく探しやすく

Posted at

従来のログ

CocoaLumberjackなどでXcodeのconsole logを見やすくするのは一般的です。

いわゆるログのレベルに応じて、行に色を付けるカラーログの形式です。
これは、ぱっと見でログの種類がわかりやすいという実用的なメリットが存在します。

絵文字ログ

絵文字ログでは、ログのlevelに応じて、絵文字を設定します。
例えば以下のように。

level emoji
error 🍣
warn 🍺
info 🍀
debug 🐳
verbose 🍙

絵柄はログの色のイメージになんなく合わせています。

emoji_log.png

表示してみるとこんな感じ。

メリット

なにいってんだこいつと思ったあなた、実用的なメリットも存在します。

  1. ログの検索性が向上する (coloringではgrep検索できない)
  2. 省スペース (たったの1文字!)
  3. ログを見るのが楽しくなる (🍣🍣🍣)

簡単なサンプルを書いてみました。

ログのレベルにしか適用していませんが、タグやチャンネルにもルールを決めてつけてみるといいと思います。

まとめ

絵文字を使う = 省スペース & 検索性の向上 & 楽しい!

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?