{"width":"100%","author_name":"podhmo","image_url":null,"type":"rich","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpod.hatenablog.com%2Fentry%2F2019%2F09%2F23%2F174945\" title=\"python\u3067logging.Logger\u3068logging.LoggerAdapter\u3092\u8a31\u3059\u578b\u3092\u5b9a\u7fa9\u3059\u308b\u65b9\u6cd5\u306e\u30e1\u30e2 - podhmo&#39;s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://pod.hatenablog.com/","blog_title":"podhmo's diary","title":"python\u3067logging.Logger\u3068logging.LoggerAdapter\u3092\u8a31\u3059\u578b\u3092\u5b9a\u7fa9\u3059\u308b\u65b9\u6cd5\u306e\u30e1\u30e2","version":"1.0","categories":["python","logging","mypy","typing"],"published":"2019-09-23 17:49:45","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/podhmo/","description":"python\u3067logging.Logger\u3068logging.LoggerAdapter\u3092\u8a31\u3059\u578b\u3092\u5b9a\u7fa9\u3059\u308b\u65b9\u6cd5\u306e\u30e1\u30e2\u3002 \u5225\u306e\u8a00\u3044\u65b9\u3092\u3059\u308b\u3068union type\u3068protocol\u3092\u4f7f\u3063\u305fstructured subtyping\u306e\u9055\u3044\u306e\u30e1\u30e2\u3002 (:warning: \u304a\u305d\u3089\u304f\u307e\u3060Protocol\u3092import\u3059\u308b\u306b\u306ftyping_extensions\u304c\u5fc5\u8981\u3067\u3059) \u4f8b \u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u95a2\u6570\u304c\u3042\u308b\u3068\u3059\u308b\u3002\u3053\u308c\u3092\u5229\u7528\u3057\u305f\u3044\u3002duck typing\u7684\u306b\u306fl.info()\u306e\u5f62\u3067\u4f7f\u3048\u308c\u3070\u5341\u5206\u3002 def use(l: logging.Logger) -> None: l.info(\"hello\") \u3053\u3053\u3067\u3061\u3087\u3063\u3068\u2026","url":"https://pod.hatenablog.com/entry/2019/09/23/174945","provider_name":"Hatena Blog"}