Add LogDriver for translation with configuration support.

Introduced a new LogDriver for logging translation operations. Updated the README and configuration file to include support for the LogDriver and its associated limits. This feature enables the use of a logging-based translation driver for testing and debugging purposes.
This commit is contained in:
2024-12-10 21:54:11 +05:00
parent 4fdf7fd6f9
commit 7e05777385
3 changed files with 75 additions and 1 deletions

View File

@@ -35,5 +35,16 @@ return [
],
],
],
'log' => [
'driver' => '\KorElf\TranslateLaravel\Translate\LogDriver',
'config' => [
'limit' => [
'max_request' => (int) env('TRANSLATE_LOG_LIMIT_MAX_REQUEST', 20),
'rate_seconds' => (int) env('TRANSLATE_LOG_LIMIT_RATE_SECONDS', 1),
'max_symbols' => (int) env('TRANSLATE_LOG_LIMIT_MAX_SYMBOLS', 9000),
],
],
],
],
];