Skip to content

Commit

Permalink
DAOS-623 ddb: Add line numbers to error prints (#15902)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Olivier <[email protected]>
  • Loading branch information
jolivier23 authored Feb 19, 2025
1 parent afe4396 commit 30fc716
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/utils/ddb/ddb_common.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* (C) Copyright 2019-2022 Intel Corporation.
* (C) Copyright 2025 Google LLC
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -35,11 +36,13 @@
else \
printf(str); } while (0)

#define ddb_errorf(ctx, fmt, ...) \
do { if ((ctx)->dc_io_ft.ddb_print_error) \
(ctx)->dc_io_ft.ddb_print_error(fmt, __VA_ARGS__); \
else \
printf(fmt, __VA_ARGS__); \
#define ddb_errorf(ctx, fmt, ...) \
do { \
if ((ctx)->dc_io_ft.ddb_print_error) \
(ctx)->dc_io_ft.ddb_print_error("At %s:%d: " fmt, __FILE__, __LINE__, \
__VA_ARGS__); \
else \
printf("At %s:%d: " fmt, __FILE__, __LINE__, __VA_ARGS__); \
} while (0)

struct argv_parsed {
Expand Down

0 comments on commit 30fc716

Please sign in to comment.