Skip to content

Commit f68bc41

Browse files
author
Ferdinand Neman
committed
Increased some version stated in the docs to better reflect current version, and added documentation about NoopLogger logging for more neutral version of logging
1 parent 9ba4f67 commit f68bc41

File tree

10 files changed

+213
-6
lines changed

10 files changed

+213
-6
lines changed

docs/cn/FAQ_cn.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,44 @@ logger.SetLogLevel(logrus.PanicLevel)
171171
上面代码将会将Grule的日志级别设置成 `Panic` 级别, 只有当panic发生的时候才会记录日志.
172172
173173
当然,修改日志级别可以减少你debug系统的能力,所以我们建议在生产环境才使用更高级别的日志级别。
174+
175+
---
176+
177+
**Question**: I've just upgraded Grule to the newest version, suddenly no log comes out of Grule?
178+
179+
**Answer**: Yes, as of Grule v1.20.1 a new NoopLogger were introduced. This provide a plain and neutral logging framework Grule.
180+
This allows grule to use logging framework of your choice, what ever it is. Here is how:
181+
182+
1. Create your own version of Logger by implementing "logger.Logger" interface, in this example lets call it `MyLogger`.
183+
184+
```go
185+
type MyLogger struct {}
186+
func (myLog *MyLogger) Debug(args ...interface{}) {
187+
.. code to add debug log here ..
188+
}
189+
Info(args ...interface{}){
190+
.. code to add info log here ..
191+
}
192+
Warn(args ...interface{}){
193+
.. code to add warn log here ..
194+
}
195+
... and so on
196+
```
197+
198+
2. Instantiate `MyLogger` and add this to `logger.LogEntry` with its default LogLevel (`logger.Level`),
199+
200+
```go
201+
myLogEntry := &LogEntry {
202+
Logger : &MyLogger{},
203+
Level : DebugLevel,
204+
}
205+
```
206+
207+
3. Set `logger.Log` to use your new `LogEntry`
208+
209+
```go
210+
logger.Log := myLogEntry
211+
```
212+
213+
If you're already uses `Logrus` or `ZapLog` or `ZeroLog`, you could straightly uses
214+
`logger.SetLogger()` function and Grule will use your logger straight away.

docs/cn/Tutorial_cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
## 准备
1414

15-
Grule 使用的Go 1.16版本
15+
Grule 使用的Go 1.24.4版本
1616

1717
以如下的方式在你的项目中引入Grule.
1818

docs/de/FAQ_de.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,45 @@ This will set Grule's log to `Panic` level, where it will only emits log when it
247247
Of course, modifying the log level reduces your ability to debug the system so
248248
we suggest that a higher log level setting only be instituted in production
249249
environments.
250+
251+
252+
---
253+
254+
**Question**: I've just upgraded Grule to the newest version, suddenly no log comes out of Grule?
255+
256+
**Answer**: Yes, as of Grule v1.20.1 a new NoopLogger were introduced. This provide a plain and neutral logging framework Grule.
257+
This allows grule to use logging framework of your choice, what ever it is. Here is how:
258+
259+
1. Create your own version of Logger by implementing "logger.Logger" interface, in this example lets call it `MyLogger`.
260+
261+
```go
262+
type MyLogger struct {}
263+
func (myLog *MyLogger) Debug(args ...interface{}) {
264+
.. code to add debug log here ..
265+
}
266+
Info(args ...interface{}){
267+
.. code to add info log here ..
268+
}
269+
Warn(args ...interface{}){
270+
.. code to add warn log here ..
271+
}
272+
... and so on
273+
```
274+
275+
2. Instantiate `MyLogger` and add this to `logger.LogEntry` with its default LogLevel (`logger.Level`),
276+
277+
```go
278+
myLogEntry := &LogEntry {
279+
Logger : &MyLogger{},
280+
Level : DebugLevel,
281+
}
282+
```
283+
284+
3. Set `logger.Log` to use your new `LogEntry`
285+
286+
```go
287+
logger.Log := myLogEntry
288+
```
289+
290+
If you're already uses `Logrus` or `ZapLog` or `ZeroLog`, you could straightly uses
291+
`logger.SetLogger()` function and Grule will use your logger straight away.

docs/de/Tutorial_de.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ __THIS PAGE IS BEING TRANSLATED__
2525

2626
## Preparation
2727

28-
Please note that Grule is using Go 1.13.
28+
Please note that Grule is using Go 1.24.4.
2929

3030
To import Grule into your project:
3131

docs/en/FAQ_en.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,44 @@ This will set Grule's log to `Panic` level, where it will only emits log when it
234234
Of course, modifying the log level reduces your ability to debug the system so
235235
we suggest that a higher log level setting only be instituted in production
236236
environments.
237+
238+
---
239+
240+
**Question**: I've just upgraded Grule to the newest version, suddenly no log comes out of Grule?
241+
242+
**Answer**: Yes, as of Grule v1.20.1 a new NoopLogger were introduced. This provide a plain and neutral logging framework Grule.
243+
This allows grule to use logging framework of your choice, what ever it is. Here is how:
244+
245+
1. Create your own version of Logger by implementing "logger.Logger" interface, in this example lets call it `MyLogger`.
246+
247+
```go
248+
type MyLogger struct {}
249+
func (myLog *MyLogger) Debug(args ...interface{}) {
250+
.. code to add debug log here ..
251+
}
252+
Info(args ...interface{}){
253+
.. code to add info log here ..
254+
}
255+
Warn(args ...interface{}){
256+
.. code to add warn log here ..
257+
}
258+
... and so on
259+
```
260+
261+
2. Instantiate `MyLogger` and add this to `logger.LogEntry` with its default LogLevel (`logger.Level`),
262+
263+
```go
264+
myLogEntry := &LogEntry {
265+
Logger : &MyLogger{},
266+
Level : DebugLevel,
267+
}
268+
```
269+
270+
3. Set `logger.Log` to use your new `LogEntry`
271+
272+
```go
273+
logger.Log := myLogEntry
274+
```
275+
276+
If you're already uses `Logrus` or `ZapLog` or `ZeroLog`, you could straightly uses
277+
`logger.SetLogger()` function and Grule will use your logger straight away.

docs/en/Tutorial_en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
## Preparation
1414

15-
Please note that Grule is using Go 1.16.
15+
Please note that Grule is using Go 1.24.4.
1616

1717
To import Grule into your project:
1818

docs/id/FAQ_id.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,45 @@ Cara ini akan membuat Grule hanya mengeluarkan Log apabila iya panik.
234234
235235
Tentu saja, mengubah peringkat log ini mengurangi kemampuan anda untuk melakukan debugging,
236236
karenanya, kami sarankan agar anda meningkatkan peringat log seperti ini hanya pada sistem
237-
produksi saja (production environment)
237+
produksi saja (production environment)
238+
239+
---
240+
241+
**Question**: I've just upgraded Grule to the newest version, suddenly no log comes out of Grule?
242+
243+
**Answer**: Yes, as of Grule v1.20.1 a new NoopLogger were introduced. This provide a plain and neutral logging framework Grule.
244+
This allows grule to use logging framework of your choice, what ever it is. Here is how:
245+
246+
1. Create your own version of Logger by implementing "logger.Logger" interface, in this example lets call it `MyLogger`.
247+
248+
```go
249+
type MyLogger struct {}
250+
func (myLog *MyLogger) Debug(args ...interface{}) {
251+
.. code to add debug log here ..
252+
}
253+
Info(args ...interface{}){
254+
.. code to add info log here ..
255+
}
256+
Warn(args ...interface{}){
257+
.. code to add warn log here ..
258+
}
259+
... and so on
260+
```
261+
262+
2. Instantiate `MyLogger` and add this to `logger.LogEntry` with its default LogLevel (`logger.Level`),
263+
264+
```go
265+
myLogEntry := &LogEntry {
266+
Logger : &MyLogger{},
267+
Level : DebugLevel,
268+
}
269+
```
270+
271+
3. Set `logger.Log` to use your new `LogEntry`
272+
273+
```go
274+
logger.Log := myLogEntry
275+
```
276+
277+
If you're already uses `Logrus` or `ZapLog` or `ZeroLog`, you could straightly uses
278+
`logger.SetLogger()` function and Grule will use your logger straight away.

docs/id/Tutorial_id.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ __THIS PAGE IS BEING TRANSLATED__
2525

2626
## Persiapan
2727

28-
Mohon dicatat bahwa Grule menggunakan Go 1.13
28+
Mohon dicatat bahwa Grule menggunakan Go 1.24.4
2929

3030
Untuk menggunakan Grule didalam proyek anda, cukup dengan mudah masukannya.
3131

docs/pl/FAQ_pl.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,45 @@ logger.SetLogLevel(logrus.PanicLevel)
170170
To ustawi log Grule'a na poziom `Panic`, gdzie będzie on wysyłał log tylko wtedy, gdy wpadnie w panikę.
171171
172172
Oczywiście, modyfikacja poziomu logów zmniejsza możliwości debugowania systemu, dlatego sugerujemy, aby wyższy poziom logów był ustawiany tylko w środowiskach produkcyjnych.
173+
174+
175+
---
176+
177+
**Question**: I've just upgraded Grule to the newest version, suddenly no log comes out of Grule?
178+
179+
**Answer**: Yes, as of Grule v1.20.1 a new NoopLogger were introduced. This provide a plain and neutral logging framework Grule.
180+
This allows grule to use logging framework of your choice, what ever it is. Here is how:
181+
182+
1. Create your own version of Logger by implementing "logger.Logger" interface, in this example lets call it `MyLogger`.
183+
184+
```go
185+
type MyLogger struct {}
186+
func (myLog *MyLogger) Debug(args ...interface{}) {
187+
.. code to add debug log here ..
188+
}
189+
Info(args ...interface{}){
190+
.. code to add info log here ..
191+
}
192+
Warn(args ...interface{}){
193+
.. code to add warn log here ..
194+
}
195+
... and so on
196+
```
197+
198+
2. Instantiate `MyLogger` and add this to `logger.LogEntry` with its default LogLevel (`logger.Level`),
199+
200+
```go
201+
myLogEntry := &LogEntry {
202+
Logger : &MyLogger{},
203+
Level : DebugLevel,
204+
}
205+
```
206+
207+
3. Set `logger.Log` to use your new `LogEntry`
208+
209+
```go
210+
logger.Log := myLogEntry
211+
```
212+
213+
If you're already uses `Logrus` or `ZapLog` or `ZeroLog`, you could straightly uses
214+
`logger.SetLogger()` function and Grule will use your logger straight away.

docs/pl/Tutorial_pl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
## Przygotowanie
1414

15-
Należy pamiętać, że Grule używa Go 1.16.
15+
Należy pamiętać, że Grule używa Go 1.24.4.
1616

1717
Aby zaimportować Grule do swojego projektu:
1818

0 commit comments

Comments
 (0)