Commit Graph

22 Commits (167a8b5e9421e0ab51fbf44c5621632f4a1a90c5)

Author SHA1 Message Date
leonklingele 167a8b5e94
🚀 Feature: Add and apply more stricter golangci-lint linting rules (#2286)
* golangci-lint: add and apply more stricter linting rules

* github: drop security workflow now that we use gosec linter inside golangci-lint

* github: use official golangci-lint CI linter

* Add editorconfig and gitattributes file
2023-01-27 09:01:37 +01:00
M. Efe Çetin 5406560033
🧹 chore: make most tests parallel (#2299)
* 🧹 chore: make most tests parallel

* revert some tests

* revert some tests

* revert some tests
2023-01-15 23:21:37 +08:00
kinggo efeea7a4b5
optimize: latency use lowest time unit in logger middleware (#2261) 2022-12-10 21:56:43 +01:00
kinggo 075dfc5a8a
optimize: set byteSent log to 0 when use SetBodyStreamWriter (#2239) 2022-12-01 09:19:26 +01:00
RW e4b3b5c708
Improve interface for custom logger func (#2225)
* - logger: fix custom tag
- use real bytebufferpool dependency instead of the internal

* - logger: fix custom tag
- use real bytebufferpool dependency instead of the internal

* - logger: fix custom tag
- use real bytebufferpool dependency instead of the internal

* - logger: fix custom tag
- use real bytebufferpool dependency instead of the internal
2022-11-18 15:32:56 +01:00
skyenought e8f8cb647b
Add customTags in logger middleware Config (#2188)
*  Add customTags in logger middleware Config

* improve tags with parameter

* improve logger performance

* improve logger performance

* improve logger performance

* improve logger performance

Co-authored-by: René Werner <rene@gofiber.io>
2022-11-18 13:10:43 +01:00
Andy Pan 3157fb5f1c
Add callback function for middleware/logger (#2219)
*  Add callback function for middleware/logger

* Refine test code
2022-11-15 12:14:32 +01:00
M. Efe Çetin 691d2e6ad5
🗑️ deprecate: go 1.14 & go 1.15 support deprecation (#2172)
* 🗑️ deprecate: go 1.14 & go 1.15 support deprecation
https://github.com/valyala/fasthttp/pull/1379

* fix tests
2022-10-26 11:51:50 +02:00
M. Efe Çetin 4103f9463d
feature: customizable colors (#1977)
*  feature: customizable colors

*  feature: customizable colors

*  feature: customizable colors
2022-08-01 08:24:37 +02:00
akp e974c6793f
RFC: Return an instance of `*fiber.Error` when no handler found (#1847)
* Return an instance of `*fiber.Error` when no handler found

When a handler cannot be found for a given path, previously Fiber
would construct a plaintext response that cannot be modified.

This commit switches to returning a new instance of `*fiber.Error`
with identical error message so that users can customise the look
of their 404 pages.

Signed-off-by: AKP <tom@tdpain.net>

* Fix `Test_App_Next_Method`

This test was failing as the error returned by `c.Next()` that's
required to generate the correct 404 status code was not being
passed through the middleware and being silently ignored.

Signed-off-by: AKP <tom@tdpain.net>

* Fix `Test_Logger_All`

Signed-off-by: AKP <tom@tdpain.net>

* Fix `Test_Cache_WithHeadThenGet` test

As far as I can tell, this test is meant to check that a cached
HEAD request to a given endpoint does not return the cached
content to a GET request to the same endpoint, and the test has
been altered to correctly check for this.

Signed-off-by: AKP <tom@tdpain.net>
2022-04-05 08:39:53 +02:00
M. Efe Çetin 59240b5493
Add GetRespHeader, GetReqHeaders and TagReqHeaders for logger mw (#1678)
* Add GetRespHeader & GetReqHeaders methods.

* Add TagReqHeaders for logger middleware.

* Update README.md
2021-12-31 13:03:08 +01:00
goldwind-ting 846d5a5b38
[Logger]: add tag for response header (#1446)
* add TagRespHeader to get response header

* #1422:add unittest

* #1422:adjust docs for logger middleware

* #1422:adjust docs for logger middleware
2021-08-04 08:19:41 +02:00
Javad Rajabzade 7609117cec
Improved some conditions (#1386)
* simplify `u <= (1<<7)-1` to `u < (1 << 7)`

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* Instead Bool comparison can using simplified bool check if !var = false checking

* Unnecessary use of fmt.Sprintf for value without format

* For check condition two value not required ! method

* nil check may not be enough for slice, better check with len

* function parameters combined

* When the form returns error information, the text content should not start with a capital letter or end with a punctuation mark

* error var invalidPath should have name of the form errFoo, It is recommended that the error variables that are part of an API should be named

* change to condition len(x), it's faster https://github.com/gofiber/fiber/pull/1386#discussion_r652369520

* Update write.go

* Update write_bytes.go

* Update store.go

Co-authored-by: RW <rene@gofiber.io>
2021-06-17 22:03:59 +02:00
Zuolar 4dcb490489
fix logger [WARNING: DATA RACE] (#1226)
* fix logger [WARNING: DATA RACE]
* add logger unit test for data race
2021-03-17 08:08:15 +01:00
Abhishek Kumar cae82d0a2f 🩹 Fix: fix test for response body 2021-01-24 15:00:51 +00:00
Abhishek Kumar e8c3a0fac3 🩹 Fix: add separate test for resBody logger variable 2021-01-24 13:11:46 +00:00
Abhishek Kumar 9c18716885 🔥 Feature: add proper tests for new logger variables 2021-01-24 11:21:10 +00:00
Abhishek Kumar 7c36b32194 🩹 Fix: reference to logger issue #1115 2021-01-23 17:19:33 +00:00
Fenny 67eed4c721 🚀 restore benchmark
Co-Authored-By: Rafael Cossovan <navossoc@gmail.com>
2020-10-28 03:56:54 +01:00
Fenny 17b6597ec8 💼 add locals to logger
Co-Authored-By: Rafael Cossovan <navossoc@gmail.com>
2020-10-28 03:54:40 +01:00
kiyon b007a87e4a 👷 add logger test cases 2020-09-17 13:34:23 +08:00
kiyon 0088a6900a 🍱 improve logger performance 2020-09-16 14:07:40 +08:00