<?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: suganoo</title>
    <description>The latest articles on DEV Community by suganoo (@suganoo).</description>
    <link>https://dev.to/suganoo</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%2Fuser%2Fprofile_image%2F124391%2Fd6c8d2f1-cb4f-4acd-a7f7-3a20655cbf61.jpeg</url>
      <title>DEV Community: suganoo</title>
      <link>https://dev.to/suganoo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/suganoo"/>
    <language>en</language>
    <item>
      <title>Go Gologger</title>
      <dc:creator>suganoo</dc:creator>
      <pubDate>Fri, 24 May 2019 09:31:22 +0000</pubDate>
      <link>https://dev.to/suganoo/go-gologger-3342</link>
      <guid>https://dev.to/suganoo/go-gologger-3342</guid>
      <description>&lt;p&gt;Now I am developing gologger as logger for golang.&lt;br&gt;
Github repository is here.&lt;br&gt;
&lt;a href="https://github.com/suganoo/gologger"&gt;https://github.com/suganoo/gologger&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Sample code
&lt;/h2&gt;

&lt;p&gt;Here is sample code of how to use gologger.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go get -u github.com/suganoo/gologger

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;gologgerSample.go&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
    "github.com/suganoo/gologger"
)

var glog *gologger.Gologger

func hogeFunc() {
    glog.Debug("this is debug hogeFunc")
    glog.Info("call hogeFunc")
}

func main() {
    glog = gologger.NewGologger(gologger.Configuration{Logfile : "./testlog.log"})
    defer glog.CloseFile()

    msg := "hogehoge"
    glog.Debug("this is debug")   // default debug is muted
    glog.Info("this is info")
    glog.Info("msg : " + msg)
    glog.Warning("this is warning")
    glog.Error("this is Error")

    glog.UnmuteDebug()
    hogeFunc()

    glog.Debug("this is debug xxx")
    glog.MuteDebug()
    glog.Debug("this is debug yyy")  // this debug message is muted
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go run gologgerSample.go

cat testlog.log
2018-02-21T10:07:44.277+09:00   INFO    hoge.sever  3892    gid:1   fuga-user   1.0.0   this is info    main    [gologgerSample.go:18]
2018-02-21T10:07:44.277+09:00   INFO    hoge.sever  3892    gid:1   fuga-user   1.0.0   msg : hogehoge  main    [gologgerSample.go:19]
2018-02-21T10:07:44.277+09:00   WARNING hoge.sever  3892    gid:1   fuga-user   1.0.0   this is warning main    [gologgerSample.go:20]
2018-02-21T10:07:44.277+09:00   ERROR   hoge.sever  3892    gid:1   fuga-user   1.0.0   this is Error   main    [gologgerSample.go:21]
2018-02-21T10:07:44.277+09:00   DEBUG   hoge.sever  3892    gid:1   fuga-user   1.0.0   this is debug hogeFunc  hogeFunc    [gologgerSample.go:8]
2018-02-21T10:07:44.277+09:00   INFO    hoge.sever  3892    gid:1   fuga-user   1.0.0   call hogeFunc   hogeFunc    [gologgerSample.go:9]
2018-02-21T10:07:44.277+09:00   DEBUG   hoge.sever  3892    gid:1   fuga-user   1.0.0   this is debug xxx   main    [gologgerSample.go:26]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You can get variety of log items, such as line number of file, goroutine number and so on.&lt;/li&gt;
&lt;li&gt;You can write any types of log messages, such as int, string, or struct, in gologger function (Info(), Warning()...).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have any interest on gologger, it would be great to try it.&lt;br&gt;
You can find more information in gologger repository.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;

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