Skip to content

Instantly share code, notes, and snippets.

@mjarkk
Last active June 3, 2020 12:48
Show Gist options
  • Save mjarkk/be2f910c50f489744511253d0aa1a121 to your computer and use it in GitHub Desktop.
Save mjarkk/be2f910c50f489744511253d0aa1a121 to your computer and use it in GitHub Desktop.

Revisions

  1. mjarkk revised this gist Jun 3, 2020. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions log.go
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,12 @@
    package

    import (
    "log"
    "fmt"
    "os"
    )

    func l(v ...interface{}) {
    f, _ := os.OpenFile("debug.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
    log.SetOutput(f)
    log.Println(v...)
    fmt.Fprintln(f, v...)
    f.Close()
    }
  2. mjarkk created this gist Nov 22, 2019.
    13 changes: 13 additions & 0 deletions log.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    package

    import (
    "log"
    "os"
    )

    func l(v ...interface{}) {
    f, _ := os.OpenFile("debug.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
    log.SetOutput(f)
    log.Println(v...)
    f.Close()
    }