[#9] scenarios: Unify error log entries

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-02-16 18:58:45 +03:00 committed by fyrchik
parent 4ea872d6c3
commit 9212cefb0e
3 changed files with 8 additions and 8 deletions

View file

@ -118,7 +118,7 @@ export function obj_write() {
const { payload, hash } = generator.genPayload(registry_enabled);
const resp = grpc_client.put(container, headers, payload);
if (!resp.success) {
log.withField("cid", container).info(resp.error);
log.withField("cid", container).error(resp.error);
return;
}
@ -135,7 +135,7 @@ export function obj_read() {
const obj = obj_list[Math.floor(Math.random() * obj_list.length)];
const resp = grpc_client.get(obj.container, obj.object)
if (!resp.success) {
log.withFields({cid: obj.container, oid: obj.object}).info(resp.error);
log.withFields({cid: obj.container, oid: obj.object}).error(resp.error);
}
}
@ -152,7 +152,7 @@ export function obj_delete() {
const resp = grpc_client.delete(obj.c_id, obj.o_id);
if (!resp.success) {
// Log errors except (2052 - object already deleted)
log.withFields({cid: obj.c_id, oid: obj.o_id}).info(resp.error);
log.withFields({cid: obj.c_id, oid: obj.o_id}).error(resp.error);
return;
}

View file

@ -87,7 +87,7 @@ export function obj_write() {
const resp = http.post(`http://${http_endpoint}/upload/${container}`, data);
if (resp.status != 200) {
log.info(`ERROR: ${resp.status} ${resp.error}`);
log.withFields({status: resp.status, cid: container}).error(resp.error);
return;
}
const object_id = JSON.parse(resp.body).object_id;
@ -104,7 +104,7 @@ export function obj_read() {
const obj = obj_list[Math.floor(Math.random() * obj_list.length)];
const resp = http.get(`http://${http_endpoint}/get/${obj.container}/${obj.object}`);
if (resp.status != 200) {
log.info(`ERROR reading ${obj.object}: ${resp.status}`);
log.withFields({status: resp.status, cid: obj.container, oid: obj.object}).error(resp.error);
}
}

View file

@ -114,7 +114,7 @@ export function obj_write() {
const { payload, hash } = generator.genPayload(registry_enabled);
const resp = s3_client.put(bucket, key, payload);
if (!resp.success) {
log.info(resp.error);
log.withFields({bucket: bucket, key: key}).error(resp.error);
return;
}
@ -132,7 +132,7 @@ export function obj_read() {
const resp = s3_client.get(obj.bucket, obj.object);
if (!resp.success) {
log.info(resp.error);
log.withFields({bucket: obj.bucket, key: obj.object}).error(resp.error);
}
}
@ -148,7 +148,7 @@ export function obj_delete() {
const resp = s3_client.delete(obj.s3_bucket, obj.s3_key);
if (!resp.success) {
log.info(`Error deleting object ${obj.id}: ${resp.error}`);
log.withFields({bucket: obj.s3_bucket, key: obj.s3_key, op: "DELETE"}).error(resp.error);
return;
}