You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And now you can't use this parameter from the outside. For example, like this:
conn = Faraday.new(url: 'http:/hello') do |faraday|
faraday.response :logger, MyLogger.new($stdout, progname: 'my_best_program')
end
The log will still remain the same:
I, [2024-12-03T18:34:44.550323 #2735645] INFO -- : request: GET http:/hello
I, [2024-12-03T18:34:44.550353 #2735645] INFO -- : request: User-Agent: "Faraday v2.12.1"
I, [2024-12-03T18:34:44.550427 #2735645] INFO -- : response: Status 200
I, [2024-12-03T18:34:44.550435 #2735645] INFO -- : response: Content-Type: "text/html"
It seems to me it is better to transfer the message type from progname to the message body. And then this parameter will be used in the log:
I, [2024-12-03T18:35:01.582513 #2736044] INFO -- my_best_program: request: GET http:/hello
I, [2024-12-03T18:35:01.582543 #2736044] INFO -- my_best_program: request: User-Agent: "Faraday v2.12.1"
I, [2024-12-03T18:35:01.582619 #2736044] INFO -- my_best_program: response: Status 200
I, [2024-12-03T18:35:01.582628 #2736044] INFO -- my_best_program: response: Content-Type: "text/html"
This is necessary when several logs are recorded in one place (for example, in one file), and then you can easily separate some logger entries from others by parameter progname.
The text was updated successfully, but these errors were encountered:
Basic Info
Issue description
Now the logger uses the
progname
parameter as the message type. For example, here:https://docs.ruby-lang.org/en/master/Logger.html#method-i-info
And now you can't use this parameter from the outside. For example, like this:
The log will still remain the same:
It seems to me it is better to transfer the message type from
progname
to the message body. And then this parameter will be used in the log:This is necessary when several logs are recorded in one place (for example, in one file), and then you can easily separate some logger entries from others by parameter
progname
.The text was updated successfully, but these errors were encountered: