-
-
Notifications
You must be signed in to change notification settings - Fork 101
Description
When using the logger, I encountered the problem of not being able to change the color of the log depending on the status of the code or custom instance.
I suggest the following solutions:
- transmit to the interceptor Map<int, Color> what is statusCode and Color
but I don't think anyone will color each status code separately. Therefore: - I suggest adding status code groups to the existing map. That is, 2xx, 3xx, 4xx, 5xx. This will allow you to color individual groups of status codes in the required color, and the dio error will remain a separate map parameter, since we do not receive a status code with it.
Additionally. There are different architecture options and we do not always have a good backend or architecture of the project that we got. For example, if we receive a field validation error with status code 200, then according to the logic specified above, it will be drawn in the color that corresponds to 200 (and this is probably logical, I would say write good code). However, there are options to create your own color groups. That is, regardless of the logic of any of the architectures, the user will be able to create their own color group. This is an idea to think about in the future because it is difficult to imagine the implementation yet.