GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — updating example · projectdiscovery/gologger@1c357ca

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • examples/basic
    • basic.go
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎examples/basic/basic.go‎

Copy file name to clipboardExpand all lines: examples/basic/basic.go
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,11 @@ func main() {
1818
gologger.Debug().Str("state", "running").Msg("planner running")
1919
gologger.Debug().TimeStamp().Str("state", "running").Msg("with timestamp event")
2020
gologger.Warning().Str("state", "errored").Str("status", "404").Msg("could not run")
21+
22+
// with timestamp
23+
gologger.DefaultLogger.SetTimestamp(true, levels.LevelDebug)
24+
gologger.Debug().Msg("with automatic timestamp")
25+
gologger.Info().Msg("without automatic timestamp")
26+
2127
gologger.Fatal().Msg("bye bye")
2228
}

0 commit comments

Comments
0 (0)
You are visitor 01402605 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.