Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docs/cn/FAQ_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,44 @@ logger.SetLogLevel(logrus.PanicLevel)
上面代码将会将Grule的日志级别设置成 `Panic` 级别, 只有当panic发生的时候才会记录日志.

当然,修改日志级别可以减少你debug系统的能力,所以我们建议在生产环境才使用更高级别的日志级别。

---

**Question**: I've just upgraded Grule to the newest version, suddenly no log comes out of Grule?

**Answer**: Yes, as of Grule v1.20.1 a new NoopLogger were introduced. This provide a plain and neutral logging framework Grule.
This allows grule to use logging framework of your choice, what ever it is. Here is how:

1. Create your own version of Logger by implementing "logger.Logger" interface, in this example lets call it `MyLogger`.

```go
type MyLogger struct {}
func (myLog *MyLogger) Debug(args ...interface{}) {
.. code to add debug log here ..
}
Info(args ...interface{}){
.. code to add info log here ..
}
Warn(args ...interface{}){
.. code to add warn log here ..
}
... and so on
```

2. Instantiate `MyLogger` and add this to `logger.LogEntry` with its default LogLevel (`logger.Level`),

```go
myLogEntry := &LogEntry {
Logger : &MyLogger{},
Level : DebugLevel,
}
```

3. Set `logger.Log` to use your new `LogEntry`

```go
logger.Log := myLogEntry
```

If you're already uses `Logrus` or `ZapLog` or `ZeroLog`, you could straightly uses
`logger.SetLogger()` function and Grule will use your logger straight away.
2 changes: 1 addition & 1 deletion docs/cn/Tutorial_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## 准备

Grule 使用的Go 1.16版本
Grule 使用的Go 1.24.4版本

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

Expand Down
42 changes: 42 additions & 0 deletions docs/de/FAQ_de.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,45 @@ This will set Grule's log to `Panic` level, where it will only emits log when it
Of course, modifying the log level reduces your ability to debug the system so
we suggest that a higher log level setting only be instituted in production
environments.


---

**Question**: I've just upgraded Grule to the newest version, suddenly no log comes out of Grule?

**Answer**: Yes, as of Grule v1.20.1 a new NoopLogger were introduced. This provide a plain and neutral logging framework Grule.
This allows grule to use logging framework of your choice, what ever it is. Here is how:

1. Create your own version of Logger by implementing "logger.Logger" interface, in this example lets call it `MyLogger`.

```go
type MyLogger struct {}
func (myLog *MyLogger) Debug(args ...interface{}) {
.. code to add debug log here ..
}
Info(args ...interface{}){
.. code to add info log here ..
}
Warn(args ...interface{}){
.. code to add warn log here ..
}
... and so on
```

2. Instantiate `MyLogger` and add this to `logger.LogEntry` with its default LogLevel (`logger.Level`),

```go
myLogEntry := &LogEntry {
Logger : &MyLogger{},
Level : DebugLevel,
}
```

3. Set `logger.Log` to use your new `LogEntry`

```go
logger.Log := myLogEntry
```

If you're already uses `Logrus` or `ZapLog` or `ZeroLog`, you could straightly uses
`logger.SetLogger()` function and Grule will use your logger straight away.
2 changes: 1 addition & 1 deletion docs/de/Tutorial_de.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ __THIS PAGE IS BEING TRANSLATED__

## Preparation

Please note that Grule is using Go 1.13.
Please note that Grule is using Go 1.24.4.

To import Grule into your project:

Expand Down
41 changes: 41 additions & 0 deletions docs/en/FAQ_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,44 @@ This will set Grule's log to `Panic` level, where it will only emits log when it
Of course, modifying the log level reduces your ability to debug the system so
we suggest that a higher log level setting only be instituted in production
environments.

---

**Question**: I've just upgraded Grule to the newest version, suddenly no log comes out of Grule?

**Answer**: Yes, as of Grule v1.20.1 a new NoopLogger were introduced. This provide a plain and neutral logging framework Grule.
This allows grule to use logging framework of your choice, what ever it is. Here is how:

1. Create your own version of Logger by implementing "logger.Logger" interface, in this example lets call it `MyLogger`.

```go
type MyLogger struct {}
func (myLog *MyLogger) Debug(args ...interface{}) {
.. code to add debug log here ..
}
Info(args ...interface{}){
.. code to add info log here ..
}
Warn(args ...interface{}){
.. code to add warn log here ..
}
... and so on
```

2. Instantiate `MyLogger` and add this to `logger.LogEntry` with its default LogLevel (`logger.Level`),

```go
myLogEntry := &LogEntry {
Logger : &MyLogger{},
Level : DebugLevel,
}
```

3. Set `logger.Log` to use your new `LogEntry`

```go
logger.Log := myLogEntry
```

If you're already uses `Logrus` or `ZapLog` or `ZeroLog`, you could straightly uses
`logger.SetLogger()` function and Grule will use your logger straight away.
2 changes: 1 addition & 1 deletion docs/en/Tutorial_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## Preparation

Please note that Grule is using Go 1.16.
Please note that Grule is using Go 1.24.4.

To import Grule into your project:

Expand Down
43 changes: 42 additions & 1 deletion docs/id/FAQ_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,45 @@ Cara ini akan membuat Grule hanya mengeluarkan Log apabila iya panik.

Tentu saja, mengubah peringkat log ini mengurangi kemampuan anda untuk melakukan debugging,
karenanya, kami sarankan agar anda meningkatkan peringat log seperti ini hanya pada sistem
produksi saja (production environment)
produksi saja (production environment)

---

**Question**: I've just upgraded Grule to the newest version, suddenly no log comes out of Grule?

**Answer**: Yes, as of Grule v1.20.1 a new NoopLogger were introduced. This provide a plain and neutral logging framework Grule.
This allows grule to use logging framework of your choice, what ever it is. Here is how:

1. Create your own version of Logger by implementing "logger.Logger" interface, in this example lets call it `MyLogger`.

```go
type MyLogger struct {}
func (myLog *MyLogger) Debug(args ...interface{}) {
.. code to add debug log here ..
}
Info(args ...interface{}){
.. code to add info log here ..
}
Warn(args ...interface{}){
.. code to add warn log here ..
}
... and so on
```

2. Instantiate `MyLogger` and add this to `logger.LogEntry` with its default LogLevel (`logger.Level`),

```go
myLogEntry := &LogEntry {
Logger : &MyLogger{},
Level : DebugLevel,
}
```

3. Set `logger.Log` to use your new `LogEntry`

```go
logger.Log := myLogEntry
```

If you're already uses `Logrus` or `ZapLog` or `ZeroLog`, you could straightly uses
`logger.SetLogger()` function and Grule will use your logger straight away.
2 changes: 1 addition & 1 deletion docs/id/Tutorial_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ __THIS PAGE IS BEING TRANSLATED__

## Persiapan

Mohon dicatat bahwa Grule menggunakan Go 1.13
Mohon dicatat bahwa Grule menggunakan Go 1.24.4

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

Expand Down
42 changes: 42 additions & 0 deletions docs/pl/FAQ_pl.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,45 @@ logger.SetLogLevel(logrus.PanicLevel)
To ustawi log Grule'a na poziom `Panic`, gdzie będzie on wysyłał log tylko wtedy, gdy wpadnie w panikę.

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.


---

**Question**: I've just upgraded Grule to the newest version, suddenly no log comes out of Grule?

**Answer**: Yes, as of Grule v1.20.1 a new NoopLogger were introduced. This provide a plain and neutral logging framework Grule.
This allows grule to use logging framework of your choice, what ever it is. Here is how:

1. Create your own version of Logger by implementing "logger.Logger" interface, in this example lets call it `MyLogger`.

```go
type MyLogger struct {}
func (myLog *MyLogger) Debug(args ...interface{}) {
.. code to add debug log here ..
}
Info(args ...interface{}){
.. code to add info log here ..
}
Warn(args ...interface{}){
.. code to add warn log here ..
}
... and so on
```

2. Instantiate `MyLogger` and add this to `logger.LogEntry` with its default LogLevel (`logger.Level`),

```go
myLogEntry := &LogEntry {
Logger : &MyLogger{},
Level : DebugLevel,
}
```

3. Set `logger.Log` to use your new `LogEntry`

```go
logger.Log := myLogEntry
```

If you're already uses `Logrus` or `ZapLog` or `ZeroLog`, you could straightly uses
`logger.SetLogger()` function and Grule will use your logger straight away.
2 changes: 1 addition & 1 deletion docs/pl/Tutorial_pl.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## Przygotowanie

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

Aby zaimportować Grule do swojego projektu:

Expand Down
Loading