66[ ![ Telegram EN] [ telegram-badge ]] [ telegram-en-url ]
77[ ![ Telegram RU] [ telegram-badge ]] [ telegram-ru-url ]
88
9+ ## Table of contents
10+
11+ - [ go-tlog] ( #go-tlog )
12+ - [ Features] ( #features )
13+ - [ Installation] ( #installation )
14+ - [ Quick start] ( #quick-start )
15+ - [ Configuration] ( #configuration )
16+ - [ type Opts] ( #type-opts )
17+ - [ Main API] ( #main-api )
18+ - [ Log levels] ( #log-levels )
19+ - [ Output formats] ( #output-formats )
20+ - [ Output destinations] ( #output-destinations )
21+ - [ Examples] ( #examples )
22+ - [ Testing] ( #testing )
23+ - [ License] ( #license )
24+
925# go-tlog
1026
1127` go-tlog ` is a lightweight and configurable logging library for Go applications.
@@ -133,41 +149,11 @@ Supported targets:
133149
134150## Examples
135151
136- Ready-to-run examples are located in the ` _examples/ ` directory:
137-
138- ```
139- _examples/
140- ├── stdout/
141- │ └── main.go
142- ├── stderr/
143- │ └── main.go
144- ├── file/
145- │ └── main.go
146- └── multi/
147- └── main.go
148- ```
152+ Included examples:
149153
150- Run examples:
151-
152- ``` bash
153- # Example 1 — log to STDOUT in text format
154- go run ./_examples/stdout
155-
156- # Example 2 — log to STDERR in JSON format
157- # Redirect stderr to a file and inspect its contents
158- go run ./_examples/stderr 2> logs.json
159- cat logs.json
160-
161- # Example 3 — log to a file in /tmp directory
162- # The file will be created automatically if it doesn’t exist
163- go run ./_examples/file
164- cat /tmp/tlog_demo/app.log
165-
166- # Example 4 — log to multiple destinations (stdout + file)
167- # This writes the same log entry both to console and to /tmp/tlog_multi/app.log
168- go run ./_examples/multi
169- cat /tmp/tlog_multi/app.log
170- ```
154+ - ** ExampleNew_text** — basic text logger writing to stdout
155+ - ** ExampleNew_json** — JSON logging
156+ - ** ExampleNew_multi** — logging to multiple destinations (` stdout,/tmp/... ` )
171157
172158Each example demonstrates different combinations of Path, Format, and Level,
173159including how to log to multiple outputs at the same time.
@@ -177,7 +163,7 @@ including how to log to multiple outputs at the same time.
177163## Testing
178164
179165``` bash
180- go test ./...
166+ make test
181167```
182168
183169---
0 commit comments