Merge pull request #2665 from 0xProject/smaller_log
Smaller logs (avoid circular buffers) + add a boolean to indicate if order was included in the salad or not
This commit is contained in:
commit
15ce90c0ec
@ -86,8 +86,29 @@ function hasExpectedAssetData(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function convertIfAxiosError(error: any): Error | object /* axios' .d.ts has AxiosError.toJSON() returning object */ {
|
function convertIfAxiosError(error: any): Error | object /* axios' .d.ts has AxiosError.toJSON() returning object */ {
|
||||||
if (error.hasOwnProperty('isAxiosError') && error.isAxiosError && error.hasOwnProperty('toJSON')) {
|
if (error.hasOwnProperty('isAxiosError') && error.isAxiosError) {
|
||||||
return error.toJSON();
|
const { message, name, config } = error;
|
||||||
|
const { headers, timeout, httpsAgent } = config;
|
||||||
|
const { keepAlive, keepAliveMsecs, sockets } = httpsAgent;
|
||||||
|
|
||||||
|
const socketCounts: { [key: string]: number } = {};
|
||||||
|
for (const socket of Object.keys(sockets)) {
|
||||||
|
socketCounts[socket] = sockets[socket].length;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
message,
|
||||||
|
name,
|
||||||
|
config: {
|
||||||
|
headers,
|
||||||
|
timeout,
|
||||||
|
httpsAgent: {
|
||||||
|
keepAlive,
|
||||||
|
keepAliveMsecs,
|
||||||
|
socketCounts,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@ -351,6 +372,7 @@ export class QuoteRequestor {
|
|||||||
rfqtMakerInteraction: {
|
rfqtMakerInteraction: {
|
||||||
...partialLogEntry,
|
...partialLogEntry,
|
||||||
response: {
|
response: {
|
||||||
|
included: true,
|
||||||
statusCode: response.status,
|
statusCode: response.status,
|
||||||
latencyMs: Date.now() - timeBeforeAwait,
|
latencyMs: Date.now() - timeBeforeAwait,
|
||||||
},
|
},
|
||||||
@ -362,6 +384,7 @@ export class QuoteRequestor {
|
|||||||
rfqtMakerInteraction: {
|
rfqtMakerInteraction: {
|
||||||
...partialLogEntry,
|
...partialLogEntry,
|
||||||
response: {
|
response: {
|
||||||
|
included: false,
|
||||||
statusCode: err.response ? err.response.status : undefined,
|
statusCode: err.response ? err.response.status : undefined,
|
||||||
latencyMs: Date.now() - timeBeforeAwait,
|
latencyMs: Date.now() - timeBeforeAwait,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user