<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>arthur-1</author_name>
  <author_url>https://blog.hatena.ne.jp/arthur-1/</author_url>
  <blog_title>Diary of a Perpetual Student</blog_title>
  <blog_url>https://blog.arthur1.dev/</blog_url>
  <categories>
    <anon>テクノロジー</anon>
    <anon>Go</anon>
    <anon>OpenTelemetry</anon>
  </categories>
  <description>Goのloggerを引き回す際に皆さんはどのような手法を取っていますか？ グローバル変数にloggerのインスタンスを入れておく contextにloggerのインスタンスを入れておく トレースIDなどを入れたloggerを適宜作ってcontextに格納する 構造体のフィールドにloggerのインスタンスを入れておく（DI） などなど、ソフトウェアの規模や特性を鑑みて各自使い分けているかと思います。 ところで、私は 2. 3. の手法があまり好きではありませんでした。単純に面倒だし美しくありません。contextに入れる、取り出すだけでも数行のコードを毎度書く必要があってダルいな〜と思っていま…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.arthur1.dev%2Fentry%2F2024%2F01%2F19%2F093000&quot; title=&quot;slog時代のGoではloggerをcontextで引きまわさなくて良い気がする - Diary of a Perpetual Student&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-01-19 09:30:00</published>
  <title>slog時代のGoではloggerをcontextで引きまわさなくて良い気がする</title>
  <type>rich</type>
  <url>https://blog.arthur1.dev/entry/2024/01/19/093000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
