<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                [TOC] # 簡介 **注意權限問題** beego 的日志處理是基于 logs 模塊搭建的,內置了一個變量`BeeLogger`,默認已經是`logs.BeeLogger`類型,初始化了 console,也就是默認輸出到`console` 導包 ~~~ import ( "github.com/astaxie/beego/logs" ) ~~~ 然后添加輸出引擎(log 支持同時輸出到多個引擎),這里我們以 console 為例,第一個參數是引擎名(包括:console、file、conn、smtp、es、multifile) ~~~ logs.SetLogger("console") ~~~ 添加輸出引擎也支持第二個參數,用來表示配置信息,詳細的配置請看下面介紹: ~~~ logs.SetLogger(logs.AdapterFile,`{"filename":"project.log","level":7,"maxlines":0,"maxsize":0,"daily":true,"maxdays":10,"color":true}`) ~~~ ~~~ beego.Emergency("this is emergency") //M beego.Alert("this is alert") //A beego.Critical("this is critical") //C beego.Error("this is error") //E beego.Warning("this is warning") //w beego.Notice("this is notice") //N beego.Informational("this is informational") //I beego.Debug("this is debug") //D ~~~ # 輸出到文件 ~~~ func (this *AdminController) Post() { beego.BeeLogger.DelLogger("file") //an official log.Logger l := logs.GetLogger() l.Println("this is a message of http") //an official log.Logger with prefix ORM logs.GetLogger("ORM").Println("this is a message of orm") logs.Debug("my book is bought in the year of ", 2016) logs.Info("this %s cat is %v years old", "yellow", 3) logs.Warn("json is a type of kv like", map[string]int{"key": 2016}) logs.Error(1024, "is a very", "good game") logs.Critical("oh,crash") beego.SetLogger("file", `{"filename":"logs/test.log"}`) fmt.Println("=============") this.Ctx.WriteString("-------abc----------") } ~~~ # 其他 一般推薦使用通用方式進行日志,但依然支持單獨聲明來使用獨立的日志 ~~~ package main import ( "github.com/astaxie/beego/logs" ) func main() { log := logs.NewLogger() log.SetLogger(logs.AdapterConsole) log.Debug("this is a debug message") } ~~~ ## 異步輸出日志[](https://beego.me/docs/module/logs.md#%E5%BC%82%E6%AD%A5%E8%BE%93%E5%87%BA%E6%97%A5%E5%BF%97) 為了提升性能, 可以設置異步輸出: ~~~ logs.Async() ~~~ 異步輸出允許設置緩沖 chan 的大小 ~~~ logs.Async(1e3) ~~~ 還有其他的看文檔吧
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看