<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shiguredo Inc.</title>
    <description>The latest articles on DEV Community by Shiguredo Inc. (@shiguredo).</description>
    <link>https://dev.to/shiguredo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F1699%2F28b16121-8dc5-4db0-a5df-49a286ae5cb8.png</url>
      <title>DEV Community: Shiguredo Inc.</title>
      <link>https://dev.to/shiguredo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shiguredo"/>
    <language>en</language>
    <item>
      <title>Released a TOML library with zero dependencies in Rust.</title>
      <dc:creator>voluntas</dc:creator>
      <pubDate>Sat, 07 Mar 2026 05:38:59 +0000</pubDate>
      <link>https://dev.to/shiguredo/released-a-toml-library-with-zero-dependencies-in-rust-1boe</link>
      <guid>https://dev.to/shiguredo/released-a-toml-library-with-zero-dependencies-in-rust-1boe</guid>
      <description>&lt;p&gt;Shiguredo has begun shifting its development focus from C++ to Rust. As part of this transition, we've been implementing various libraries in Rust, and this time we've released a TOML library.&lt;/p&gt;

&lt;p&gt;By default, Shiguredo uses the JSONC format when developing applications in Rust. JSONC is an incompatible extension of JSON that allows comments and trailing commas, making it convenient to use.&lt;/p&gt;

&lt;p&gt;Additionally, the nojson dependency-free JSON library supports it.&lt;br&gt;
However, Rust is primarily designed for TOML usage. Despite this, the default library does not include TOML support, and most major TOML libraries have significant dependencies. Therefore, we decided to develop our own TOML implementation with minimized dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  shiguredo/toml-rs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Dependencies: 0&lt;/li&gt;
&lt;li&gt;Supports TOML v1.0.0 and v1.1.0 specifications&lt;/li&gt;
&lt;li&gt;Compatible with toml-test&lt;/li&gt;
&lt;li&gt;Fuzzing support&lt;/li&gt;
&lt;li&gt;Rewriting functionality&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;toml-test is a testing suite officially provided by the TOML project. A score of 100% indicates full compatibility, making this product technically "fully compatible."&lt;/p&gt;

&lt;p&gt;We have prioritized robustness by thoroughly implementing fuzzing and ensuring the code remains stable under unexpected inputs.&lt;/p&gt;

&lt;p&gt;Following user requests, we've added rewriting functionality. We implemented this feature by adapting nojson's positional tracking mechanism. After addressing several identified bugs, we've released this version.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/shiguredo/toml-rs" rel="noopener noreferrer"&gt;https://github.com/shiguredo/toml-rs&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;While we strive to minimize dependencies by building our own libraries, the result is both comfortable to use and highly maintainable. The reduced dependency footprint makes maintenance easier, and having our own libraries provides the advantage of complete control.&lt;/p&gt;

</description>
      <category>rust</category>
    </item>
    <item>
      <title>zerolog と lumberjack と io.MultiWriter</title>
      <dc:creator>voluntas</dc:creator>
      <pubDate>Fri, 03 Jan 2020 05:31:19 +0000</pubDate>
      <link>https://dev.to/shiguredo/zerolog-lumberjack-io-multiwriter-2a7k</link>
      <guid>https://dev.to/shiguredo/zerolog-lumberjack-io-multiwriter-2a7k</guid>
      <description>&lt;p&gt;最近 Go で小さなミドルウェアと小さなウェブアプリを書いています。その際に欲しくなるのがログ出力の仕組みとログローテーションの仕組みです。&lt;/p&gt;

&lt;h2&gt;
  
  
  ログライブラリに対する要望
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;ログ出力は JSON できること&lt;/li&gt;
&lt;li&gt;JSON 出力の場合はログレベルを指定しないでできること&lt;/li&gt;
&lt;li&gt;独自フォーマットにも対応していること&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ログローテーションライブラリに対する要望
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;組み込みが簡単であること&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  zerolog
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/rs/zerolog" rel="noopener noreferrer"&gt;rs/zerolog: Zero Allocation JSON Logger&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;性能は特に求めていないのですが、一通り欲しかった機能があったので zerolog を採用しました。&lt;/p&gt;

&lt;h3&gt;
  
  
  良いところ
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;logger.Log() でログレベルなしで出力できる&lt;/li&gt;
&lt;li&gt;logger.Err(err) と err がきれいに出力できる&lt;/li&gt;
&lt;li&gt;logger.Str("abc", xyz).Int("123", 234) とわかりやすく型付きでログを定義できる&lt;/li&gt;
&lt;li&gt;zerolog.ConsoleWriter を使うことで独自フォーマットを定義できる&lt;/li&gt;
&lt;li&gt;タイムフォーマットが気軽に利用可能&lt;/li&gt;
&lt;li&gt;UTC 出力にしようと思った時、簡単にできた&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  良くないところ
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;JSON ベースなので仕方ないが key=value の順番指定ができない&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  lumberjack
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/natefinch/lumberjack" rel="noopener noreferrer"&gt;natefinch/lumberjack: lumberjack is a log rolling package for Go&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  良いところ
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;簡単に組み込める&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  悪いところ
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;特になし&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  使ってみる
&lt;/h2&gt;

&lt;p&gt;stdout と file 両方に出力するように、 MultiWriter を使っています。&lt;/p&gt;

&lt;p&gt;&lt;a href="https://golang.org/pkg/io/#MultiWriter" rel="noopener noreferrer"&gt;io - The Go Programming Language&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"io"&lt;/span&gt;
    &lt;span class="s"&gt;"os"&lt;/span&gt;
    &lt;span class="s"&gt;"time"&lt;/span&gt;

    &lt;span class="s"&gt;"github.com/rs/zerolog"&lt;/span&gt;
    &lt;span class="s"&gt;"gopkg.in/natefinch/lumberjack.v2"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;zerolog&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TimeFieldFormat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;RFC3339Nano&lt;/span&gt;

    &lt;span class="n"&gt;writer&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;lumberjack&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;Filename&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"test.log"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="c"&gt;// メガバイト&lt;/span&gt;
        &lt;span class="n"&gt;MaxSize&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;    &lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;MaxBackups&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="c"&gt;// 日&lt;/span&gt;
        &lt;span class="n"&gt;MaxAge&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="c"&gt;// デフォルトは無効&lt;/span&gt;
        &lt;span class="n"&gt;Compress&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c"&gt;// ここで stdout とファイルの両方に書き出すようにする&lt;/span&gt;
    &lt;span class="n"&gt;writers&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MultiWriter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Stdout&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;writer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;log&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;zerolog&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;writers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;With&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Timestamp&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Log&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
        &lt;span class="n"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"baz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;123&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
        &lt;span class="n"&gt;Msg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hello world"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>go</category>
    </item>
  </channel>
</rss>
