1515
1616-->
1717
18- <h1 align =" center " >AtomicGo | chslog </h1 >
18+ <h1 align =" center " >AtomicGo | template </h1 >
1919
2020<p align =" center " >
21- <img src =" https://img.shields.io/endpoint?url=https%3A%2F%2Fatomicgo.dev%2Fapi%2Fshields%2Fchslog &style=flat-square " alt =" Downloads " >
21+ <img src =" https://img.shields.io/endpoint?url=https%3A%2F%2Fatomicgo.dev%2Fapi%2Fshields%2Ftemplate &style=flat-square " alt =" Downloads " >
2222
23- <a href =" https://github.com/atomicgo/chslog /releases " >
24- <img src =" https://img.shields.io/github/v/release/atomicgo/chslog ?style=flat-square " alt =" Latest Release " >
23+ <a href =" https://github.com/atomicgo/template /releases " >
24+ <img src =" https://img.shields.io/github/v/release/atomicgo/template ?style=flat-square " alt =" Latest Release " >
2525</a >
2626
27- <a href =" https://codecov.io/gh/atomicgo/chslog " target =" _blank " >
28- <img src =" https://img.shields.io/github/actions/workflow/status/atomicgo/chslog /go.yml?style=flat-square " alt =" Tests " >
27+ <a href =" https://codecov.io/gh/atomicgo/template " target =" _blank " >
28+ <img src =" https://img.shields.io/github/actions/workflow/status/atomicgo/template /go.yml?style=flat-square " alt =" Tests " >
2929</a >
3030
31- <a href =" https://codecov.io/gh/atomicgo/chslog " target =" _blank " >
32- <img src =" https://img.shields.io/codecov/c/gh/atomicgo/chslog ?color=magenta&logo=codecov&style=flat-square " alt =" Coverage " >
31+ <a href =" https://codecov.io/gh/atomicgo/template " target =" _blank " >
32+ <img src =" https://img.shields.io/codecov/c/gh/atomicgo/template ?color=magenta&logo=codecov&style=flat-square " alt =" Coverage " >
3333</a >
3434
35- <a href =" https://codecov.io/gh/atomicgo/chslog " >
36- <!-- unittestcount:start --> <img src =" https://img.shields.io/badge/Unit_Tests-0 -magenta?style=flat-square " alt =" Unit test count " ><!-- unittestcount:end -->
35+ <a href =" https://codecov.io/gh/atomicgo/template " >
36+ <!-- unittestcount:start --> <img src =" https://img.shields.io/badge/Unit_Tests-3 -magenta?style=flat-square " alt =" Unit test count " ><!-- unittestcount:end -->
3737</a >
3838
3939<a href =" https://opensource.org/licenses/MIT " target =" _blank " >
4040<img src =" https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square " alt =" License: MIT " >
4141</a >
4242
43- <a href =" https://goreportcard.com/report/github.com/atomicgo/chslog " target =" _blank " >
44- <img src =" https://goreportcard.com/badge/github.com/atomicgo/chslog ?style=flat-square " alt =" Go report " >
43+ <a href =" https://goreportcard.com/report/github.com/atomicgo/template " target =" _blank " >
44+ <img src =" https://goreportcard.com/badge/github.com/atomicgo/template ?style=flat-square " alt =" Go report " >
4545</a >
4646
4747</p >
4848
4949---
5050
5151<p align =" center " >
52- <strong ><a href =" https://pkg.go.dev/atomicgo.dev/chslog #section-documentation " target =" _blank " >Documentation</a ></strong >
52+ <strong ><a href =" https://pkg.go.dev/atomicgo.dev/template #section-documentation " target =" _blank " >Documentation</a ></strong >
5353|
5454<strong ><a href =" https://github.com/atomicgo/atomicgo/blob/main/CONTRIBUTING.md " target =" _blank " >Contributing</a ></strong >
5555|
5858
5959---
6060
61+
62+
6163<p align =" center " >
6264 <img src =" https://raw.githubusercontent.com/atomicgo/atomicgo/main/assets/header.png " alt =" AtomicGo " >
6365</p >
6870</tbody >
6971</table >
7072</p >
71- <h3 align =" center " ><pre >go get atomicgo.dev/chslog </pre ></h3 >
73+ <h3 align =" center " ><pre >go get atomicgo.dev/template </pre ></h3 >
7274<p align =" center " >
7375<table >
7476<tbody >
8082
8183<!-- Code generated by gomarkdoc. DO NOT EDIT -->
8284
83- # chslog
85+ # template
8486
8587``` go
86- import " atomicgo.dev/chslog "
88+ import " atomicgo.dev/template "
8789```
8890
89- Package chslog provides a simple way to set up a logger that automatically chooses between a production and a development logger .
91+ Package template is used to generate new AtomicGo repositories .
9092
91- Example:
93+ Write the description of the module here. You can use \*\* markdown \*\*\! This description should clearly explain what the package does.
9294
93- ```
94- func main() {
95- // Uses a text logger in development and a JSON logger in production.
96- prodHandler := slog.NewJSONHandler(os.Stdout, nil)
97- devHandler := slog.NewTextHandler(os.Stdout, nil)
95+ Example description: https://golang.org/src/encoding/gob/doc.go
96+
97+
98+
99+
100+
101+ ``` go
102+ package main
103+
104+ import (
105+ " fmt"
98106
99- handler := slogch.Choose(prodHandler, devHandler)
100- logger := slog.New(handler )
107+ " atomicgo.dev/template "
108+ )
101109
102- logger.Info("Hello, World!", "foo", "bar")
103- // Prod: {"time":"2023-08-03T01:31:27.6681464+02:00","level":"INFO","msg":"Hello, World!","foo":"bar"}
104- // Dev: time=2023-08-03T01:30:23.438+02:00 level=INFO msg="Hello, World!" foo=bar
110+ func main () {
111+ fmt.Println (template.HelloWorld ())
105112}
106113```
107114
108- ## Index
115+ #### Output
109116
110- - [ Variables] ( < #variables > )
111- - [ func Choose\( prodHandler, devHandler slog.Handler\) slog.Handler] ( < #Choose > )
117+ ```
118+ Hello, World!
119+ ```
112120
113121
114- ## Variables
115122
116- <a name =" Conditions " ></a >Conditions holds the environment conditions that are checked. By default, it checks for the most common environments with https://atomicgo.dev/isprod . See https://pkg.go.dev/atomicgo.dev/isprod#Conditions for more info, on how to configure them \( if needed\) .
123+ ## Index
124+
125+ - [ func HelloWorld\(\) string] ( < #HelloWorld > )
117126
118- ``` go
119- var Conditions = isprod.DefaultConditions
120- ```
121127
122- <a name =" Choose " ></a >
123- ## func [ Choose ] ( < https://github.com/atomicgo/chslog /blob/main/slogch .go#L15 > )
128+ <a name =" HelloWorld " ></a >
129+ ## func [ HelloWorld ] ( < https://github.com/atomicgo/template /blob/main/template .go#L4 > )
124130
125131``` go
126- func Choose ( prodHandler , devHandler slog . Handler ) slog . Handler
132+ func HelloWorld () string
127133```
128134
129- Choose automatically chooses between prodHandler and devHandler .
135+ HelloWorld returns \`Hello, World\!\` .
130136
131137
132138
@@ -136,22 +142,20 @@ Choose automatically chooses between prodHandler and devHandler.
136142package main
137143
138144import (
139- "log/slog"
140- "os"
145+ "fmt"
141146
142- slogch "atomicgo.dev/chslog "
147+ "atomicgo.dev/template "
143148)
144149
145150func main() {
146- // Uses a text logger in development and a JSON logger in production.
147- prodHandler := slog. NewJSONHandler (os. Stdout , nil )
148- devHandler := slog. NewTextHandler (os. Stdout , nil )
151+ fmt. Println (template. HelloWorld ())
152+ }
153+ ```
149154
150- handler := slogch.Choose (prodHandler, devHandler)
151- logger := slog.New (handler)
155+ #### Output
152156
153- logger. Info ( " Hello, World! " , " foo " , " bar " )
154- }
157+ ```
158+ Hello, World!
155159```
156160
157161
0 commit comments