DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: "Thomas Monjalon" <thomas@monjalon.net>,
	"Nicolas Chautru" <nicolas.chautru@intel.com>,
	"Gagandeep Singh" <g.singh@nxp.com>,
	"Hemant Agrawal" <hemant.agrawal@nxp.com>,
	"Parav Pandit" <parav@nvidia.com>,
	"Xueming Li" <xuemingl@nvidia.com>,
	"Nipun Gupta" <nipun.gupta@amd.com>,
	"Nikhil Agarwal" <nikhil.agarwal@amd.com>,
	"Sachin Saxena" <sachin.saxena@nxp.com>,
	"Rosen Xu" <rosen.xu@intel.com>,
	"Tomasz Duszynski" <tduszynski@marvell.com>,
	"Chengwen Feng" <fengchengwen@huawei.com>,
	"Long Li" <longli@microsoft.com>, "Wei Hu" <weh@microsoft.com>,
	"Nithin Dabilpuram" <ndabilpuram@marvell.com>,
	"Kiran Kumar K" <kirankumark@marvell.com>,
	"Sunil Kumar Kori" <skori@marvell.com>,
	"Satha Rao" <skoteshwar@marvell.com>,
	"Harman Kalra" <hkalra@marvell.com>,
	"Anoob Joseph" <anoobj@marvell.com>,
	"Jingjing Wu" <jingjing.wu@intel.com>,
	"Chaoyong He" <chaoyong.he@corigine.com>,
	"Nagadheeraj Rottela" <rnagadheeraj@marvell.com>,
	"Srikanth Jampala" <jsrikanth@marvell.com>,
	"Kai Ji" <kai.ji@intel.com>,
	"Andrew Rybchenko" <andrew.rybchenko@oktetlabs.ru>,
	"Lee Daly" <lee.daly@intel.com>,
	"Pablo de Lara" <pablo.de.lara.guarch@intel.com>,
	"Fan Zhang" <fanzhang.oss@gmail.com>,
	"Ashish Gupta" <ashish.gupta@marvell.com>,
	"Zhangfei Gao" <zhangfei.gao@linaro.org>,
	"Sunila Sahu" <ssahu@marvell.com>,
	"Jack Bond-Preston" <jack.bond-preston@foss.arm.com>,
	"Ajit Khaparde" <ajit.khaparde@broadcom.com>,
	"Raveendra Padasalagi" <raveendra.padasalagi@broadcom.com>,
	"Vikas Gupta" <vikas.gupta@broadcom.com>,
	"Michael Shamis" <michaelsh@marvell.com>,
	"Liron Himi" <lironh@marvell.com>,
	"Jay Zhou" <jianjay.zhou@huawei.com>,
	"Bruce Richardson" <bruce.richardson@intel.com>,
	"Kevin Laatz" <kevin.laatz@intel.com>,
	"Conor Walsh" <conor.walsh@intel.com>,
	"Gowrishankar Muthukrishnan" <gmuthukrishn@marvell.com>,
	"Vidya Sagar Velumuri" <vvelumuri@marvell.com>,
	"Mattias Rönnblom" <mattias.ronnblom@ericsson.com>,
	"Jerin Jacob" <jerinj@marvell.com>,
	"Pavan Nikhilesh" <pbhagavatula@marvell.com>,
	"Liang Ma" <liangma@liangbit.com>,
	"Peter Mccarthy" <peter.mccarthy@intel.com>,
	"Harry van Haaren" <harry.van.haaren@intel.com>,
	"Elena Agostini" <eagostini@nvidia.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	"Ciara Loftus" <ciara.loftus@intel.com>,
	"Maryam Tahhan" <mtahhan@redhat.com>,
	"Igor Russkikh" <irusskikh@marvell.com>,
	"Steven Webster" <steven.webster@windriver.com>,
	"Matt Peters" <matt.peters@windriver.com>,
	"Selwin Sebastian" <selwin.sebastian@amd.com>,
	"Julien Aube" <julien_dpdk@jaube.fr>,
	"Somnath Kotur" <somnath.kotur@broadcom.com>,
	"Wathsala Vithanage" <wathsala.vithanage@arm.com>,
	"Konstantin Ananyev" <konstantin.v.ananyev@yandex.ru>,
	"Shai Brandes" <shaibran@amazon.com>,
	"Evgeny Schemeilin" <evgenys@amazon.com>,
	"Ron Beider" <rbeider@amazon.com>,
	"Amit Bernstein" <amitbern@amazon.com>,
	"Wajeeh Atrash" <atrwajee@amazon.com>,
	"Apeksha Gupta" <apeksha.gupta@nxp.com>,
	"John Daley" <johndale@cisco.com>,
	"Hyong Youb Kim" <hyonkim@cisco.com>,
	"Gaetan Rivet" <grive@u256.net>,
	"Jeroen de Borst" <jeroendb@google.com>,
	"Rushil Gupta" <rushilg@google.com>,
	"Joshua Washington" <joshwash@google.com>,
	"Ziyang Xuan" <xuanziyang2@huawei.com>,
	"Xiaoyun Wang" <cloud.wangxiaoyun@huawei.com>,
	"Jie Hai" <haijie1@huawei.com>,
	"Yisen Zhuang" <yisen.zhuang@huawei.com>,
	"Jakub Grajciar" <jgrajcia@cisco.com>,
	"Matan Azrad" <matan@nvidia.com>,
	"Viacheslav Ovsiienko" <viacheslavo@nvidia.com>,
	"Zyta Szpak" <zr@semihalf.com>,
	"Martin Spinler" <spinler@cesnet.cz>,
	"Jiawen Wu" <jiawenwu@trustnetic.com>,
	"Tetsuya Mukawa" <mtetsuyah@gmail.com>,
	"Vamsi Attunuru" <vattunuru@marvell.com>,
	"Cristian Dumitrescu" <cristian.dumitrescu@intel.com>,
	"Stephen Hemminger" <stephen@networkplumber.org>,
	"Maciej Czekaj" <mczekaj@marvell.com>,
	"Jian Wang" <jianwang@trustnetic.com>,
	"Maxime Coquelin" <maxime.coquelin@redhat.com>,
	"Chenbo Xia" <chenbox@nvidia.com>,
	"Jochen Behrens" <jochen.behrens@broadcom.com>,
	"Jakub Palider" <jpalider@marvell.com>
Subject: [PATCH 11/11] drivers: use per line logging in helpers
Date: Sat,  7 Sep 2024 16:54:31 +0200	[thread overview]
Message-ID: <20240907145433.1479091-12-david.marchand@redhat.com> (raw)
In-Reply-To: <20240907145433.1479091-1-david.marchand@redhat.com>

Use RTE_LOG_LINE in existing macros that append a \n.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/checkpatches.sh                      | 11 +++-
 drivers/baseband/acc/acc100_pmd.h             | 12 ++--
 drivers/baseband/acc/acc_common.h             |  6 +-
 drivers/baseband/acc/rte_acc100_pmd.c         |  1 +
 drivers/baseband/acc/rte_vrb_pmd.c            |  1 +
 drivers/baseband/acc/vrb_pmd.h                | 12 ++--
 .../baseband/fpga_5gnr_fec/fpga_5gnr_fec.h    | 15 ++---
 drivers/baseband/fpga_lte_fec/fpga_lte_fec.c  | 13 ++--
 .../baseband/la12xx/bbdev_la12xx_pmd_logs.h   | 16 +++--
 drivers/baseband/null/bbdev_null.c            |  5 +-
 .../baseband/turbo_sw/bbdev_turbo_software.c  |  6 +-
 drivers/bus/auxiliary/private.h               |  5 +-
 drivers/bus/cdx/cdx_logs.h                    |  7 +--
 drivers/bus/dpaa/include/fman.h               |  3 +-
 drivers/bus/dpaa/rte_dpaa_logs.h              |  6 +-
 drivers/bus/fslmc/fslmc_logs.h                |  7 +--
 drivers/bus/ifpga/ifpga_logs.h                |  3 +-
 drivers/bus/platform/private.h                |  3 +-
 drivers/bus/uacce/uacce.c                     |  4 +-
 drivers/bus/vdev/vdev_logs.h                  |  3 +-
 drivers/bus/vmbus/private.h                   |  3 +-
 drivers/common/cnxk/roc_platform.h            | 31 +++++++---
 drivers/common/cpt/cpt_pmd_logs.h             | 15 +++--
 drivers/common/dpaax/dpaax_logs.h             |  6 +-
 drivers/common/idpf/idpf_common_logs.h        | 26 +++-----
 drivers/common/nfp/nfp_common_log.h           |  5 +-
 drivers/common/nitrox/nitrox_logs.h           |  2 +-
 drivers/common/octeontx/octeontx_mbox.h       |  5 +-
 drivers/common/qat/qat_logs.h                 |  8 +--
 drivers/common/sfc_efx/sfc_efx_log.h          |  5 +-
 .../compress/isal/isal_compress_pmd_private.h |  3 +-
 drivers/compress/octeontx/otx_zip.h           |  5 +-
 .../compress/uadk/uadk_compress_pmd_private.h |  5 +-
 drivers/compress/zlib/zlib_pmd_private.h      |  3 +-
 drivers/crypto/armv8/armv8_pmd_private.h      | 16 +++--
 drivers/crypto/bcmfs/bcmfs_logs.h             | 10 ++--
 drivers/crypto/caam_jr/caam_jr_log.h          |  8 +--
 drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h     |  8 +--
 drivers/crypto/dpaa_sec/dpaa_sec_log.h        |  6 +-
 drivers/crypto/ipsec_mb/ipsec_mb_private.h    |  5 +-
 drivers/crypto/mvsam/mrvl_pmd_private.h       |  5 +-
 drivers/crypto/null/null_crypto_pmd_private.h |  5 +-
 drivers/crypto/openssl/openssl_pmd_private.h  |  5 +-
 .../crypto/scheduler/scheduler_pmd_private.h  |  5 +-
 drivers/crypto/uadk/uadk_crypto_pmd_private.h |  5 +-
 drivers/crypto/virtio/virtio_logs.h           | 30 ++++++----
 drivers/dma/dpaa/dpaa_qdma_logs.h             |  8 +--
 drivers/dma/dpaa2/dpaa2_qdma_logs.h           | 10 ++--
 drivers/dma/hisilicon/hisi_dmadev.c           | 17 +++---
 drivers/dma/idxd/idxd_internal.h              |  5 +-
 drivers/dma/ioat/ioat_internal.h              |  5 +-
 drivers/dma/odm/odm.h                         | 11 ++--
 drivers/dma/skeleton/skeleton_dmadev.c        |  3 +-
 drivers/event/dpaa/dpaa_eventdev.c            |  1 +
 drivers/event/dpaa/dpaa_eventdev.h            |  2 +-
 drivers/event/dpaa2/dpaa2_eventdev_logs.h     |  7 +--
 drivers/event/dsw/dsw_evdev.h                 |  2 +-
 drivers/event/octeontx/ssovf_evdev.h          |  5 +-
 drivers/event/octeontx/timvf_evdev.h          |  5 +-
 drivers/event/opdl/opdl_log.h                 |  9 +--
 drivers/event/skeleton/skeleton_eventdev.h    |  7 +--
 drivers/event/sw/sw_evdev_log.h               |  3 +-
 drivers/gpu/cuda/common.h                     |  3 +-
 drivers/mempool/dpaa/dpaa_mempool.h           |  3 +-
 drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h |  6 +-
 drivers/mempool/octeontx/octeontx_pool_logs.h |  5 +-
 drivers/net/af_packet/rte_eth_af_packet.c     |  9 +--
 drivers/net/af_xdp/rte_eth_af_xdp.c           |  2 +-
 drivers/net/atlantic/atl_logs.h               | 16 +++--
 drivers/net/avp/avp_logs.h                    |  6 +-
 drivers/net/axgbe/axgbe_logs.h                |  6 +-
 drivers/net/bnx2x/bnx2x_logs.h                | 25 ++++----
 drivers/net/bnxt/bnxt.h                       |  2 +-
 drivers/net/bnxt/bnxt_rxtx_vec_neon.c         |  4 +-
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c          |  4 +-
 drivers/net/bnxt/bnxt_txr.c                   |  4 +-
 drivers/net/cpfl/cpfl_logs.h                  | 12 ++--
 drivers/net/dpaa/dpaa_ethdev.h                |  4 +-
 drivers/net/dpaa2/dpaa2_pmd_logs.h            | 10 ++--
 drivers/net/dpaa2/dpaa2_rxtx.c                | 30 +++++-----
 drivers/net/e1000/e1000_logs.h                | 14 ++---
 drivers/net/ena/ena_logs.h                    |  8 +--
 drivers/net/ena/ena_platform.h                |  2 +-
 drivers/net/enetc/enetc_logs.h                | 10 ++--
 drivers/net/enetfec/enet_pmd_logs.h           |  7 +--
 drivers/net/enic/enic_compat.h                |  5 +-
 drivers/net/failsafe/failsafe_private.h       |  7 +--
 drivers/net/fm10k/fm10k_logs.h                | 18 +++---
 drivers/net/gve/gve_logs.h                    |  4 +-
 drivers/net/hinic/base/hinic_compat.h         |  5 +-
 drivers/net/hns3/hns3_logs.h                  | 25 ++++----
 drivers/net/i40e/i40e_logs.h                  | 18 +++---
 drivers/net/iavf/iavf_log.h                   | 21 +++----
 drivers/net/ice/ice_logs.h                    | 18 +++---
 drivers/net/idpf/idpf_logs.h                  | 17 +++---
 drivers/net/igc/igc_logs.h                    | 12 ++--
 drivers/net/ipn3ke/ipn3ke_logs.h              |  4 +-
 drivers/net/ixgbe/ixgbe_logs.h                | 18 +++---
 drivers/net/mana/mana.h                       |  7 ++-
 drivers/net/memif/rte_eth_memif.h             |  5 +-
 drivers/net/mlx4/mlx4_utils.h                 |  9 +--
 drivers/net/mvneta/mvneta_ethdev.h            |  4 +-
 drivers/net/mvpp2/mrvl_ethdev.h               |  3 +-
 drivers/net/netvsc/hn_logs.h                  | 14 ++---
 drivers/net/netvsc/hn_rndis.c                 | 60 +++++++++----------
 drivers/net/nfb/nfb.h                         |  4 +-
 drivers/net/nfp/nfp_logs.h                    | 20 +++----
 drivers/net/ngbe/ngbe_logs.h                  | 20 ++++---
 drivers/net/null/rte_eth_null.c               |  5 +-
 drivers/net/octeon_ep/otx_ep_common.h         | 12 ++--
 drivers/net/octeon_ep/otx_ep_rxtx.c           |  4 +-
 drivers/net/octeontx/octeontx_logs.h          | 16 ++---
 drivers/net/pcap/pcap_osdep.h                 |  5 +-
 drivers/net/pfe/pfe_logs.h                    |  7 +--
 drivers/net/ring/rte_eth_ring.c               |  5 +-
 drivers/net/softnic/rte_eth_softnic.c         |  5 +-
 drivers/net/tap/tap_log.h                     |  3 +-
 drivers/net/thunderx/nicvf_logs.h             | 12 ++--
 drivers/net/txgbe/txgbe_logs.h                | 26 ++++----
 drivers/net/vdev_netvsc/vdev_netvsc.c         |  6 +-
 drivers/net/vhost/rte_eth_vhost.c             |  3 +-
 drivers/net/virtio/virtio_logs.h              | 13 ++--
 drivers/net/vmxnet3/vmxnet3_logs.h            | 14 ++---
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h          |  4 +-
 drivers/raw/cnxk_gpio/cnxk_gpio.h             |  3 +-
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h    | 10 ++--
 drivers/raw/ifpga/ifpga_rawdev.h              |  3 +-
 drivers/raw/ntb/ntb.h                         |  3 +-
 drivers/raw/skeleton/skeleton_rawdev.h        |  3 +-
 drivers/raw/skeleton/skeleton_rawdev_test.c   |  2 +-
 drivers/vdpa/ifc/base/ifcvf.c                 | 10 ++--
 drivers/vdpa/ifc/ifcvf_vdpa.c                 |  5 +-
 drivers/vdpa/nfp/nfp_vdpa_log.h               | 10 ++--
 133 files changed, 596 insertions(+), 572 deletions(-)

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 8f245ebdab..0ab841bd5a 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -53,7 +53,7 @@ print_usage () {
 check_forbidden_additions() { # <patch>
 	res=0
 
-	# refrain from new calls to RTE_LOG
+	# refrain from new calls to RTE_LOG in libraries
 	awk -v FOLDERS="lib" \
 		-v EXPRESSIONS="RTE_LOG\\\(" \
 		-v RET_ON_FAIL=1 \
@@ -61,6 +61,15 @@ check_forbidden_additions() { # <patch>
 		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
 		"$1" || res=1
 
+	# refrain from new calls to RTE_LOG in drivers (but leave some leeway for base drivers)
+	awk -v FOLDERS="drivers" \
+		-v SKIP_FILES='osdep.h$' \
+		-v EXPRESSIONS="RTE_LOG\\\( RTE_LOG_DP\\\( rte_log\\\(" \
+		-v RET_ON_FAIL=1 \
+		-v MESSAGE='Prefer RTE_LOG_LINE/RTE_LOG_DP_LINE' \
+		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+		"$1" || res=1
+
 	# no output on stdout or stderr
 	awk -v FOLDERS="lib drivers" \
 		-v EXPRESSIONS="\\\<printf\\\> \\\<fprintf\\\(stdout, \\\<fprintf\\\(stderr," \
diff --git a/drivers/baseband/acc/acc100_pmd.h b/drivers/baseband/acc/acc100_pmd.h
index aff1ef89f2..976593698e 100644
--- a/drivers/baseband/acc/acc100_pmd.h
+++ b/drivers/baseband/acc/acc100_pmd.h
@@ -11,16 +11,14 @@
 #include "acc_common.h"
 
 /* Helper macro for logging */
-#define rte_bbdev_log(level, fmt, ...) \
-	rte_log(RTE_LOG_ ## level, acc100_logtype, fmt "\n", \
-		##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+	RTE_LOG_LINE(level, ACC100, __VA_ARGS__)
 
 #ifdef RTE_LIBRTE_BBDEV_DEBUG
-#define rte_bbdev_log_debug(fmt, ...) \
-		rte_bbdev_log(DEBUG, "acc100_pmd: " fmt, \
-		##__VA_ARGS__)
+#define rte_bbdev_log_debug(...) \
+	rte_bbdev_log(DEBUG, __VA_ARGS__)
 #else
-#define rte_bbdev_log_debug(fmt, ...)
+#define rte_bbdev_log_debug(...)
 #endif
 
 /* ACC100 PF and VF driver names */
diff --git a/drivers/baseband/acc/acc_common.h b/drivers/baseband/acc/acc_common.h
index e249f37e38..f8afa46e91 100644
--- a/drivers/baseband/acc/acc_common.h
+++ b/drivers/baseband/acc/acc_common.h
@@ -151,11 +151,11 @@
 #define ACC_MAX_FFT_WIN      16
 
 extern int acc_common_logtype;
+#define RTE_LOGTYPE_ACC_COMMON acc_common_logtype
 
 /* Helper macro for logging */
-#define rte_acc_log(level, fmt, ...) \
-	rte_log(RTE_LOG_ ## level, acc_common_logtype, fmt "\n", \
-		##__VA_ARGS__)
+#define rte_acc_log(level, ...) \
+	RTE_LOG_LINE(level, ACC_COMMON, __VA_ARGS__)
 
 /* ACC100 DMA Descriptor triplet */
 struct acc_dma_triplet {
diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
index 5c91acab7e..2d021710a7 100644
--- a/drivers/baseband/acc/rte_acc100_pmd.c
+++ b/drivers/baseband/acc/rte_acc100_pmd.c
@@ -30,6 +30,7 @@ RTE_LOG_REGISTER_SUFFIX(acc100_logtype, acc100, DEBUG);
 #else
 RTE_LOG_REGISTER_SUFFIX(acc100_logtype, acc100, NOTICE);
 #endif
+#define RTE_LOGTYPE_ACC100 acc100_logtype
 
 /* Calculate the offset of the enqueue register */
 static inline uint32_t
diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c
index fad984ccc1..88075df8b4 100644
--- a/drivers/baseband/acc/rte_vrb_pmd.c
+++ b/drivers/baseband/acc/rte_vrb_pmd.c
@@ -26,6 +26,7 @@ RTE_LOG_REGISTER_SUFFIX(vrb_logtype, vrb, DEBUG);
 #else
 RTE_LOG_REGISTER_SUFFIX(vrb_logtype, vrb, NOTICE);
 #endif
+#define RTE_LOGTYPE_VRB vrb_logtype
 
 /* Calculate the offset of the enqueue register. */
 static inline uint32_t
diff --git a/drivers/baseband/acc/vrb_pmd.h b/drivers/baseband/acc/vrb_pmd.h
index 0371db9972..a4b81640e8 100644
--- a/drivers/baseband/acc/vrb_pmd.h
+++ b/drivers/baseband/acc/vrb_pmd.h
@@ -13,16 +13,14 @@
 #include "vrb_cfg.h"
 
 /* Helper macro for logging */
-#define rte_bbdev_log(level, fmt, ...) \
-	rte_log(RTE_LOG_ ## level, vrb_logtype, fmt "\n", \
-		##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+	RTE_LOG_LINE(level, VRB, __VA_ARGS__)
 
 #ifdef RTE_LIBRTE_BBDEV_DEBUG
-#define rte_bbdev_log_debug(fmt, ...) \
-		rte_bbdev_log(DEBUG, "vrb_pmd: " fmt, \
-		##__VA_ARGS__)
+#define rte_bbdev_log_debug(...) \
+	rte_bbdev_log(DEBUG, __VA_ARGS__)
 #else
-#define rte_bbdev_log_debug(fmt, ...)
+#define rte_bbdev_log_debug(...)
 #endif
 
 /* VRB1 PF and VF driver names */
diff --git a/drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h b/drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h
index 2246849025..10a19e4dec 100644
--- a/drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h
+++ b/drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h
@@ -11,17 +11,18 @@
 #include "agx100_pmd.h"
 #include "vc_5gnr_pmd.h"
 
+extern int fpga_5gnr_fec_logtype;
+#define RTE_LOGTYPE_FPGA_5GNR_FEC fpga_5gnr_fec_logtype
+
 /* Helper macro for logging */
-#define rte_bbdev_log(level, fmt, ...) \
-	rte_log(RTE_LOG_ ## level, fpga_5gnr_fec_logtype, fmt "\n", \
-		##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+	RTE_LOG_LINE(level, FPGA_5GNR_FEC, __VA_ARGS__)
 
 #ifdef RTE_LIBRTE_BBDEV_DEBUG
-#define rte_bbdev_log_debug(fmt, ...) \
-		rte_bbdev_log(DEBUG, "fpga_5gnr_fec: " fmt, \
-		##__VA_ARGS__)
+#define rte_bbdev_log_debug(...) \
+	rte_bbdev_log(DEBUG, __VA_ARGS__)
 #else
-#define rte_bbdev_log_debug(fmt, ...)
+#define rte_bbdev_log_debug(...)
 #endif
 
 /* FPGA 5GNR FEC driver names */
diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
index d9373a072d..eaffc35142 100644
--- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
+++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
@@ -25,18 +25,17 @@ RTE_LOG_REGISTER_DEFAULT(fpga_lte_fec_logtype, DEBUG);
 #else
 RTE_LOG_REGISTER_DEFAULT(fpga_lte_fec_logtype, NOTICE);
 #endif
+#define RTE_LOGTYPE_FPGA_LTE_FEC fpga_lte_fec_logtype
 
 /* Helper macro for logging */
-#define rte_bbdev_log(level, fmt, ...) \
-	rte_log(RTE_LOG_ ## level, fpga_lte_fec_logtype, fmt "\n", \
-		##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+	RTE_LOG_LINE(level, FPGA_LTE_FEC, __VA_ARGS__)
 
 #ifdef RTE_LIBRTE_BBDEV_DEBUG
-#define rte_bbdev_log_debug(fmt, ...) \
-		rte_bbdev_log(DEBUG, "fpga_lte_fec: " fmt, \
-		##__VA_ARGS__)
+#define rte_bbdev_log_debug(...) \
+	rte_bbdev_log(DEBUG, __VA_ARGS__)
 #else
-#define rte_bbdev_log_debug(fmt, ...)
+#define rte_bbdev_log_debug(...)
 #endif
 
 /* FPGA LTE FEC driver names */
diff --git a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
index 49c8d35d10..db935fb7f3 100644
--- a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
+++ b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h
@@ -8,22 +8,20 @@
 extern int bbdev_la12xx_logtype;
 #define RTE_LOGTYPE_BBDEV_LA12XX bbdev_la12xx_logtype
 
-#define rte_bbdev_log(level, fmt, ...) \
-	rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt "\n", \
-		##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+	RTE_LOG_LINE(level, BBDEV_LA12XX, __VA_ARGS__)
 
 #ifdef RTE_LIBRTE_BBDEV_DEBUG
-#define rte_bbdev_log_debug(fmt, ...) \
-		rte_bbdev_log(DEBUG, "la12xx_pmd: " fmt, \
-		##__VA_ARGS__)
+#define rte_bbdev_log_debug(...) \
+	rte_bbdev_log(DEBUG, __VA_ARGS__)
 #else
-#define rte_bbdev_log_debug(fmt, ...)
+#define rte_bbdev_log_debug(...)
 #endif
 
 #define PMD_INIT_FUNC_TRACE() rte_bbdev_log_debug(">>")
 
 /* DP Logs, toggled out at compile time if level lower than current level */
-#define rte_bbdev_dp_log(level, fmt, args...) \
-	RTE_LOG_DP(level, BBDEV_LA12XX, fmt, ## args)
+#define rte_bbdev_dp_log(level, ...) \
+	RTE_LOG_DP_LINE(level, BBDEV_LA12XX, __VA_ARGS__)
 
 #endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
diff --git a/drivers/baseband/null/bbdev_null.c b/drivers/baseband/null/bbdev_null.c
index 75f78993fa..dab416aa41 100644
--- a/drivers/baseband/null/bbdev_null.c
+++ b/drivers/baseband/null/bbdev_null.c
@@ -17,10 +17,11 @@
 #define DRIVER_NAME baseband_null
 
 RTE_LOG_REGISTER_DEFAULT(bbdev_null_logtype, NOTICE);
+#define RTE_LOGTYPE_BBDEV_NULL bbdev_null_logtype
 
 /* Helper macro for logging */
-#define rte_bbdev_log(level, fmt, ...) \
-	rte_log(RTE_LOG_ ## level, bbdev_null_logtype, fmt "\n", ##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+	RTE_LOG_LINE(level, BBDEV_NULL, __VA_ARGS__)
 
 #define rte_bbdev_log_debug(fmt, ...) \
 	rte_bbdev_log(DEBUG, RTE_STR(__LINE__) ":%s() " fmt, __func__, \
diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
index 1f661dd801..e527008524 100644
--- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c
+++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c
@@ -37,11 +37,11 @@
 #define DRIVER_NAME baseband_turbo_sw
 
 RTE_LOG_REGISTER_DEFAULT(bbdev_turbo_sw_logtype, NOTICE);
+#define RTE_LOGTYPE_BBDEV_TURBO_SW bbdev_turbo_sw_logtype
 
 /* Helper macro for logging */
-#define rte_bbdev_log(level, fmt, ...) \
-	rte_log(RTE_LOG_ ## level, bbdev_turbo_sw_logtype, fmt "\n", \
-		##__VA_ARGS__)
+#define rte_bbdev_log(level, ...) \
+	RTE_LOG_LINE(level, BBDEV_TURBO_SW, __VA_ARGS__)
 
 #define rte_bbdev_log_debug(fmt, ...) \
 	rte_bbdev_log(DEBUG, RTE_STR(__LINE__) ":%s() " fmt, __func__, \
diff --git a/drivers/bus/auxiliary/private.h b/drivers/bus/auxiliary/private.h
index 3dee13e1d1..5f5b3b1bbf 100644
--- a/drivers/bus/auxiliary/private.h
+++ b/drivers/bus/auxiliary/private.h
@@ -14,11 +14,10 @@
 #include "bus_auxiliary_driver.h"
 
 extern int auxiliary_bus_logtype;
+#define RTE_LOGTYPE_AUXILIARY_BUS auxiliary_bus_logtype
 
 #define AUXILIARY_LOG(level, ...) \
-	rte_log(RTE_LOG_ ## level, auxiliary_bus_logtype, \
-		RTE_FMT("auxiliary bus: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
-			RTE_FMT_TAIL(__VA_ARGS__,)))
+	RTE_LOG_LINE(level, AUXILIARY_BUS, ## __VA_ARGS__)
 
 /*
  * Structure describing the auxiliary bus
diff --git a/drivers/bus/cdx/cdx_logs.h b/drivers/bus/cdx/cdx_logs.h
index 0ec39e9dd4..66d6967dc6 100644
--- a/drivers/bus/cdx/cdx_logs.h
+++ b/drivers/bus/cdx/cdx_logs.h
@@ -6,15 +6,14 @@
 #define CDX_LOGS_H
 
 extern int cdx_logtype_bus;
+#define RTE_LOGTYPE_CDX_BUS cdx_logtype_bus
 
 #define CDX_BUS_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, cdx_logtype_bus, "cdx: " fmt "\n", \
-		##args)
+	RTE_LOG_LINE(level, CDX_BUS, fmt, ## args)
 
 /* Debug logs with Function names */
 #define CDX_BUS_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, cdx_logtype_bus, "cdx: %s(): " fmt "\n", \
-		__func__, ##args)
+	RTE_LOG_LINE(DEBUG, CDX_BUS, "%s(): " fmt, __func__, ## args)
 
 #define CDX_BUS_INFO(fmt, args...) \
 	CDX_BUS_LOG(INFO, fmt, ## args)
diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h
index 19f6132bba..f918836ec2 100644
--- a/drivers/bus/dpaa/include/fman.h
+++ b/drivers/bus/dpaa/include/fman.h
@@ -403,8 +403,7 @@ extern int fman_ccsr_map_fd;
 #define FMAN_ERR(rc, fmt, args...) \
 	do { \
 		_errno = (rc); \
-		rte_log(RTE_LOG_ERR, dpaa_logtype_bus, "dpaa: " fmt "(%d)\n", \
-			##args, errno); \
+		RTE_LOG_LINE(ERR, DPAA_BUS, fmt "(%d)", ##args, errno); \
 	} while (0)
 
 #define FMAN_IP_REV_1	0xC30C4
diff --git a/drivers/bus/dpaa/rte_dpaa_logs.h b/drivers/bus/dpaa/rte_dpaa_logs.h
index 149b127434..81b4e54f0e 100644
--- a/drivers/bus/dpaa/rte_dpaa_logs.h
+++ b/drivers/bus/dpaa/rte_dpaa_logs.h
@@ -10,9 +10,10 @@
 #include <rte_log.h>
 
 extern int dpaa_logtype_bus;
+#define RTE_LOGTYPE_DPAA_BUS dpaa_logtype_bus
 
 #define DPAA_BUS_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "dpaa: " fmt "\n", ##args)
+	RTE_LOG_LINE(level, DPAA_BUS, fmt, ## args)
 
 #ifdef RTE_LIBRTE_DPAA_DEBUG_BUS
 #define DPAA_BUS_HWWARN(cond, fmt, args...) \
@@ -25,8 +26,7 @@ extern int dpaa_logtype_bus;
 #endif
 
 #define DPAA_BUS_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, dpaa_logtype_bus, "dpaa: %s(): " fmt "\n", \
-		__func__, ##args)
+	RTE_LOG_LINE(DEBUG, DPAA_BUS, "%s(): " fmt, __func__, ## args)
 
 #define BUS_INIT_FUNC_TRACE() DPAA_BUS_DEBUG(" >>")
 
diff --git a/drivers/bus/fslmc/fslmc_logs.h b/drivers/bus/fslmc/fslmc_logs.h
index e15c603426..d34accf79f 100644
--- a/drivers/bus/fslmc/fslmc_logs.h
+++ b/drivers/bus/fslmc/fslmc_logs.h
@@ -8,15 +8,14 @@
 #define _FSLMC_LOGS_H_
 
 extern int dpaa2_logtype_bus;
+#define RTE_LOGTYPE_DPAA2_BUS dpaa2_logtype_bus
 
 #define DPAA2_BUS_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa2_logtype_bus, "fslmc: " fmt "\n", \
-		##args)
+	RTE_LOG_LINE(level, DPAA2_BUS, fmt, ## args)
 
 /* Debug logs are with Function names */
 #define DPAA2_BUS_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, dpaa2_logtype_bus, "fslmc: %s(): " fmt "\n", \
-		__func__, ##args)
+	RTE_LOG_LINE(DEBUG, DPAA2_BUS, "%s(): " fmt, __func__, ## args)
 
 #define DPAA2_BUS_INFO(fmt, args...) \
 	DPAA2_BUS_LOG(INFO, fmt, ## args)
diff --git a/drivers/bus/ifpga/ifpga_logs.h b/drivers/bus/ifpga/ifpga_logs.h
index 248bccba5d..f400bf85f1 100644
--- a/drivers/bus/ifpga/ifpga_logs.h
+++ b/drivers/bus/ifpga/ifpga_logs.h
@@ -8,9 +8,10 @@
 #include <rte_log.h>
 
 extern int ifpga_bus_logtype;
+#define RTE_LOGTYPE_IFPGA_BUS ifpga_bus_logtype
 
 #define IFPGA_BUS_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, ifpga_bus_logtype, "%s(): " fmt "\n", \
+	RTE_LOG_LINE(level, IFPGA_BUS, "%s(): " fmt, \
 		__func__, ##args)
 
 #define IFPGA_BUS_FUNC_TRACE() IFPGA_BUS_LOG(DEBUG, ">>")
diff --git a/drivers/bus/platform/private.h b/drivers/bus/platform/private.h
index 72185aa457..d89ba0e4a5 100644
--- a/drivers/bus/platform/private.h
+++ b/drivers/bus/platform/private.h
@@ -35,8 +35,7 @@ struct rte_platform_bus {
 extern int platform_bus_logtype;
 #define RTE_LOGTYPE_PLATFORM_BUS platform_bus_logtype
 #define PLATFORM_LOG_LINE(level, ...) \
-	RTE_LOG(level, PLATFORM_BUS, RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
-		RTE_FMT_TAIL(__VA_ARGS__,)))
+	RTE_LOG_LINE(level, PLATFORM_BUS, __VA_ARGS__)
 
 /*
  * Iterate registered platform devices and find one that matches provided string.
diff --git a/drivers/bus/uacce/uacce.c b/drivers/bus/uacce/uacce.c
index 8b666c4e30..8a6b0f84c3 100644
--- a/drivers/bus/uacce/uacce.c
+++ b/drivers/bus/uacce/uacce.c
@@ -59,9 +59,9 @@ static const char *const uacce_params_keys[] = {
 		RTE_TAILQ_FOREACH(p, &uacce_bus.driver_list, next)
 
 extern int uacce_bus_logtype;
+#define RTE_LOGTYPE_UACCE_BUS uacce_bus_logtype
 #define UACCE_BUS_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, uacce_bus_logtype, "uacce: " fmt "\n", \
-		##args)
+	RTE_LOG_LINE(level, UACCE_BUS, fmt, ##args)
 #define UACCE_BUS_ERR(fmt, args...) UACCE_BUS_LOG(ERR, fmt, ##args)
 #define UACCE_BUS_WARN(fmt, args...) UACCE_BUS_LOG(WARNING, fmt, ##args)
 #define UACCE_BUS_INFO(fmt, args...) UACCE_BUS_LOG(INFO, fmt, ##args)
diff --git a/drivers/bus/vdev/vdev_logs.h b/drivers/bus/vdev/vdev_logs.h
index 8759374193..f7ea09dd2c 100644
--- a/drivers/bus/vdev/vdev_logs.h
+++ b/drivers/bus/vdev/vdev_logs.h
@@ -8,9 +8,10 @@
 #include <rte_log.h>
 
 extern int vdev_logtype_bus;
+#define RTE_LOGTYPE_VDEV_BUS vdev_logtype_bus
 
 #define VDEV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, vdev_logtype_bus, "%s(): " fmt "\n", \
+	RTE_LOG_LINE(level, VDEV_BUS, "%s(): " fmt, \
 		__func__, ##args)
 
 #endif /* _VDEV_LOGS_H_ */
diff --git a/drivers/bus/vmbus/private.h b/drivers/bus/vmbus/private.h
index e33424675c..4585198375 100644
--- a/drivers/bus/vmbus/private.h
+++ b/drivers/bus/vmbus/private.h
@@ -34,8 +34,9 @@ extern struct rte_vmbus_bus rte_vmbus_bus;
 	RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.driver_list), next)
 
 extern int vmbus_logtype_bus;
+#define RTE_LOGTYPE_VMBUS_BUS vmbus_logtype_bus
 #define VMBUS_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, vmbus_logtype_bus, "%s(): " fmt "\n", \
+	RTE_LOG_LINE(level, VMBUS_BUS, "%s(): " fmt, \
 		__func__, ##args)
 
 struct vmbus_br {
diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index 658bafb935..882636ede6 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -260,27 +260,41 @@ plt_thread_is_valid(plt_thread_t thr)
 
 /* Log */
 extern int cnxk_logtype_base;
+#define RTE_LOGTYPE_base cnxk_logtype_base
 extern int cnxk_logtype_mbox;
+#define RTE_LOGTYPE_mbox cnxk_logtype_mbox
 extern int cnxk_logtype_cpt;
+#define RTE_LOGTYPE_cpt cnxk_logtype_cpt
 extern int cnxk_logtype_ml;
+#define RTE_LOGTYPE_ml cnxk_logtype_ml
 extern int cnxk_logtype_npa;
+#define RTE_LOGTYPE_npa cnxk_logtype_npa
 extern int cnxk_logtype_nix;
+#define RTE_LOGTYPE_nix cnxk_logtype_nix
 extern int cnxk_logtype_npc;
+#define RTE_LOGTYPE_npc cnxk_logtype_npc
 extern int cnxk_logtype_sso;
+#define RTE_LOGTYPE_sso cnxk_logtype_sso
 extern int cnxk_logtype_tim;
+#define RTE_LOGTYPE_tim cnxk_logtype_tim
 extern int cnxk_logtype_tm;
+#define RTE_LOGTYPE_tm cnxk_logtype_tm
 extern int cnxk_logtype_ree;
+#define RTE_LOGTYPE_ree cnxk_logtype_ree
 extern int cnxk_logtype_dpi;
+#define RTE_LOGTYPE_dpi cnxk_logtype_dpi
 extern int cnxk_logtype_rep;
+#define RTE_LOGTYPE_rep cnxk_logtype_rep
 extern int cnxk_logtype_esw;
+#define RTE_LOGTYPE_esw cnxk_logtype_esw
 
 #define RTE_LOGTYPE_CNXK cnxk_logtype_base
 
 #define plt_err(fmt, args...)                                                  \
-	RTE_LOG(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
-#define plt_info(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args)
-#define plt_warn(fmt, args...) RTE_LOG(WARNING, CNXK, fmt "\n", ##args)
-#define plt_print(fmt, args...) RTE_LOG(INFO, CNXK, fmt "\n", ##args)
+	RTE_LOG_LINE(ERR, CNXK, "%s():%u " fmt, __func__, __LINE__, ##args)
+#define plt_info(fmt, args...) RTE_LOG_LINE(INFO, CNXK, fmt, ##args)
+#define plt_warn(fmt, args...) RTE_LOG_LINE(WARNING, CNXK, fmt, ##args)
+#define plt_print(fmt, args...) RTE_LOG_LINE(INFO, CNXK, fmt, ##args)
 #define plt_dump(fmt, ...)      fprintf(stderr, fmt "\n", ##__VA_ARGS__)
 #define plt_dump_no_nl(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
 
@@ -288,8 +302,7 @@ extern int cnxk_logtype_esw;
  * Log debug message if given subsystem logging is enabled.
  */
 #define plt_dbg(subsystem, fmt, args...)                                       \
-	rte_log(RTE_LOG_DEBUG, cnxk_logtype_##subsystem,                       \
-		"[%s] %s():%u " fmt "\n", #subsystem, __func__, __LINE__,      \
+	RTE_LOG_LINE(DEBUG, subsystem,  "%s():%u " fmt, __func__, __LINE__,    \
 ##args)
 
 #define plt_base_dbg(fmt, ...)	plt_dbg(base, fmt, ##__VA_ARGS__)
@@ -309,11 +322,11 @@ extern int cnxk_logtype_esw;
 
 /* Datapath logs */
 #define plt_dp_err(fmt, args...)                                               \
-	RTE_LOG_DP(ERR, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+	RTE_LOG_DP_LINE(ERR, CNXK, "%s():%u " fmt, __func__, __LINE__, ##args)
 #define plt_dp_info(fmt, args...)                                              \
-	RTE_LOG_DP(INFO, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+	RTE_LOG_DP_LINE(INFO, CNXK, "%s():%u " fmt, __func__, __LINE__, ##args)
 #define plt_dp_dbg(fmt, args...)                                              \
-	RTE_LOG_DP(DEBUG, CNXK, "%s():%u " fmt "\n", __func__, __LINE__, ##args)
+	RTE_LOG_DP_LINE(DEBUG, CNXK, "%s():%u " fmt, __func__, __LINE__, ##args)
 
 #ifdef __cplusplus
 #define CNXK_PCI_ID(subsystem_dev, dev)                                        \
diff --git a/drivers/common/cpt/cpt_pmd_logs.h b/drivers/common/cpt/cpt_pmd_logs.h
index 3c109c1983..21ef409102 100644
--- a/drivers/common/cpt/cpt_pmd_logs.h
+++ b/drivers/common/cpt/cpt_pmd_logs.h
@@ -17,24 +17,23 @@
  */
 #define RTE_LOGTYPE_CPT CPT_LOGTYPE
 
-#define CPT_PMD_DRV_LOG_RAW(level, fmt, args...) \
-		rte_log(RTE_LOG_ ## level, CPT_LOGTYPE, \
-			"cpt: %s(): " fmt "\n", __func__, ##args)
+#define CPT_PMD_DRV_LOG(level, fmt, args...) \
+	RTE_LOG_LINE(level, CPT, "%s(): " fmt, __func__, ## args)
 
-#define CPT_PMD_INIT_FUNC_TRACE() CPT_PMD_DRV_LOG_RAW(DEBUG, " >>")
+#define CPT_PMD_INIT_FUNC_TRACE() CPT_PMD_DRV_LOG(DEBUG, " >>")
 
 #define CPT_LOG_INFO(fmt, args...) \
-	CPT_PMD_DRV_LOG_RAW(INFO, fmt, ## args)
+	CPT_PMD_DRV_LOG(INFO, fmt, ## args)
 #define CPT_LOG_WARN(fmt, args...) \
-	CPT_PMD_DRV_LOG_RAW(WARNING, fmt, ## args)
+	CPT_PMD_DRV_LOG(WARNING, fmt, ## args)
 #define CPT_LOG_ERR(fmt, args...) \
-	CPT_PMD_DRV_LOG_RAW(ERR, fmt, ## args)
+	CPT_PMD_DRV_LOG(ERR, fmt, ## args)
 
 /*
  * DP logs, toggled out at compile time if level lower than current level.
  */
 #define CPT_LOG_DP(level, fmt, args...) \
-	RTE_LOG_DP(level, CPT, fmt "\n", ## args)
+	RTE_LOG_DP_LINE(level, CPT, fmt, ## args)
 
 #define CPT_LOG_DP_DEBUG(fmt, args...) \
 	CPT_LOG_DP(DEBUG, fmt, ## args)
diff --git a/drivers/common/dpaax/dpaax_logs.h b/drivers/common/dpaax/dpaax_logs.h
index fe43bbc8f1..5ff1a10ce8 100644
--- a/drivers/common/dpaax/dpaax_logs.h
+++ b/drivers/common/dpaax/dpaax_logs.h
@@ -21,13 +21,11 @@ extern int dpaax_logger;
 #endif
 
 #define DPAAX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaax_logger, "dpaax: " fmt "\n", \
-		##args)
+	RTE_LOG_LINE(level, DPAAX_LOGGER, fmt, ## args)
 
 /* Debug logs are with Function names */
 #define DPAAX_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, dpaax_logger, "dpaax: %s():	 " fmt "\n", \
-		__func__, ##args)
+	RTE_LOG_LINE(DEBUG, DPAAX_LOGGER, "%s(): " fmt, __func__, ## args)
 
 #define DPAAX_INFO(fmt, args...) \
 	DPAAX_LOG(INFO, fmt, ## args)
diff --git a/drivers/common/idpf/idpf_common_logs.h b/drivers/common/idpf/idpf_common_logs.h
index 561836760c..eb28039725 100644
--- a/drivers/common/idpf/idpf_common_logs.h
+++ b/drivers/common/idpf/idpf_common_logs.h
@@ -11,35 +11,23 @@ extern int idpf_common_logtype;
 #define RTE_LOGTYPE_IDPF_COMMON idpf_common_logtype
 
 #define DRV_LOG(level, ...)					\
-	rte_log(RTE_LOG_ ## level,				\
-		idpf_common_logtype,				\
+	RTE_LOG_LINE(level,					\
+		IDPF_COMMON,					\
 		RTE_FMT("%s(): "				\
-			RTE_FMT_HEAD(__VA_ARGS__,) "\n",	\
+			RTE_FMT_HEAD(__VA_ARGS__,),		\
 			__func__,				\
 			RTE_FMT_TAIL(__VA_ARGS__,)))
 
 #ifdef RTE_LIBRTE_IDPF_DEBUG_RX
-#define RX_LOG(level, ...) \
-	RTE_LOG(level, \
-		IDPF_COMMON, \
-		RTE_FMT("%s(): " \
-			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
-			__func__, \
-			RTE_FMT_TAIL(__VA_ARGS__,)))
+#define RX_LOG(...) DRV_LOG(__VA_ARGS__)
 #else
-#define RX_LOG(level, fmt, args...) do { } while (0)
+#define RX_LOG(...) do {} while (0)
 #endif
 
 #ifdef RTE_LIBRTE_IDPF_DEBUG_TX
-#define TX_LOG(level, ...) \
-	RTE_LOG(level, \
-		IDPF_COMMON, \
-		RTE_FMT("%s(): " \
-			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
-			__func__, \
-			RTE_FMT_TAIL(__VA_ARGS__,)))
+#define TX_LOG(...) DRV_LOG(__VA_ARGS__)
 #else
-#define TX_LOG(level, fmt, args...) do { } while (0)
+#define TX_LOG(...) do {} while (0)
 #endif
 
 #endif /* _IDPF_COMMON_LOGS_H_ */
diff --git a/drivers/common/nfp/nfp_common_log.h b/drivers/common/nfp/nfp_common_log.h
index 066e38e688..4672e71a31 100644
--- a/drivers/common/nfp/nfp_common_log.h
+++ b/drivers/common/nfp/nfp_common_log.h
@@ -9,8 +9,9 @@
 #include <rte_log.h>
 
 extern int nfp_logtype_common;
+#define RTE_LOGTYPE_NFP_COMMON nfp_logtype_common
 #define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, nfp_logtype_common, \
-			"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, NFP_COMMON, \
+			"%s(): " fmt, __func__, ## args)
 
 #endif/* __NFP_COMMON_LOG_H__ */
diff --git a/drivers/common/nitrox/nitrox_logs.h b/drivers/common/nitrox/nitrox_logs.h
index 67964447eb..596d77a96e 100644
--- a/drivers/common/nitrox/nitrox_logs.h
+++ b/drivers/common/nitrox/nitrox_logs.h
@@ -8,6 +8,6 @@
 extern int nitrox_logtype;
 #define RTE_LOGTYPE_NITROX nitrox_logtype
 #define NITROX_LOG_LINE(level, fmt, args...) \
-	RTE_LOG(level, NITROX, "%s:%d " fmt "\n", __func__, __LINE__, ## args)
+	RTE_LOG_LINE(level, NITROX, "%s:%d " fmt, __func__, __LINE__, ## args)
 
 #endif /* _NITROX_LOGS_H_ */
diff --git a/drivers/common/octeontx/octeontx_mbox.h b/drivers/common/octeontx/octeontx_mbox.h
index ab4c010558..05255bc773 100644
--- a/drivers/common/octeontx/octeontx_mbox.h
+++ b/drivers/common/octeontx/octeontx_mbox.h
@@ -18,8 +18,8 @@
 
 
 #define MBOX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, octeontx_logtype_mbox,\
-			"%s() line %u: " fmt "\n", __func__, __LINE__, ## args)
+	RTE_LOG_LINE(level, OCTEONTX_MBOX,\
+			"%s() line %u: " fmt, __func__, __LINE__, ## args)
 
 #define mbox_log_info(fmt, ...) MBOX_LOG(INFO, fmt, ##__VA_ARGS__)
 #define mbox_log_dbg(fmt, ...) MBOX_LOG(DEBUG, fmt, ##__VA_ARGS__)
@@ -27,6 +27,7 @@
 #define mbox_func_trace mbox_log_dbg
 
 extern int octeontx_logtype_mbox;
+#define RTE_LOGTYPE_OCTEONTX_MBOX octeontx_logtype_mbox
 
 struct octeontx_mbox_hdr {
 	uint16_t vfid;  /* VF index or pf resource index local to the domain */
diff --git a/drivers/common/qat/qat_logs.h b/drivers/common/qat/qat_logs.h
index 2e4d3945cb..d7c796abe3 100644
--- a/drivers/common/qat/qat_logs.h
+++ b/drivers/common/qat/qat_logs.h
@@ -6,15 +6,15 @@
 #define _QAT_LOGS_H_
 
 extern int qat_gen_logtype;
+#define RTE_LOGTYPE_QAT_GEN qat_gen_logtype
 extern int qat_dp_logtype;
+#define RTE_LOGTYPE_QAT_DP qat_dp_logtype
 
 #define QAT_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, qat_gen_logtype,		\
-			"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, QAT_GEN, "%s(): " fmt, __func__, ## args)
 
 #define QAT_DP_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, qat_dp_logtype,		\
-			"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, QAT_DP, "%s(): " fmt, __func__, ## args)
 
 #define QAT_DP_HEXDUMP_LOG(level, title, buf, len)		\
 	qat_hexdump_log(RTE_LOG_ ## level, qat_dp_logtype, title, buf, len)
diff --git a/drivers/common/sfc_efx/sfc_efx_log.h b/drivers/common/sfc_efx/sfc_efx_log.h
index 1519ebdc17..b41ef3490b 100644
--- a/drivers/common/sfc_efx/sfc_efx_log.h
+++ b/drivers/common/sfc_efx/sfc_efx_log.h
@@ -12,11 +12,10 @@
 
 /** Generic driver log type */
 extern int sfc_efx_logtype;
+#define RTE_LOGTYPE_SFC_EFX sfc_efx_logtype
 
 /** Log message, add a prefix and a line break */
 #define SFC_EFX_LOG(level, ...) \
-	rte_log(RTE_LOG_ ## level, sfc_efx_logtype,			\
-		RTE_FMT("sfc_efx: " RTE_FMT_HEAD(__VA_ARGS__ ,) "\n",	\
-			RTE_FMT_TAIL(__VA_ARGS__ ,)))
+	RTE_LOG_LINE(level, SFC_EFX, ## __VA_ARGS__)
 
 #endif /* _SFC_EFX_LOG_H_ */
diff --git a/drivers/compress/isal/isal_compress_pmd_private.h b/drivers/compress/isal/isal_compress_pmd_private.h
index c713a5bb6c..6d93c2a9c0 100644
--- a/drivers/compress/isal/isal_compress_pmd_private.h
+++ b/drivers/compress/isal/isal_compress_pmd_private.h
@@ -9,8 +9,9 @@
 /**< ISA-L comp PMD device name */
 
 extern int isal_logtype_driver;
+#define RTE_LOGTYPE_ISAL_DRIVER isal_logtype_driver
 #define ISAL_PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, isal_logtype_driver, "%s(): "fmt "\n", \
+	RTE_LOG_LINE(level, ISAL_DRIVER, "%s(): "fmt, \
 			__func__, ##args)
 
 /* private data structure for each ISA-L compression device */
diff --git a/drivers/compress/octeontx/otx_zip.h b/drivers/compress/octeontx/otx_zip.h
index 7353fd4957..85547da8f8 100644
--- a/drivers/compress/octeontx/otx_zip.h
+++ b/drivers/compress/octeontx/otx_zip.h
@@ -18,6 +18,7 @@
 #include <zip_regs.h>
 
 extern int octtx_zip_logtype_driver;
+#define RTE_LOGTYPE_OCTTX_ZIP_DRIVER octtx_zip_logtype_driver
 
 /* ZIP VF Control/Status registers (CSRs): */
 /* VF_BAR0: */
@@ -77,9 +78,7 @@ extern int octtx_zip_logtype_driver;
 #define COMPRESSDEV_NAME_ZIP_PMD	compress_octeontx
 
 #define ZIP_PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, \
-	octtx_zip_logtype_driver, "%s(): "fmt "\n", \
-	__func__, ##args)
+	RTE_LOG_LINE(level, OCTTX_ZIP_DRIVER, "%s(): "fmt, __func__, ## args)
 
 #define ZIP_PMD_INFO(fmt, args...) \
 	ZIP_PMD_LOG(INFO, fmt, ## args)
diff --git a/drivers/compress/uadk/uadk_compress_pmd_private.h b/drivers/compress/uadk/uadk_compress_pmd_private.h
index b09569fb94..227831dede 100644
--- a/drivers/compress/uadk/uadk_compress_pmd_private.h
+++ b/drivers/compress/uadk/uadk_compress_pmd_private.h
@@ -27,10 +27,11 @@ struct  uadk_compress_xform {
 };
 
 extern int uadk_compress_logtype;
+#define RTE_LOGTYPE_UADK_COMPRESS uadk_compress_logtype
 
 #define UADK_LOG(level, fmt, ...)  \
-	rte_log(RTE_LOG_ ## level, uadk_compress_logtype,  \
-		"%s() line %u: " fmt "\n", __func__, __LINE__,  \
+	RTE_LOG_LINE(level, UADK_COMPRESS,  \
+		"%s() line %u: " fmt, __func__, __LINE__,  \
 		## __VA_ARGS__)
 
 #endif /* _UADK_COMPRESS_PMD_PRIVATE_H_ */
diff --git a/drivers/compress/zlib/zlib_pmd_private.h b/drivers/compress/zlib/zlib_pmd_private.h
index 46a33d4d1b..6bd3da4354 100644
--- a/drivers/compress/zlib/zlib_pmd_private.h
+++ b/drivers/compress/zlib/zlib_pmd_private.h
@@ -15,8 +15,9 @@
 #define DEF_MEM_LEVEL			8
 
 extern int zlib_logtype_driver;
+#define RTE_LOGTYPE_ZLIB_DRIVER zlib_logtype_driver
 #define ZLIB_PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, zlib_logtype_driver, "%s(): "fmt "\n", \
+	RTE_LOG_LINE(level, ZLIB_DRIVER, "%s(): "fmt, \
 			__func__, ##args)
 
 #define ZLIB_PMD_INFO(fmt, args...) \
diff --git a/drivers/crypto/armv8/armv8_pmd_private.h b/drivers/crypto/armv8/armv8_pmd_private.h
index c9bbcc2b74..e4955491b9 100644
--- a/drivers/crypto/armv8/armv8_pmd_private.h
+++ b/drivers/crypto/armv8/armv8_pmd_private.h
@@ -11,23 +11,21 @@
 /**< ARMv8 Crypto PMD device name */
 
 extern int crypto_armv8_log_type;
+#define RTE_LOGTYPE_CRYPTO_ARMV8 crypto_armv8_log_type
 
 #define ARMV8_CRYPTO_LOG_ERR(fmt, args...)			\
-	rte_log(RTE_LOG_ERR, crypto_armv8_log_type,		\
-			"[%s] %s() line %u: " fmt "\n",		\
-			RTE_STR(CRYPTODEV_NAME_ARMV8_PMD),	\
+	RTE_LOG_LINE(ERR, CRYPTO_ARMV8,				\
+			"%s() line %u: " fmt,			\
 			__func__, __LINE__, ## args)
 
 #define ARMV8_CRYPTO_LOG_INFO(fmt, args...)			\
-	rte_log(RTE_LOG_INFO, crypto_armv8_log_type,		\
-			"[%s] %s() line %u: " fmt "\n",		\
-			RTE_STR(CRYPTODEV_NAME_ARMV8_PMD),	\
+	RTE_LOG_LINE(INFO, CRYPTO_ARMV8,			\
+			"%s() line %u: " fmt,			\
 			__func__, __LINE__, ## args)
 
 #define ARMV8_CRYPTO_LOG_DBG(fmt, args...)			\
-	rte_log(RTE_LOG_DEBUG, crypto_armv8_log_type,		\
-			"[%s] %s() line %u: " fmt "\n",		\
-			RTE_STR(CRYPTODEV_NAME_ARMV8_PMD),	\
+	RTE_LOG_LINE(DEBUG, CRYPTO_ARMV8,			\
+			"%s() line %u: " fmt,			\
 			__func__, __LINE__, ## args)
 
 #define NBBY		8		/* Number of bits in a byte */
diff --git a/drivers/crypto/bcmfs/bcmfs_logs.h b/drivers/crypto/bcmfs/bcmfs_logs.h
index c03a49b75c..36b5fccb77 100644
--- a/drivers/crypto/bcmfs/bcmfs_logs.h
+++ b/drivers/crypto/bcmfs/bcmfs_logs.h
@@ -9,15 +9,17 @@
 #include <rte_log.h>
 
 extern int bcmfs_conf_logtype;
+#define RTE_LOGTYPE_BCMFS_CONF bcmfs_conf_logtype
 extern int bcmfs_dp_logtype;
+#define RTE_LOGTYPE_BCMFS_DP bcmfs_dp_logtype
 
 #define BCMFS_LOG(level, fmt, args...)		\
-	rte_log(RTE_LOG_ ## level, bcmfs_conf_logtype,		\
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, BCMFS_CONF,		\
+		"%s(): " fmt, __func__, ## args)
 
 #define BCMFS_DP_LOG(level, fmt, args...)		\
-	rte_log(RTE_LOG_ ## level, bcmfs_dp_logtype,		\
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, BCMFS_DP,		\
+		"%s(): " fmt, __func__, ## args)
 
 #define BCMFS_DP_HEXDUMP_LOG(level, title, buf, len)	\
 	bcmfs_hexdump_log(RTE_LOG_ ## level, bcmfs_dp_logtype, title, buf, len)
diff --git a/drivers/crypto/caam_jr/caam_jr_log.h b/drivers/crypto/caam_jr/caam_jr_log.h
index 8f6aa50e2a..0198da5d4d 100644
--- a/drivers/crypto/caam_jr/caam_jr_log.h
+++ b/drivers/crypto/caam_jr/caam_jr_log.h
@@ -11,12 +11,10 @@ extern int caam_jr_logtype;
 #define RTE_LOGTYPE_CAAM_JR caam_jr_logtype
 
 #define CAAM_JR_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, caam_jr_logtype, "caam_jr: " \
-		fmt "\n", ##args)
+	RTE_LOG_LINE(level, CAAM_JR, fmt, ## args)
 
 #define CAAM_JR_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, caam_jr_logtype, "caam_jr: %s(): " \
-		fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(DEBUG, CAAM_JR, "%s(): " fmt, __func__, ## args)
 
 #define PMD_INIT_FUNC_TRACE() CAAM_JR_DEBUG(" >>")
 
@@ -29,7 +27,7 @@ extern int caam_jr_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define CAAM_JR_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, CAAM_JR, fmt "\n", ## args)
+	RTE_LOG_DP_LINE(level, CAAM_JR, fmt, ## args)
 
 #define CAAM_JR_DP_DEBUG(fmt, args...) \
 	CAAM_JR_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
index ee69209504..2f17c07dc5 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h
@@ -12,12 +12,10 @@ extern int dpaa2_logtype_sec;
 #define RTE_LOGTYPE_DPAA2_SEC dpaa2_logtype_sec
 
 #define DPAA2_SEC_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa2_logtype_sec, "dpaa2_sec: " \
-		fmt "\n", ##args)
+	RTE_LOG_LINE(level, DPAA2_SEC, fmt, ## args)
 
 #define DPAA2_SEC_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, dpaa2_logtype_sec, "dpaa2_sec: %s(): " \
-		fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(DEBUG, DPAA2_SEC, "%s(): " fmt, __func__, ## args)
 
 #define PMD_INIT_FUNC_TRACE() DPAA2_SEC_DEBUG(">>")
 
@@ -30,7 +28,7 @@ extern int dpaa2_logtype_sec;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_SEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, DPAA2_SEC, fmt, ## args)
+	RTE_LOG_DP_LINE(level, DPAA2_SEC, fmt, ## args)
 
 #define DPAA2_SEC_DP_DEBUG(fmt, args...) \
 	DPAA2_SEC_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec_log.h b/drivers/crypto/dpaa_sec/dpaa_sec_log.h
index 60dbaee4ec..07ba73a7e0 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec_log.h
+++ b/drivers/crypto/dpaa_sec/dpaa_sec_log.h
@@ -12,12 +12,10 @@ extern int dpaa_logtype_sec;
 #define RTE_LOGTYPE_DPAA_SEC dpaa_logtype_sec
 
 #define DPAA_SEC_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa_logtype_sec, "dpaa_sec: " \
-		fmt "\n", ##args)
+	RTE_LOG_LINE(level, DPAA_SEC, fmt, ## args)
 
 #define DPAA_SEC_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, dpaa_logtype_sec, "dpaa_sec: %s(): " \
-		fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(DEBUG, DPAA_SEC, "%s(): " fmt, __func__, ## args)
 
 #define PMD_INIT_FUNC_TRACE() DPAA_SEC_DEBUG(" >>")
 
diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_private.h b/drivers/crypto/ipsec_mb/ipsec_mb_private.h
index d42acd913c..f0928ff14e 100644
--- a/drivers/crypto/ipsec_mb/ipsec_mb_private.h
+++ b/drivers/crypto/ipsec_mb/ipsec_mb_private.h
@@ -59,9 +59,10 @@ extern RTE_DEFINE_PER_LCORE(IMB_MGR *, mb_mgr);
 
 /** PMD LOGTYPE DRIVER, common to all PMDs */
 extern int ipsec_mb_logtype_driver;
+#define RTE_LOGTYPE_IPSEC_MB ipsec_mb_logtype_driver
 #define IPSEC_MB_LOG(level, fmt, ...)                                         \
-	rte_log(RTE_LOG_##level, ipsec_mb_logtype_driver,                     \
-		"%s() line %u: " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)
+	RTE_LOG_LINE(level, IPSEC_MB,                     \
+		"%s() line %u: " fmt, __func__, __LINE__, ##__VA_ARGS__)
 
 /** All supported device types */
 enum ipsec_mb_pmd_types {
diff --git a/drivers/crypto/mvsam/mrvl_pmd_private.h b/drivers/crypto/mvsam/mrvl_pmd_private.h
index 80ff229c1b..1f369a3164 100644
--- a/drivers/crypto/mvsam/mrvl_pmd_private.h
+++ b/drivers/crypto/mvsam/mrvl_pmd_private.h
@@ -14,10 +14,11 @@
 
 /** MRVL PMD LOGTYPE DRIVER */
 extern int mrvl_logtype_driver;
+#define RTE_LOGTYPE_MRVL_DRIVER mrvl_logtype_driver
 
 #define MRVL_LOG(level, fmt, ...) \
-	rte_log(RTE_LOG_ ## level, mrvl_logtype_driver, \
-			"%s() line %u: " fmt "\n", __func__, __LINE__, \
+	RTE_LOG_LINE(level, MRVL_DRIVER, \
+			"%s() line %u: " fmt, __func__, __LINE__, \
 					## __VA_ARGS__)
 
 /**
diff --git a/drivers/crypto/null/null_crypto_pmd_private.h b/drivers/crypto/null/null_crypto_pmd_private.h
index 645a68d1da..57c33369e2 100644
--- a/drivers/crypto/null/null_crypto_pmd_private.h
+++ b/drivers/crypto/null/null_crypto_pmd_private.h
@@ -9,10 +9,11 @@
 /**< Null crypto PMD device name */
 
 extern int null_logtype_driver;
+#define RTE_LOGTYPE_NULL_DRIVER null_logtype_driver
 
 #define NULL_LOG(level, fmt, ...)  \
-	rte_log(RTE_LOG_ ## level, null_logtype_driver,  \
-			"%s() line %u: "fmt "\n", __func__, __LINE__,  \
+	RTE_LOG_LINE(level, NULL_DRIVER,  \
+			"%s() line %u: "fmt, __func__, __LINE__,  \
 					## __VA_ARGS__)
 
 
diff --git a/drivers/crypto/openssl/openssl_pmd_private.h b/drivers/crypto/openssl/openssl_pmd_private.h
index a50e4d4918..e2bda1f1bc 100644
--- a/drivers/crypto/openssl/openssl_pmd_private.h
+++ b/drivers/crypto/openssl/openssl_pmd_private.h
@@ -23,9 +23,10 @@
 
 /** OPENSSL PMD LOGTYPE DRIVER */
 extern int openssl_logtype_driver;
+#define RTE_LOGTYPE_OPENSSL_DRIVER openssl_logtype_driver
 #define OPENSSL_LOG(level, fmt, ...)  \
-	rte_log(RTE_LOG_ ## level, openssl_logtype_driver,  \
-			"%s() line %u: " fmt "\n", __func__, __LINE__,  \
+	RTE_LOG_LINE(level, OPENSSL_DRIVER,  \
+			"%s() line %u: " fmt, __func__, __LINE__,  \
 					## __VA_ARGS__)
 
 /* Maximum length for digest (SHA-512 needs 64 bytes) */
diff --git a/drivers/crypto/scheduler/scheduler_pmd_private.h b/drivers/crypto/scheduler/scheduler_pmd_private.h
index 0f0a6b4a85..81c27f9492 100644
--- a/drivers/crypto/scheduler/scheduler_pmd_private.h
+++ b/drivers/crypto/scheduler/scheduler_pmd_private.h
@@ -15,10 +15,11 @@
 #define PER_WORKER_BUFF_SIZE			(256)
 
 extern int scheduler_logtype_driver;
+#define RTE_LOGTYPE_SCHEDULER_DRIVER scheduler_logtype_driver
 
 #define CR_SCHED_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, scheduler_logtype_driver,		\
-			"%s() line %u: "fmt "\n", __func__, __LINE__, ##args)
+	RTE_LOG_LINE(level, SCHEDULER_DRIVER,		\
+			"%s() line %u: "fmt, __func__, __LINE__, ##args)
 
 struct scheduler_worker {
 	uint8_t dev_id;
diff --git a/drivers/crypto/uadk/uadk_crypto_pmd_private.h b/drivers/crypto/uadk/uadk_crypto_pmd_private.h
index 7a35c94a4f..53f7c8a352 100644
--- a/drivers/crypto/uadk/uadk_crypto_pmd_private.h
+++ b/drivers/crypto/uadk/uadk_crypto_pmd_private.h
@@ -71,10 +71,11 @@ struct __rte_cache_aligned uadk_crypto_priv {
 };
 
 extern int uadk_crypto_logtype;
+#define RTE_LOGTYPE_UADK_CRYPTO uadk_crypto_logtype
 
 #define UADK_LOG(level, fmt, ...)  \
-	rte_log(RTE_LOG_ ## level, uadk_crypto_logtype,  \
-		"%s() line %u: " fmt "\n", __func__, __LINE__,  \
+	RTE_LOG_LINE(level, UADK_CRYPTO,  \
+		"%s() line %u: " fmt, __func__, __LINE__,  \
 		## __VA_ARGS__)
 
 #endif /* _UADK_CRYPTO_PMD_PRIVATE_H_ */
diff --git a/drivers/crypto/virtio/virtio_logs.h b/drivers/crypto/virtio/virtio_logs.h
index 1ee3819309..510be6624a 100644
--- a/drivers/crypto/virtio/virtio_logs.h
+++ b/drivers/crypto/virtio/virtio_logs.h
@@ -8,18 +8,20 @@
 #include <rte_log.h>
 
 extern int virtio_crypto_logtype_init;
+#define RTE_LOGTYPE_VIRTIO_CRYPTO_INIT virtio_crypto_logtype_init
 
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_init, \
-		"PMD: %s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, VIRTIO_CRYPTO_INIT, \
+		"%s(): " fmt, __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 extern int virtio_crypto_logtype_init;
+#define RTE_LOGTYPE_VIRTIO_CRYPTO_INIT virtio_crypto_logtype_init
 
 #define VIRTIO_CRYPTO_INIT_LOG_IMPL(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_init, \
-		"INIT: %s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, VIRTIO_CRYPTO_INIT, \
+		"%s(): " fmt, __func__, ##args)
 
 #define VIRTIO_CRYPTO_INIT_LOG_INFO(fmt, args...) \
 	VIRTIO_CRYPTO_INIT_LOG_IMPL(INFO, fmt, ## args)
@@ -31,10 +33,11 @@ extern int virtio_crypto_logtype_init;
 	VIRTIO_CRYPTO_INIT_LOG_IMPL(ERR, fmt, ## args)
 
 extern int virtio_crypto_logtype_session;
+#define RTE_LOGTYPE_VIRTIO_CRYPTO_SESSION virtio_crypto_logtype_session
 
 #define VIRTIO_CRYPTO_SESSION_LOG_IMPL(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_session, \
-		"SESSION: %s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, VIRTIO_CRYPTO_SESSION, \
+		"%s(): " fmt, __func__, ##args)
 
 #define VIRTIO_CRYPTO_SESSION_LOG_INFO(fmt, args...) \
 	VIRTIO_CRYPTO_SESSION_LOG_IMPL(INFO, fmt, ## args)
@@ -46,10 +49,11 @@ extern int virtio_crypto_logtype_session;
 	VIRTIO_CRYPTO_SESSION_LOG_IMPL(ERR, fmt, ## args)
 
 extern int virtio_crypto_logtype_rx;
+#define RTE_LOGTYPE_VIRTIO_CRYPTO_RX virtio_crypto_logtype_rx
 
 #define VIRTIO_CRYPTO_RX_LOG_IMPL(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_rx, \
-		"RX: %s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, VIRTIO_CRYPTO_RX, \
+		"%s(): " fmt, __func__, ##args)
 
 #define VIRTIO_CRYPTO_RX_LOG_INFO(fmt, args...) \
 	VIRTIO_CRYPTO_RX_LOG_IMPL(INFO, fmt, ## args)
@@ -61,10 +65,11 @@ extern int virtio_crypto_logtype_rx;
 	VIRTIO_CRYPTO_RX_LOG_IMPL(ERR, fmt, ## args)
 
 extern int virtio_crypto_logtype_tx;
+#define RTE_LOGTYPE_VIRTIO_CRYPTO_TX virtio_crypto_logtype_tx
 
 #define VIRTIO_CRYPTO_TX_LOG_IMPL(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_tx, \
-		"TX: %s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, VIRTIO_CRYPTO_TX, \
+		"%s(): " fmt, __func__, ##args)
 
 #define VIRTIO_CRYPTO_TX_LOG_INFO(fmt, args...) \
 	VIRTIO_CRYPTO_TX_LOG_IMPL(INFO, fmt, ## args)
@@ -76,10 +81,11 @@ extern int virtio_crypto_logtype_tx;
 	VIRTIO_CRYPTO_TX_LOG_IMPL(ERR, fmt, ## args)
 
 extern int virtio_crypto_logtype_driver;
+#define RTE_LOGTYPE_VIRTIO_CRYPTO_DRIVER virtio_crypto_logtype_driver
 
 #define VIRTIO_CRYPTO_DRV_LOG_IMPL(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, virtio_crypto_logtype_driver, \
-		"DRIVER: %s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, VIRTIO_CRYPTO_DRIVER, \
+		"%s(): " fmt, __func__, ##args)
 
 #define VIRTIO_CRYPTO_DRV_LOG_INFO(fmt, args...) \
 	VIRTIO_CRYPTO_DRV_LOG_IMPL(INFO, fmt, ## args)
diff --git a/drivers/dma/dpaa/dpaa_qdma_logs.h b/drivers/dma/dpaa/dpaa_qdma_logs.h
index 95753dcd89..aa1249284b 100644
--- a/drivers/dma/dpaa/dpaa_qdma_logs.h
+++ b/drivers/dma/dpaa/dpaa_qdma_logs.h
@@ -9,12 +9,10 @@ extern int dpaa_qdma_logtype;
 #define RTE_LOGTYPE_DPAA_QDMA dpaa_qdma_logtype
 
 #define DPAA_QDMA_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa_qdma_logtype, "dpaa_qdma: " \
-		fmt "\n", ## args)
+	RTE_LOG_LINE(level, DPAA_QDMA, fmt, ## args)
 
 #define DPAA_QDMA_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, dpaa_qdma_logtype, "dpaa_qdma: %s(): " \
-		fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(DEBUG, DPAA_QDMA, "%s(): " fmt, __func__, ## args)
 
 #define DPAA_QDMA_FUNC_TRACE() DPAA_QDMA_DEBUG(">>")
 
@@ -27,7 +25,7 @@ extern int dpaa_qdma_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_QDMA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, DPAA_QDMA, "dpaa_qdma: " fmt "\n", ## args)
+	RTE_LOG_DP_LINE(level, DPAA_QDMA, fmt, ## args)
 
 #define DPAA_QDMA_DP_DEBUG(fmt, args...) \
 	DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/dma/dpaa2/dpaa2_qdma_logs.h b/drivers/dma/dpaa2/dpaa2_qdma_logs.h
index 37a5a5c6e9..af22786cda 100644
--- a/drivers/dma/dpaa2/dpaa2_qdma_logs.h
+++ b/drivers/dma/dpaa2/dpaa2_qdma_logs.h
@@ -13,12 +13,12 @@ extern int dpaa2_qdma_logtype;
 #define RTE_LOGTYPE_DPAA2_QDMA dpaa2_qdma_logtype
 
 #define DPAA2_QDMA_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa2_qdma_logtype, "dpaa2_qdma: " \
-		fmt "\n", ## args)
+	RTE_LOG_LINE(level, DPAA2_QDMA, \
+		fmt, ## args)
 
 #define DPAA2_QDMA_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, dpaa2_qdma_logtype, "dpaa2_qdma: %s(): " \
-		fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(DEBUG, DPAA2_QDMA, "%s(): " \
+		fmt, __func__, ## args)
 
 #define DPAA2_QDMA_FUNC_TRACE() DPAA2_QDMA_DEBUG(">>")
 
@@ -31,7 +31,7 @@ extern int dpaa2_qdma_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_QDMA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, DPAA2_QDMA, "dpaa2_qdma: " fmt "\n", ## args)
+	RTE_LOG_DP_LINE(level, DPAA2_QDMA, fmt, ## args)
 
 #define DPAA2_QDMA_DP_DEBUG(fmt, args...) \
 	DPAA2_QDMA_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/dma/hisilicon/hisi_dmadev.c b/drivers/dma/hisilicon/hisi_dmadev.c
index bce4b4b277..8b548dd1d8 100644
--- a/drivers/dma/hisilicon/hisi_dmadev.c
+++ b/drivers/dma/hisilicon/hisi_dmadev.c
@@ -18,21 +18,20 @@
 #include "hisi_dmadev.h"
 
 RTE_LOG_REGISTER_DEFAULT(hisi_dma_logtype, INFO);
+#define RTE_LOGTYPE_HISI_DMA hisi_dma_logtype
 #define HISI_DMA_LOG(level, fmt, args...) \
-		rte_log(RTE_LOG_ ## level, hisi_dma_logtype, \
-		"%s(): " fmt "\n", __func__, ##args)
-#define HISI_DMA_LOG_RAW(hw, level, fmt, args...) \
-		rte_log(RTE_LOG_ ## level, hisi_dma_logtype, \
-		"%s %s(): " fmt "\n", (hw)->data->dev_name, \
+	RTE_LOG_LINE(level, HISI_DMA, "%s(): " fmt, __func__, ##args)
+#define HISI_DMA_DEV_LOG(hw, level, fmt, args...) \
+	RTE_LOG_LINE(level, HISI_DMA, "%s %s(): " fmt, (hw)->data->dev_name, \
 		__func__, ##args)
 #define HISI_DMA_DEBUG(hw, fmt, args...) \
-		HISI_DMA_LOG_RAW(hw, DEBUG, fmt, ## args)
+	HISI_DMA_DEV_LOG(hw, DEBUG, fmt, ## args)
 #define HISI_DMA_INFO(hw, fmt, args...) \
-		HISI_DMA_LOG_RAW(hw, INFO, fmt, ## args)
+	HISI_DMA_DEV_LOG(hw, INFO, fmt, ## args)
 #define HISI_DMA_WARN(hw, fmt, args...) \
-		HISI_DMA_LOG_RAW(hw, WARNING, fmt, ## args)
+	HISI_DMA_DEV_LOG(hw, WARNING, fmt, ## args)
 #define HISI_DMA_ERR(hw, fmt, args...) \
-		HISI_DMA_LOG_RAW(hw, ERR, fmt, ## args)
+	HISI_DMA_DEV_LOG(hw, ERR, fmt, ## args)
 
 static uint32_t
 hisi_dma_queue_base(struct hisi_dma_dev *hw)
diff --git a/drivers/dma/idxd/idxd_internal.h b/drivers/dma/idxd/idxd_internal.h
index 537cf9b1cf..65ea7b6f67 100644
--- a/drivers/dma/idxd/idxd_internal.h
+++ b/drivers/dma/idxd/idxd_internal.h
@@ -20,9 +20,10 @@
  */
 
 extern int idxd_pmd_logtype;
+#define RTE_LOGTYPE_IDXD_PMD idxd_pmd_logtype
 
-#define IDXD_PMD_LOG(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
-		idxd_pmd_logtype, "IDXD: %s(): " fmt "\n", __func__, ##args)
+#define IDXD_PMD_LOG(level, fmt, args...) \
+	RTE_LOG_LINE(level, IDXD_PMD, "%s(): " fmt, __func__, ##args)
 
 #define IDXD_PMD_DEBUG(fmt, args...)  IDXD_PMD_LOG(DEBUG, fmt, ## args)
 #define IDXD_PMD_INFO(fmt, args...)   IDXD_PMD_LOG(INFO, fmt, ## args)
diff --git a/drivers/dma/ioat/ioat_internal.h b/drivers/dma/ioat/ioat_internal.h
index f4285c50f0..8cdada9018 100644
--- a/drivers/dma/ioat/ioat_internal.h
+++ b/drivers/dma/ioat/ioat_internal.h
@@ -35,9 +35,10 @@ struct ioat_dmadev {
 };
 
 extern int ioat_pmd_logtype;
+#define RTE_LOGTYPE_IOAT_PMD ioat_pmd_logtype
 
-#define IOAT_PMD_LOG(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
-		ioat_pmd_logtype, "IOAT: %s(): " fmt "\n", __func__, ##args)
+#define IOAT_PMD_LOG(level, fmt, args...) \
+	RTE_LOG_LINE(level, IOAT_PMD, "%s(): " fmt, __func__, ##args)
 
 #define IOAT_PMD_DEBUG(fmt, args...)  IOAT_PMD_LOG(DEBUG, fmt, ## args)
 #define IOAT_PMD_INFO(fmt, args...)   IOAT_PMD_LOG(INFO, fmt, ## args)
diff --git a/drivers/dma/odm/odm.h b/drivers/dma/odm/odm.h
index 274c21ef8d..c63ceb9902 100644
--- a/drivers/dma/odm/odm.h
+++ b/drivers/dma/odm/odm.h
@@ -13,8 +13,6 @@
 #include <rte_log.h>
 #include <rte_memzone.h>
 
-extern int odm_logtype;
-
 /* ODM VF register offsets from VF_BAR0 */
 #define ODM_VDMA_EN(x)		(0x00 | (x << 3))
 #define ODM_VDMA_REQQ_CTL(x)	(0x80 | (x << 3))
@@ -66,10 +64,13 @@ extern int odm_logtype;
 #define odm_read64(addr)       rte_read64_relaxed((volatile void *)(addr))
 #define odm_write64(val, addr) rte_write64_relaxed((val), (volatile void *)(addr))
 
+extern int odm_logtype;
+#define RTE_LOGTYPE_ODM odm_logtype
+
 #define ODM_LOG(level, ...) \
-	rte_log(RTE_LOG_ ## level, odm_logtype, \
-		RTE_FMT("%s(): %u" RTE_FMT_HEAD(__VA_ARGS__,) "\n", __func__, __LINE__, \
-			RTE_FMT_TAIL(__VA_ARGS__, )))
+	RTE_LOG_LINE(level, ODM, \
+		RTE_FMT("%s(): %u" RTE_FMT_HEAD(__VA_ARGS__ ,), __func__, __LINE__, \
+			RTE_FMT_TAIL(__VA_ARGS__ ,)))
 
 /*
  * Structure odm_instr_hdr_s for ODM
diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c
index 4b18fb3767..23dd305d09 100644
--- a/drivers/dma/skeleton/skeleton_dmadev.c
+++ b/drivers/dma/skeleton/skeleton_dmadev.c
@@ -21,8 +21,9 @@
 #include "skeleton_dmadev.h"
 
 RTE_LOG_REGISTER_DEFAULT(skeldma_logtype, INFO);
+#define RTE_LOGTYPE_SKELDMA skeldma_logtype
 #define SKELDMA_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, skeldma_logtype, "%s(): " fmt "\n", \
+	RTE_LOG_LINE(level, SKELDMA, "%s(): " fmt, \
 		__func__, ##args)
 
 static int
diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c
index f8cf48bd2e..85ccb586ef 100644
--- a/drivers/event/dpaa/dpaa_eventdev.c
+++ b/drivers/event/dpaa/dpaa_eventdev.c
@@ -48,6 +48,7 @@
  * 1 Eventdev can have N Eventqueue
  */
 RTE_LOG_REGISTER_DEFAULT(dpaa_logtype_eventdev, NOTICE);
+#define RTE_LOGTYPE_DPAA_EVENTDEV dpaa_logtype_eventdev
 
 #define DISABLE_INTR_MODE "disable_intr"
 
diff --git a/drivers/event/dpaa/dpaa_eventdev.h b/drivers/event/dpaa/dpaa_eventdev.h
index b4535c7b86..1d3f9036e9 100644
--- a/drivers/event/dpaa/dpaa_eventdev.h
+++ b/drivers/event/dpaa/dpaa_eventdev.h
@@ -78,7 +78,7 @@ struct dpaa_eventdev {
 };
 
 #define DPAA_EVENTDEV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa_logtype_eventdev, "%s(): " fmt "\n", \
+	RTE_LOG_LINE(level, DPAA_EVENTDEV, "%s(): " fmt, \
 		__func__, ##args)
 
 #define EVENTDEV_INIT_FUNC_TRACE() DPAA_EVENTDEV_LOG(DEBUG, " >>")
diff --git a/drivers/event/dpaa2/dpaa2_eventdev_logs.h b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
index b894fb3299..21a12f5cc2 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev_logs.h
+++ b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
@@ -6,14 +6,13 @@
 #define _DPAA2_EVENTDEV_LOGS_H_
 
 extern int dpaa2_logtype_event;
+#define RTE_LOGTYPE_DPAA2_EVENT dpaa2_logtype_event
 
 #define DPAA2_EVENTDEV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa2_logtype_event, "dpaa2_event: " \
-		fmt "\n", ##args)
+	RTE_LOG_LINE(level, DPAA2_EVENT, fmt, ##args)
 
 #define DPAA2_EVENTDEV_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, dpaa2_logtype_event, "dpaa2_event: %s(): " \
-		fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(DEBUG, DPAA2_EVENT, "%s():" fmt, __func__, ##args)
 
 #define EVENTDEV_INIT_FUNC_TRACE() DPAA2_EVENTDEV_DEBUG(" >>")
 
diff --git a/drivers/event/dsw/dsw_evdev.h b/drivers/event/dsw/dsw_evdev.h
index ca7aec575c..3372728f8b 100644
--- a/drivers/event/dsw/dsw_evdev.h
+++ b/drivers/event/dsw/dsw_evdev.h
@@ -303,7 +303,7 @@ dsw_pmd_priv(const struct rte_eventdev *eventdev)
 }
 
 #define DSW_LOG_DP_LINE(level, fmt, args...)				\
-	RTE_LOG_DP(level, EVENTDEV, "[%s] %s() line %u: " fmt "\n",	\
+	RTE_LOG_DP_LINE(level, EVENTDEV, "[%s] %s() line %u: " fmt,	\
 		   DSW_PMD_NAME,					\
 		   __func__, __LINE__, ## args)
 
diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h
index 293eb85a40..59fdc21b59 100644
--- a/drivers/event/octeontx/ssovf_evdev.h
+++ b/drivers/event/octeontx/ssovf_evdev.h
@@ -20,8 +20,8 @@
 #define EVENTDEV_NAME_OCTEONTX_PMD event_octeontx
 
 #define SSOVF_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, otx_logtype_ssovf, \
-			"[%s] %s() " fmt "\n", \
+	RTE_LOG_LINE(level, OTX_SSOVF, \
+			"[%s] %s() " fmt, \
 			RTE_STR(EVENTDEV_NAME_OCTEONTX_PMD), __func__, ## args)
 
 #define ssovf_log_info(fmt, ...) SSOVF_LOG(INFO, fmt, ##__VA_ARGS__)
@@ -171,6 +171,7 @@ ssovf_pmd_priv(const struct rte_eventdev *eventdev)
 }
 
 extern int otx_logtype_ssovf;
+#define RTE_LOGTYPE_OTX_SSOVF otx_logtype_ssovf
 
 uint16_t ssows_enq(void *port, const struct rte_event *ev);
 uint16_t ssows_enq_burst(void *port,
diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h
index 3a2dc475e3..00ea9a8420 100644
--- a/drivers/event/octeontx/timvf_evdev.h
+++ b/drivers/event/octeontx/timvf_evdev.h
@@ -27,8 +27,8 @@
 #include <octeontx_fpavf.h>
 
 #define timvf_log(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, otx_logtype_timvf, \
-			"[%s] %s() " fmt "\n", \
+	RTE_LOG_LINE(level, OTX_TIMVF, \
+			"[%s] %s() " fmt, \
 			RTE_STR(event_timer_octeontx), __func__, ## args)
 
 #define timvf_log_info(fmt, ...) timvf_log(INFO, fmt, ##__VA_ARGS__)
@@ -113,6 +113,7 @@
 #define TIMVF_ENABLE_STATS_ARG               ("timvf_stats")
 
 extern int otx_logtype_timvf;
+#define RTE_LOGTYPE_OTX_TIMVF otx_logtype_timvf
 static const uint16_t nb_chunk_slots = (TIM_CHUNK_SIZE / 16) - 1;
 
 enum timvf_clk_src {
diff --git a/drivers/event/opdl/opdl_log.h b/drivers/event/opdl/opdl_log.h
index ae5221c1e4..eefbace1ee 100644
--- a/drivers/event/opdl/opdl_log.h
+++ b/drivers/event/opdl/opdl_log.h
@@ -8,14 +8,9 @@
 #include <rte_log.h>
 
 extern int opdl_logtype_driver;
-
-#define PMD_DRV_LOG_RAW(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, opdl_logtype_driver, "%s(): " fmt, \
-			__func__, ## args)
+#define RTE_LOGTYPE_OPDL opdl_logtype_driver
 
 #define PMD_DRV_LOG(level, fmt, args...) \
-	PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
-
-
+	RTE_LOG_LINE(level, OPDL, "%s(): " fmt, __func__, ## args)
 
 #endif /* _OPDL_LOGS_H_ */
diff --git a/drivers/event/skeleton/skeleton_eventdev.h b/drivers/event/skeleton/skeleton_eventdev.h
index 283342ac19..96060b4048 100644
--- a/drivers/event/skeleton/skeleton_eventdev.h
+++ b/drivers/event/skeleton/skeleton_eventdev.h
@@ -9,11 +9,11 @@
 #include <eventdev_pmd_vdev.h>
 
 extern int skeleton_eventdev_logtype;
+#define RTE_LOGTYPE_SKELETON_EVENTDEV skeleton_eventdev_logtype
 
 #ifdef RTE_LIBRTE_PMD_SKELETON_EVENTDEV_DEBUG
 #define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, skeleton_eventdev_logtype, \
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, SKELETON_EVENTDEV, "%s(): " fmt, __func__, ## args)
 #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>")
 #else
 #define PMD_DRV_LOG(level, fmt, args...) do { } while (0)
@@ -21,8 +21,7 @@ extern int skeleton_eventdev_logtype;
 #endif
 
 #define PMD_DRV_ERR(fmt, args...) \
-	rte_log(RTE_LOG_ERR, skeleton_eventdev_logtype, \
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(ERR, SKELETON_EVENTDEV, "%s(): " fmt, __func__, ## args)
 
 struct __rte_cache_aligned skeleton_eventdev {
 	uintptr_t reg_base;
diff --git a/drivers/event/sw/sw_evdev_log.h b/drivers/event/sw/sw_evdev_log.h
index f76825abc5..a0fa9586b6 100644
--- a/drivers/event/sw/sw_evdev_log.h
+++ b/drivers/event/sw/sw_evdev_log.h
@@ -6,9 +6,10 @@
 #define _SW_EVDEV_LOG_H_
 
 extern int eventdev_sw_log_level;
+#define RTE_LOGTYPE_EVENTDEV_SW_LOG_LEVEL eventdev_sw_log_level
 
 #define SW_LOG_IMPL(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, eventdev_sw_log_level, "%s" fmt "\n", \
+	RTE_LOG_LINE(level, EVENTDEV_SW_LOG_LEVEL, "%s" fmt, \
 			__func__, ##args)
 
 #define SW_LOG_INFO(fmt, args...) \
diff --git a/drivers/gpu/cuda/common.h b/drivers/gpu/cuda/common.h
index e809988503..e098418401 100644
--- a/drivers/gpu/cuda/common.h
+++ b/drivers/gpu/cuda/common.h
@@ -13,10 +13,11 @@
 #include <rte_errno.h>
 
 extern int cuda_logtype;
+#define RTE_LOGTYPE_CUDA cuda_logtype
 
 /* Helper macro for logging */
 #define rte_cuda_log(level, fmt, ...) \
-	rte_log(RTE_LOG_ ## level, cuda_logtype, fmt "\n", ##__VA_ARGS__)
+	RTE_LOG_LINE(level, CUDA, fmt, ##__VA_ARGS__)
 
 #define rte_cuda_debug(fmt, ...) \
 	rte_cuda_log(DEBUG, RTE_STR(__LINE__) ":%s() " fmt, __func__, \
diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h
index 153fefd507..c49f085424 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.h
+++ b/drivers/mempool/dpaa/dpaa_mempool.h
@@ -61,8 +61,7 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info;
 /* Mempool related logs */
 
 #define DPAA_MEMPOOL_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa_logtype_mempool, "%s(): " fmt "\n", \
-		__func__, ##args)
+	RTE_LOG_LINE(level, DPAA_MEMPOOL, "%s(): " fmt, __func__, ## args)
 
 #define MEMPOOL_INIT_FUNC_TRACE() DPAA_MEMPOOL_LOG(DEBUG, " >>")
 
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
index fbc8cb30a2..577f889abf 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
@@ -9,13 +9,11 @@ extern int dpaa2_logtype_mempool;
 #define RTE_LOGTYPE_DPAA2_MEMPOOL dpaa2_logtype_mempool
 
 #define DPAA2_MEMPOOL_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa2_logtype_mempool, \
-		"mempool/dpaa2: " fmt "\n", ##args)
+	RTE_LOG_LINE(level, DPAA2_MEMPOOL, fmt, ##args)
 
 /* Debug logs are with Function names */
 #define DPAA2_MEMPOOL_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, dpaa2_logtype_mempool, \
-		"mempool/dpaa2: %s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(DEBUG, DPAA2_MEMPOOL, "%s(): " fmt, __func__, ##args)
 
 #define DPAA2_MEMPOOL_INFO(fmt, args...) \
 	DPAA2_MEMPOOL_LOG(INFO, fmt, ## args)
diff --git a/drivers/mempool/octeontx/octeontx_pool_logs.h b/drivers/mempool/octeontx/octeontx_pool_logs.h
index 7b4e1b3877..8703891a8a 100644
--- a/drivers/mempool/octeontx/octeontx_pool_logs.h
+++ b/drivers/mempool/octeontx/octeontx_pool_logs.h
@@ -8,8 +8,8 @@
 #include <rte_debug.h>
 
 #define FPAVF_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, octeontx_logtype_fpavf,\
-			"%s() line %u: " fmt "\n", __func__, __LINE__, ## args)
+	RTE_LOG_LINE(level, OCTEONTX_FPAVF,\
+			"%s() line %u: " fmt, __func__, __LINE__, ## args)
 
 #define fpavf_log_info(fmt, ...) FPAVF_LOG(INFO, fmt, ##__VA_ARGS__)
 #define fpavf_log_dbg(fmt, ...) FPAVF_LOG(DEBUG, fmt, ##__VA_ARGS__)
@@ -18,5 +18,6 @@
 
 
 extern int octeontx_logtype_fpavf;
+#define RTE_LOGTYPE_OCTEONTX_FPAVF octeontx_logtype_fpavf
 
 #endif /* __OCTEONTX_POOL_LOGS_H__*/
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 6b7b16f348..9be27973f0 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -102,14 +102,15 @@ static struct rte_eth_link pmd_link = {
 };
 
 RTE_LOG_REGISTER_DEFAULT(af_packet_logtype, NOTICE);
+#define RTE_LOGTYPE_AFPACKET af_packet_logtype
 
 #define PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, af_packet_logtype, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, AFPACKET, \
+		"%s(): " fmt, __func__, ##args)
 
 #define PMD_LOG_ERRNO(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, af_packet_logtype, \
-		"%s(): " fmt ":%s\n", __func__, ##args, strerror(errno))
+	RTE_LOG_LINE(level, AFPACKET, \
+		"%s(): " fmt ":%s", __func__, ##args, strerror(errno))
 
 static uint16_t
 eth_af_packet_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 676006ce0d..8ac8ebe4d2 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -66,7 +66,7 @@ RTE_LOG_REGISTER_DEFAULT(af_xdp_logtype, NOTICE);
 #define RTE_LOGTYPE_NET_AF_XDP af_xdp_logtype
 
 #define AF_XDP_LOG_LINE(level, fmt, args...) \
-	RTE_LOG(level, NET_AF_XDP, "%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, NET_AF_XDP, "%s(): " fmt, __func__, ##args)
 
 #define ETH_AF_XDP_FRAME_SIZE		2048
 #define ETH_AF_XDP_NUM_BUFFERS		4096
diff --git a/drivers/net/atlantic/atl_logs.h b/drivers/net/atlantic/atl_logs.h
index 14a7a1de1d..2b962f61ea 100644
--- a/drivers/net/atlantic/atl_logs.h
+++ b/drivers/net/atlantic/atl_logs.h
@@ -7,26 +7,24 @@
 #include <rte_log.h>
 
 extern int atl_logtype_init;
+#define RTE_LOGTYPE_ATL_INIT atl_logtype_init
 
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, atl_logtype_init, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, ATL_INIT, \
+		"%s(): " fmt, __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, ATL_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_DP_LINE(level, ATL_DRIVER, "%s(): " fmt, __func__, ## args)
 
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, ATL_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_DP_LINE(level, ATL_DRIVER, "%s(): " fmt, __func__, ## args)
 
 extern int atl_logtype_driver;
 #define RTE_LOGTYPE_ATL_DRIVER atl_logtype_driver
-#define PMD_DRV_LOG_RAW(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, atl_logtype_driver, "%s(): " fmt, \
-		__func__, ## args)
-
 #define PMD_DRV_LOG(level, fmt, args...) \
-	PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+	RTE_LOG_LINE(level, ATL_DRIVER, "%s(): " fmt, \
+		__func__, ## args)
 
 #endif
diff --git a/drivers/net/avp/avp_logs.h b/drivers/net/avp/avp_logs.h
index 3f2721df1a..2839f52865 100644
--- a/drivers/net/avp/avp_logs.h
+++ b/drivers/net/avp/avp_logs.h
@@ -9,14 +9,14 @@
 
 #ifdef RTE_LIBRTE_AVP_DEBUG_RX
 #define PMD_RX_LOG_LINE(level, fmt, ...) \
-	RTE_LOG(level, AVP_DRIVER, "%s() rx: " fmt "\n", __func__, ## __VA_ARGS__)
+	RTE_LOG_LINE(level, AVP_DRIVER, "%s() rx: " fmt, __func__, ## __VA_ARGS__)
 #else
 #define PMD_RX_LOG_LINE(...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_AVP_DEBUG_TX
 #define PMD_TX_LOG_LINE(level, fmt, ...) \
-	RTE_LOG(level, AVP_DRIVER, "%s() tx: " fmt "\n", __func__, ## __VA_ARGS__)
+	RTE_LOG_LINE(level, AVP_DRIVER, "%s() tx: " fmt, __func__, ## __VA_ARGS__)
 #else
 #define PMD_TX_LOG_LINE(...) do { } while (0)
 #endif
@@ -25,6 +25,6 @@ extern int avp_logtype_driver;
 #define RTE_LOGTYPE_AVP_DRIVER avp_logtype_driver
 
 #define PMD_DRV_LOG_LINE(level, fmt, ...) \
-	RTE_LOG(level, AVP_DRIVER, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+	RTE_LOG_LINE(level, AVP_DRIVER, "%s(): " fmt, __func__, ## __VA_ARGS__)
 
 #endif /* _AVP_LOGS_H_ */
diff --git a/drivers/net/axgbe/axgbe_logs.h b/drivers/net/axgbe/axgbe_logs.h
index 3962895c5a..1088f29b4f 100644
--- a/drivers/net/axgbe/axgbe_logs.h
+++ b/drivers/net/axgbe/axgbe_logs.h
@@ -8,9 +8,9 @@
 #include <stdio.h>
 
 extern int axgbe_logtype_init;
+#define RTE_LOGTYPE_AXGBE_INIT axgbe_logtype_init
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, axgbe_logtype_init, "%s(): " fmt "\n", \
-		__func__, ##args)
+	RTE_LOG_LINE(level, AXGBE_INIT, "%s(): " fmt, __func__, ##args)
 
 #ifdef RTE_LIBRTE_AXGBE_PMD_DEBUG
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
@@ -21,6 +21,6 @@ extern int axgbe_logtype_init;
 extern int axgbe_logtype_driver;
 #define RTE_LOGTYPE_AXGBE_DRIVER axgbe_logtype_driver
 #define PMD_DRV_LOG_LINE(level, fmt, ...) \
-	RTE_LOG(level, AXGBE_DRIVER, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+	RTE_LOG_LINE(level, AXGBE_DRIVER, "%s(): " fmt, __func__, ## __VA_ARGS__)
 
 #endif /* _AXGBE_LOGS_H_ */
diff --git a/drivers/net/bnx2x/bnx2x_logs.h b/drivers/net/bnx2x/bnx2x_logs.h
index f0cf69c163..76e8eb9afd 100644
--- a/drivers/net/bnx2x/bnx2x_logs.h
+++ b/drivers/net/bnx2x/bnx2x_logs.h
@@ -9,41 +9,40 @@
 #define _PMD_LOGS_H_
 
 extern int bnx2x_logtype_init;
+#define RTE_LOGTYPE_BNX2X_INIT bnx2x_logtype_init
 #define PMD_INIT_LOG(level, sc, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, bnx2x_logtype_init, \
-	"[bnx2x_pmd: %s] %s() " fmt "\n", (sc)->devinfo.name, __func__, ##args)
+	RTE_LOG_LINE(level, BNX2X_INIT, \
+	"[%s] %s() " fmt, (sc)->devinfo.name, __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE(sc) PMD_INIT_LOG(DEBUG, sc, " >>")
 
 extern int bnx2x_logtype_driver;
-#define PMD_DRV_LOG_RAW(level, sc, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, bnx2x_logtype_driver, \
+#define RTE_LOGTYPE_BNX2X_DRIVER bnx2x_logtype_driver
+#define PMD_DRV_LOG(level, sc, fmt, args...) \
+	RTE_LOG_LINE(level, BNX2X_DRIVER, \
 		"[%s:%d(%s)] " fmt,	__func__, __LINE__, \
 		(sc)->devinfo.name ? (sc)->devinfo.name : "", ## args)
 
-#define PMD_DRV_LOG(level, sc, fmt, args...) \
-	PMD_DRV_LOG_RAW(level, sc, fmt "\n", ## args)
-
 #ifdef RTE_LIBRTE_BNX2X_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, bnx2x_logtype_driver, \
-	"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, BNX2X_DRIVER, \
+	"%s(): " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_BNX2X_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, bnx2x_logtype_driver, \
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, BNX2X_DRIVER, \
+		"%s(): " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_BNX2X_DEBUG_PERIODIC
 #define PMD_DEBUG_PERIODIC_LOG(level, sc, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, bnx2x_logtype_driver, \
-		"%s(%s): " fmt "\n", __func__, \
+	RTE_LOG_LINE(level, BNX2X_DRIVER, \
+		"%s(%s): " fmt, __func__, \
 		(sc)->devinfo.name ? (sc)->devinfo.name : "", ## args)
 #else
 #define PMD_DEBUG_PERIODIC_LOG(level, sc, fmt, args...) do { } while (0)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 8ac20961d9..65b6a37352 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -1208,7 +1208,7 @@ extern const struct rte_flow_ops bnxt_flow_meter_ops;
 extern int bnxt_logtype_driver;
 #define RTE_LOGTYPE_BNXT bnxt_logtype_driver
 #define PMD_DRV_LOG_LINE(level, fmt, ...) \
-	RTE_LOG(level, BNXT, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+	RTE_LOG_LINE(level, BNXT, "%s(): " fmt, __func__, ## __VA_ARGS__)
 
 #define BNXT_LINK_SPEEDS_V2_OPTIONS(f) \
 	((f) & HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_SPEEDS2_SUPPORTED)
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
index 0ff1641c19..355d41bbd3 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c
@@ -357,8 +357,8 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
 		if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
 			nb_tx_pkts += txcmp->opaque;
 		else
-			RTE_LOG_DP(ERR, BNXT,
-				   "Unhandled CMP type %02x\n",
+			RTE_LOG_DP_LINE(ERR, BNXT,
+				   "Unhandled CMP type %02x",
 				   CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
index 9f1a02f0ab..c1c3e1ecaf 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
@@ -578,8 +578,8 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
 		if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2))
 			nb_tx_pkts += txcmp->opaque;
 		else
-			RTE_LOG_DP(ERR, BNXT,
-				   "Unhandled CMP type %02x\n",
+			RTE_LOG_DP_LINE(ERR, BNXT,
+				   "Unhandled CMP type %02x",
 				   CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 6a38c7c6e4..9087fd4e6c 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -548,8 +548,8 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
 		if (CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2)
 			nb_tx_pkts += opaque;
 		else
-			RTE_LOG_DP(ERR, BNXT,
-					"Unhandled CMP type %02x\n",
+			RTE_LOG_DP_LINE(ERR, BNXT,
+					"Unhandled CMP type %02x",
 					CMP_TYPE(txcmp));
 		raw_cons = NEXT_RAW_CMP(raw_cons);
 	} while (nb_tx_pkts < ring_mask);
diff --git a/drivers/net/cpfl/cpfl_logs.h b/drivers/net/cpfl/cpfl_logs.h
index bdfa5c41a5..a45cc0cbc3 100644
--- a/drivers/net/cpfl/cpfl_logs.h
+++ b/drivers/net/cpfl/cpfl_logs.h
@@ -8,21 +8,21 @@
 #include <rte_log.h>
 
 extern int cpfl_logtype_init;
+#define RTE_LOGTYPE_CPFL_INIT cpfl_logtype_init
 extern int cpfl_logtype_driver;
+#define RTE_LOGTYPE_CPFL_DRIVER cpfl_logtype_driver
 
 #define PMD_INIT_LOG(level, ...) \
-	rte_log(RTE_LOG_ ## level, \
-		cpfl_logtype_init, \
+	RTE_LOG_LINE(level, CPFL_INIT, \
 		RTE_FMT("%s(): " \
-			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+			RTE_FMT_HEAD(__VA_ARGS__,), \
 			__func__, \
 			RTE_FMT_TAIL(__VA_ARGS__,)))
 
 #define PMD_DRV_LOG(level, ...) \
-	rte_log(RTE_LOG_ ## level, \
-		cpfl_logtype_driver, \
+	RTE_LOG_LINE(level, CPFL_DRIVER, \
 		RTE_FMT("%s(): " \
-			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+			RTE_FMT_HEAD(__VA_ARGS__,), \
 			__func__, \
 			RTE_FMT_TAIL(__VA_ARGS__,)))
 
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index b6c61b8b6b..e8dcd29a45 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -217,7 +217,7 @@ extern int dpaa_logtype_pmd;
 #define RTE_LOGTYPE_DPAA_PMD dpaa_logtype_pmd
 
 #define DPAA_PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa_logtype_pmd, "%s(): " fmt "\n", \
+	RTE_LOG_LINE(level, DPAA_PMD, "%s(): " fmt, \
 		__func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() DPAA_PMD_LOG(DEBUG, " >>")
@@ -233,6 +233,6 @@ extern int dpaa_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, DPAA_PMD, fmt, ## args)
+	RTE_LOG_DP_LINE(level, DPAA_PMD, fmt, ## args)
 
 #endif
diff --git a/drivers/net/dpaa2/dpaa2_pmd_logs.h b/drivers/net/dpaa2/dpaa2_pmd_logs.h
index af895a6b6e..634b80bb1b 100644
--- a/drivers/net/dpaa2/dpaa2_pmd_logs.h
+++ b/drivers/net/dpaa2/dpaa2_pmd_logs.h
@@ -6,15 +6,13 @@
 #define _DPAA2_PMD_LOGS_H_
 
 extern int dpaa2_logtype_pmd;
-#define RTE_LOGTYPE_DPAA2_PMD dpaa2_logtype_pmd
+#define RTE_LOGTYPE_DPAA2_NET dpaa2_logtype_pmd
 
 #define DPAA2_PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa2_logtype_pmd, "dpaa2_net: " \
-		fmt "\n", ##args)
+	RTE_LOG_LINE(level, DPAA2_NET, fmt, ##args)
 
 #define DPAA2_PMD_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, dpaa2_logtype_pmd, "dpaa2_net: %s(): "\
-		fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(DEBUG, DPAA2_NET, "%s(): " fmt, __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() DPAA2_PMD_DEBUG(">>")
 
@@ -29,7 +27,7 @@ extern int dpaa2_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_PMD_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, DPAA2_PMD, fmt, ## args)
+	RTE_LOG_DP_LINE(level, DPAA2_NET, fmt, ## args)
 
 #define DPAA2_PMD_DP_DEBUG(fmt, args...) \
 	DPAA2_PMD_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index b64232b88f..92e9dd40dc 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -399,7 +399,7 @@ eth_fd_to_mbuf(const struct qbman_fd *fd,
 		mbuf->packet_type = dpaa2_dev_rx_parse(mbuf, hw_annot_addr);
 
 	DPAA2_PMD_DP_DEBUG("to mbuf - mbuf =%p, mbuf->buf_addr =%p, off = %d,"
-		"fd_off=%d fd =%" PRIx64 ", meta = %d  bpid =%d, len=%d\n",
+		"fd_off=%d fd =%" PRIx64 ", meta = %d  bpid =%d, len=%d",
 		mbuf, mbuf->buf_addr, mbuf->data_off,
 		DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_ADDR(fd),
 		rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size,
@@ -446,7 +446,7 @@ eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 	} else {
 		temp = rte_pktmbuf_alloc(dpaa2_tx_sg_pool);
 		if (temp == NULL) {
-			DPAA2_PMD_DP_DEBUG("No memory to allocate S/G table\n");
+			DPAA2_PMD_DP_DEBUG("No memory to allocate S/G table");
 			return -ENOMEM;
 		}
 		DPAA2_SET_ONLY_FD_BPID(fd, mempool_to_bpid(dpaa2_tx_sg_pool));
@@ -543,7 +543,7 @@ eth_mbuf_to_fd(struct rte_mbuf *mbuf,
 	DPAA2_MBUF_TO_CONTIG_FD(mbuf, fd, bpid);
 
 	DPAA2_PMD_DP_DEBUG("mbuf =%p, mbuf->buf_addr =%p, off = %d,"
-		"fd_off=%d fd =%" PRIx64 ", meta = %d  bpid =%d, len=%d\n",
+		"fd_off=%d fd =%" PRIx64 ", meta = %d  bpid =%d, len=%d",
 		mbuf, mbuf->buf_addr, mbuf->data_off,
 		DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_ADDR(fd),
 		rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size,
@@ -587,7 +587,7 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf,
 
 	if (rte_dpaa2_mbuf_alloc_bulk(
 		rte_dpaa2_bpid_info[bpid].bp_list->mp, &mb, 1)) {
-		DPAA2_PMD_DP_DEBUG("Unable to allocated DPAA2 buffer\n");
+		DPAA2_PMD_DP_DEBUG("Unable to allocated DPAA2 buffer");
 		return -1;
 	}
 	m = (struct rte_mbuf *)mb;
@@ -609,7 +609,7 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf,
 #endif
 	DPAA2_PMD_DP_DEBUG(
 		"mbuf: %p, BMAN buf addr: %p, fdaddr: %" PRIx64 ", bpid: %d,"
-		" meta: %d, off: %d, len: %d\n",
+		" meta: %d, off: %d, len: %d",
 		(void *)mbuf,
 		mbuf->buf_addr,
 		DPAA2_GET_FD_ADDR(fd),
@@ -656,7 +656,7 @@ dump_err_pkts(struct dpaa2_queue *dpaa2_q)
 
 	while (1) {
 		if (qbman_swp_pull(swp, &pulldesc)) {
-			DPAA2_PMD_DP_DEBUG("VDQ command is not issued.QBMAN is busy\n");
+			DPAA2_PMD_DP_DEBUG("VDQ command is not issued.QBMAN is busy");
 			/* Portal was busy, try again */
 			continue;
 		}
@@ -765,7 +765,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		while (1) {
 			if (qbman_swp_pull(swp, &pulldesc)) {
 				DPAA2_PMD_DP_DEBUG("VDQ command is not issued."
-						  " QBMAN is busy (1)\n");
+						  " QBMAN is busy (1)");
 				/* Portal was busy, try again */
 				continue;
 			}
@@ -861,7 +861,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	while (1) {
 		if (qbman_swp_pull(swp, &pulldesc)) {
 			DPAA2_PMD_DP_DEBUG("VDQ command is not issued."
-					  "QBMAN is busy (2)\n");
+					  "QBMAN is busy (2)");
 			continue;
 		}
 		break;
@@ -1002,7 +1002,7 @@ dpaa2_dev_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		while (1) {
 			if (qbman_swp_pull(swp, &pulldesc)) {
 				DPAA2_PMD_DP_DEBUG(
-					"VDQ command is not issued.QBMAN is busy\n");
+					"VDQ command is not issued.QBMAN is busy");
 				/* Portal was busy, try again */
 				continue;
 			}
@@ -1126,7 +1126,7 @@ uint16_t dpaa2_dev_tx_conf(void *queue)
 		while (1) {
 			if (qbman_swp_pull(swp, &pulldesc)) {
 				DPAA2_PMD_DP_DEBUG("VDQ command is not issued."
-						   "QBMAN is busy\n");
+						   "QBMAN is busy");
 				/* Portal was busy, try again */
 				continue;
 			}
@@ -1263,7 +1263,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	}
 	swp = DPAA2_PER_LCORE_PORTAL;
 
-	DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d\n",
+	DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d",
 			eth_data, dpaa2_q->fqid);
 
 #ifdef RTE_LIBRTE_IEEE1588
@@ -1598,7 +1598,7 @@ dpaa2_dev_tx_multi_txq_ordered(void **queue,
 			}
 		}
 
-		DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d\n",
+		DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d",
 				   eth_data, dpaa2_q[loop]->fqid);
 
 		/* Check if the queue is congested */
@@ -1754,7 +1754,7 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	}
 	swp = DPAA2_PER_LCORE_PORTAL;
 
-	DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d\n",
+	DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d",
 			   eth_data, dpaa2_q->fqid);
 
 	/* This would also handle normal and atomic queues as any type
@@ -1989,7 +1989,7 @@ dpaa2_dev_loopback_rx(void *queue,
 		while (1) {
 			if (qbman_swp_pull(swp, &pulldesc)) {
 				DPAA2_PMD_DP_DEBUG(
-					"VDQ command not issued.QBMAN busy\n");
+					"VDQ command not issued.QBMAN busy");
 				/* Portal was busy, try again */
 				continue;
 			}
@@ -2071,7 +2071,7 @@ dpaa2_dev_loopback_rx(void *queue,
 	while (1) {
 		if (qbman_swp_pull(swp, &pulldesc)) {
 			DPAA2_PMD_DP_DEBUG("VDQ command is not issued."
-					  "QBMAN is busy (2)\n");
+					  "QBMAN is busy (2)");
 			continue;
 		}
 		break;
diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
index 30b5531069..afb840b601 100644
--- a/drivers/net/e1000/e1000_logs.h
+++ b/drivers/net/e1000/e1000_logs.h
@@ -8,27 +8,27 @@
 #include <rte_log.h>
 
 extern int e1000_logtype_init;
+#define RTE_LOGTYPE_E1000_INIT e1000_logtype_init
 
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, e1000_logtype_init, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, E1000_INIT, "%s(): " fmt, __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_ETHDEV_DEBUG_RX
 extern int e1000_logtype_rx;
+#define RTE_LOGTYPE_E1000_RX e1000_logtype_rx
 #define PMD_RX_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, e1000_logtype_rx,	\
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, E1000_RX, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
 extern int e1000_logtype_tx;
+#define RTE_LOGTYPE_E1000_TX e1000_logtype_tx
 #define PMD_TX_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, e1000_logtype_tx,	\
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, E1000_TX, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
@@ -36,7 +36,7 @@ extern int e1000_logtype_tx;
 extern int e1000_logtype_driver;
 #define RTE_LOGTYPE_E1000_DRIVER e1000_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
-	RTE_LOG(level, E1000_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, E1000_DRIVER, "%s(): " fmt, __func__, ## args)
 
 /* log init function shared by e1000 and igb drivers */
 void e1000_igb_init_log(void);
diff --git a/drivers/net/ena/ena_logs.h b/drivers/net/ena/ena_logs.h
index 5c9ec1772b..6ebc08e09f 100644
--- a/drivers/net/ena/ena_logs.h
+++ b/drivers/net/ena/ena_logs.h
@@ -9,13 +9,13 @@
 extern int ena_logtype_init;
 #define RTE_LOGTYPE_ENA_INIT ena_logtype_init
 #define PMD_INIT_LOG_LINE(level, fmt, ...) \
-	RTE_LOG(level, ENA_INIT, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+	RTE_LOG_LINE(level, ENA_INIT, "%s(): " fmt, __func__, ## __VA_ARGS__)
 
 #ifdef RTE_ETHDEV_DEBUG_RX
 extern int ena_logtype_rx;
 #define RTE_LOGTYPE_ENA_RX ena_logtype_rx
 #define PMD_RX_LOG_LINE(level, fmt, ...)	\
-	RTE_LOG(level, ENA_RX, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+	RTE_LOG_LINE(level, ENA_RX, "%s(): " fmt, __func__, ## __VA_ARGS__)
 #else
 #define PMD_RX_LOG_LINE(...) do { } while (0)
 #endif
@@ -24,7 +24,7 @@ extern int ena_logtype_rx;
 extern int ena_logtype_tx;
 #define RTE_LOGTYPE_ENA_TX ena_logtype_tx
 #define PMD_TX_LOG_LINE(level, fmt, ...)	\
-	RTE_LOG(level, ENA_TX, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+	RTE_LOG_LINE(level, ENA_TX, "%s(): " fmt, __func__, ## __VA_ARGS__)
 #else
 #define PMD_TX_LOG_LINE(...) do { } while (0)
 #endif
@@ -32,6 +32,6 @@ extern int ena_logtype_tx;
 extern int ena_logtype_driver;
 #define RTE_LOGTYPE_ENA_DRIVER ena_logtype_driver
 #define PMD_DRV_LOG_LINE(level, fmt, ...) \
-	RTE_LOG(level, ENA_DRIVER, "%s(): " fmt "\n", __func__, ## __VA_ARGS__)
+	RTE_LOG_LINE(level, ENA_DRIVER, "%s(): " fmt, __func__, ## __VA_ARGS__)
 
 #endif /* _ENA_LOGS_H_ */
diff --git a/drivers/net/ena/ena_platform.h b/drivers/net/ena/ena_platform.h
index 748928b2d9..71190b2932 100644
--- a/drivers/net/ena/ena_platform.h
+++ b/drivers/net/ena/ena_platform.h
@@ -9,7 +9,7 @@
 #define ena_assert_msg(cond, msg)		\
 	do {					\
 		if (unlikely(!(cond))) {	\
-			rte_log(RTE_LOG_ERR, ena_logtype_driver, \
+			RTE_LOG_LINE(ERR, ENA_DRIVER, \
 				"Assert failed on %s:%s:%d: ",	\
 				__FILE__, __func__, __LINE__);	\
 			rte_panic(msg);		\
diff --git a/drivers/net/enetc/enetc_logs.h b/drivers/net/enetc/enetc_logs.h
index 63f6ca4cf4..fd5bdeb16e 100644
--- a/drivers/net/enetc/enetc_logs.h
+++ b/drivers/net/enetc/enetc_logs.h
@@ -6,15 +6,13 @@
 #define _ENETC_LOGS_H_
 
 extern int enetc_logtype_pmd;
-#define RTE_LOGTYPE_ENETC_PMD enetc_logtype_pmd
+#define RTE_LOGTYPE_ENETC_NET enetc_logtype_pmd
 
 #define ENETC_PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, enetc_logtype_pmd, "enetc_net: " \
-		fmt "\n", ##args)
+	RTE_LOG_LINE(level, ENETC_NET, fmt, ##args)
 
 #define ENETC_PMD_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, enetc_logtype_pmd, "enetc_net: %s(): "\
-		fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(DEBUG, ENETC_NET, "%s(): " fmt, __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() ENETC_PMD_DEBUG(">>")
 
@@ -31,7 +29,7 @@ extern int enetc_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define ENETC_PMD_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, ENETC_PMD, fmt, ## args)
+	RTE_LOG_DP_LINE(level, ENETC_NET, fmt, ## args)
 
 #define ENETC_PMD_DP_DEBUG(fmt, args...) \
 	ENETC_PMD_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/net/enetfec/enet_pmd_logs.h b/drivers/net/enetfec/enet_pmd_logs.h
index 270981373f..9ff633cad8 100644
--- a/drivers/net/enetfec/enet_pmd_logs.h
+++ b/drivers/net/enetfec/enet_pmd_logs.h
@@ -8,12 +8,11 @@
 #include <rte_log.h>
 
 extern int enetfec_logtype_pmd;
-#define RTE_LOGTYPE_ENETFEC_PMD enetfec_logtype_pmd
+#define RTE_LOGTYPE_ENETFEC_NET enetfec_logtype_pmd
 
 /* PMD related logs */
 #define ENETFEC_PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, enetfec_logtype_pmd, "\nfec_net: %s()" \
-		fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, ENETFEC_NET, "%s()" fmt, __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() ENET_PMD_LOG(DEBUG, " >>")
 
@@ -29,6 +28,6 @@ extern int enetfec_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define ENETFEC_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, ENETFEC_PMD, fmt, ## args)
+	RTE_LOG_DP_LINE(level, ENETFEC_NET, fmt, ## args)
 
 #endif /* _ENETFEC_LOGS_H_ */
diff --git a/drivers/net/enic/enic_compat.h b/drivers/net/enic/enic_compat.h
index 7741273037..6ac245f7ab 100644
--- a/drivers/net/enic/enic_compat.h
+++ b/drivers/net/enic/enic_compat.h
@@ -26,6 +26,7 @@
 #define __ALIGN_MASK(x, mask)    (((x)+(mask))&~(mask))
 
 extern int enic_pmd_logtype;
+#define RTE_LOGTYPE_ENIC_PMD enic_pmd_logtype
 
 #define dev_printk(level, fmt, args...)	\
 	rte_log(RTE_LOG_ ## level, enic_pmd_logtype, \
@@ -37,8 +38,8 @@ extern int enic_pmd_logtype;
 #define dev_debug(x, args...) dev_printk(DEBUG, args)
 
 #define ENICPMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, enic_pmd_logtype, \
-		"%s " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, ENIC_PMD, \
+		"%s " fmt, __func__, ##args)
 #define ENICPMD_FUNC_TRACE() ENICPMD_LOG(DEBUG, ">>")
 
 typedef         unsigned long long  dma_addr_t;
diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
index 53a451c1b1..babea6016e 100644
--- a/drivers/net/failsafe/failsafe_private.h
+++ b/drivers/net/failsafe/failsafe_private.h
@@ -357,12 +357,9 @@ extern int failsafe_mac_from_arg;
 #endif
 
 extern int failsafe_logtype;
+#define RTE_LOGTYPE_NET_FAILSAFE failsafe_logtype
 
-#define LOG__(l, m, ...) \
-	rte_log(RTE_LOG_ ## l, failsafe_logtype, \
-		"net_failsafe: " m "%c", __VA_ARGS__)
-
-#define LOG_(level, ...) LOG__(level, __VA_ARGS__, '\n')
+#define LOG_(l, ...) RTE_LOG_LINE(l, NET_FAILSAFE, __VA_ARGS__)
 #define DEBUG(...) LOG_(DEBUG, __VA_ARGS__)
 #define INFO(...) LOG_(INFO, __VA_ARGS__)
 #define WARN(...) LOG_(WARNING, __VA_ARGS__)
diff --git a/drivers/net/fm10k/fm10k_logs.h b/drivers/net/fm10k/fm10k_logs.h
index c4c7c977d9..d1a849ca79 100644
--- a/drivers/net/fm10k/fm10k_logs.h
+++ b/drivers/net/fm10k/fm10k_logs.h
@@ -8,26 +8,26 @@
 #include <rte_log.h>
 
 extern int fm10k_logtype_init;
+#define RTE_LOGTYPE_FM10K_INIT fm10k_logtype_init
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, fm10k_logtype_init, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, FM10K_INIT, "%s(): " fmt, __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_ETHDEV_DEBUG_RX
 extern int fm10k_logtype_rx;
-#define PMD_RX_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, fm10k_logtype_rx,	\
-		"%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_FM10K_RX fm10k_logtype_rx
+#define PMD_RX_LOG(level, fmt, args...) \
+	RTE_LOG_LINE(level, FM10K_RX, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
 extern int fm10k_logtype_tx;
-#define PMD_TX_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, fm10k_logtype_tx,	\
-		"%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_FM10K_TX fm10k_logtype_tx
+#define PMD_TX_LOG(level, fmt, args...) \
+	RTE_LOG_LINE(level, FM10K_TX, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
@@ -35,6 +35,6 @@ extern int fm10k_logtype_tx;
 extern int fm10k_logtype_driver;
 #define RTE_LOGTYPE_FM10K_DRIVER fm10k_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
-	RTE_LOG(level, FM10K_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, FM10K_DRIVER, "%s(): " fmt, __func__, ## args)
 
 #endif /* _FM10K_LOGS_H_ */
diff --git a/drivers/net/gve/gve_logs.h b/drivers/net/gve/gve_logs.h
index 0d02da46e1..4a5baca6ff 100644
--- a/drivers/net/gve/gve_logs.h
+++ b/drivers/net/gve/gve_logs.h
@@ -6,9 +6,9 @@
 #define _GVE_LOGS_H_
 
 extern int gve_logtype_driver;
+#define RTE_LOGTYPE_GVE_DRIVER gve_logtype_driver
 
 #define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, gve_logtype_driver, "%s(): " fmt "\n", \
-		__func__, ## args)
+	RTE_LOG_LINE(level, GVE_DRIVER, "%s(): " fmt, __func__, ## args)
 
 #endif
diff --git a/drivers/net/hinic/base/hinic_compat.h b/drivers/net/hinic/base/hinic_compat.h
index aea332046e..6cf5a6e43a 100644
--- a/drivers/net/hinic/base/hinic_compat.h
+++ b/drivers/net/hinic/base/hinic_compat.h
@@ -84,10 +84,11 @@ typedef uint64_t  dma_addr_t;
 #define HINIC_DRIVER_NAME "net_hinic"
 
 extern int hinic_logtype;
+#define RTE_LOGTYPE_HINIC hinic_logtype
 
 #define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, hinic_logtype, \
-		HINIC_DRIVER_NAME": " fmt "\n", ##args)
+	RTE_LOG_LINE(level, HINIC, \
+		HINIC_DRIVER_NAME": " fmt, ##args)
 
 /* common definition */
 #ifndef ETH_ALEN
diff --git a/drivers/net/hns3/hns3_logs.h b/drivers/net/hns3/hns3_logs.h
index 47d3a13220..ef7a1ae3fd 100644
--- a/drivers/net/hns3/hns3_logs.h
+++ b/drivers/net/hns3/hns3_logs.h
@@ -6,35 +6,37 @@
 #define HNS3_LOGS_H
 
 extern int hns3_logtype_init;
+#define RTE_LOGTYPE_HNS3_INIT hns3_logtype_init
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, hns3_logtype_init, "%s(): " fmt "\n", \
-		__func__, ##args)
+	RTE_LOG_LINE(level, HNS3_INIT, "%s(): " fmt, __func__, ##args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 extern int hns3_logtype_driver;
-#define PMD_DRV_LOG_RAW(hw, level, fmt, args...) \
-	rte_log(level, hns3_logtype_driver, "%s %s(): " fmt, \
+#define RTE_LOGTYPE_HNS3_DRIVER hns3_logtype_driver
+#define PMD_DRV_LOG(hw, level, fmt, args...) \
+	RTE_LOG_LINE(level, HNS3_DRIVER, "%s %s(): " fmt, \
 		(hw)->data->name, __func__, ## args)
 
 #define hns3_err(hw, fmt, args...) \
-	PMD_DRV_LOG_RAW(hw, RTE_LOG_ERR, fmt "\n", ## args)
+	PMD_DRV_LOG(hw, ERR, fmt, ## args)
 
 #define hns3_warn(hw, fmt, args...) \
-	PMD_DRV_LOG_RAW(hw, RTE_LOG_WARNING, fmt "\n", ## args)
+	PMD_DRV_LOG(hw, WARNING, fmt, ## args)
 
 #define hns3_notice(hw, fmt, args...) \
-	PMD_DRV_LOG_RAW(hw, RTE_LOG_NOTICE, fmt "\n", ## args)
+	PMD_DRV_LOG(hw, NOTICE, fmt, ## args)
 
 #define hns3_info(hw, fmt, args...) \
-	PMD_DRV_LOG_RAW(hw, RTE_LOG_INFO, fmt "\n", ## args)
+	PMD_DRV_LOG(hw, INFO, fmt, ## args)
 
 #define hns3_dbg(hw, fmt, args...) \
-	PMD_DRV_LOG_RAW(hw, RTE_LOG_DEBUG, fmt "\n", ## args)
+	PMD_DRV_LOG(hw, DEBUG, fmt, ## args)
 
 #ifdef RTE_ETHDEV_DEBUG_RX
 extern int hns3_logtype_rx;
+#define RTE_LOGTYPE_HNS3_RX hns3_logtype_rx
 #define PMD_RX_LOG(hw, level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, hns3_logtype_rx,	"%s %s(): " fmt "\n", \
+	RTE_LOG_LINE(level, HNS3_RX,	"%s %s(): " fmt, \
 		(hw)->data->name, __func__, ## args)
 #else
 #define PMD_RX_LOG(hw, level, fmt, args...) do { } while (0)
@@ -42,8 +44,9 @@ extern int hns3_logtype_rx;
 
 #ifdef RTE_ETHDEV_DEBUG_TX
 extern int hns3_logtype_tx;
+#define RTE_LOGTYPE_HNS3_TX hns3_logtype_tx
 #define PMD_TX_LOG(hw, level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, hns3_logtype_tx,	"%s %s(): " fmt "\n", \
+	RTE_LOG_LINE(level, HNS3_TX,	"%s %s(): " fmt, \
 		(hw)->data->name, __func__, ## args)
 #else
 #define PMD_TX_LOG(hw, level, fmt, args...) do { } while (0)
diff --git a/drivers/net/i40e/i40e_logs.h b/drivers/net/i40e/i40e_logs.h
index fb1f3a4096..a756871dff 100644
--- a/drivers/net/i40e/i40e_logs.h
+++ b/drivers/net/i40e/i40e_logs.h
@@ -6,25 +6,25 @@
 #define _I40E_LOGS_H_
 
 extern int i40e_logtype_init;
+#define RTE_LOGTYPE_I40E_INIT i40e_logtype_init
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, i40e_logtype_init, "%s(): " fmt "\n", \
-		__func__, ##args)
+	RTE_LOG_LINE(level, I40E_INIT, "%s(): " fmt, __func__, ##args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_ETHDEV_DEBUG_RX
 extern int i40e_logtype_rx;
-#define PMD_RX_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, i40e_logtype_rx,	\
-		"%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_I40E_RX i40e_logtype_rx
+#define PMD_RX_LOG(level, fmt, args...) \
+	RTE_LOG_LINE(level, I40E_RX, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
 extern int i40e_logtype_tx;
-#define PMD_TX_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, i40e_logtype_tx,	\
-		"%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_I40E_TX i40e_logtype_tx
+#define PMD_TX_LOG(level, fmt, args...) \
+	RTE_LOG_LINE(level, I40E_TX, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
@@ -32,6 +32,6 @@ extern int i40e_logtype_tx;
 extern int i40e_logtype_driver;
 #define RTE_LOGTYPE_I40E_DRIVER i40e_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
-	RTE_LOG(level, I40E_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, I40E_DRIVER, "%s(): " fmt, __func__, ## args)
 
 #endif /* _I40E_LOGS_H_ */
diff --git a/drivers/net/iavf/iavf_log.h b/drivers/net/iavf/iavf_log.h
index ff66ab0ccf..c0013b8861 100644
--- a/drivers/net/iavf/iavf_log.h
+++ b/drivers/net/iavf/iavf_log.h
@@ -6,35 +6,36 @@
 #define _IAVF_LOG_H_
 
 extern int iavf_logtype_init;
+#define RTE_LOGTYPE_IAVF_INIT iavf_logtype_init
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, iavf_logtype_init, "%s(): " fmt "\n", \
+	RTE_LOG_LINE(level, IAVF_INIT, "%s(): " fmt, \
 		__func__, ## args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 extern int iavf_logtype_driver;
-#define PMD_DRV_LOG_RAW(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, iavf_logtype_driver, "%s(): " fmt, \
-		__func__, ## args)
-
+#define RTE_LOGTYPE_IAVF_DRIVER iavf_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
-	PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+	RTE_LOG_LINE(level, IAVF_DRIVER, "%s(): " fmt, \
+		__func__, ## args)
 #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, " >>")
 
 
 #ifdef RTE_ETHDEV_DEBUG_RX
 extern int iavf_logtype_rx;
+#define RTE_LOGTYPE_IAVF_RX iavf_logtype_rx
 #define PMD_RX_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, iavf_logtype_rx,	\
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, IAVF_RX,	\
+		"%s(): " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
 extern int iavf_logtype_tx;
+#define RTE_LOGTYPE_IAVF_TX iavf_logtype_tx
 #define PMD_TX_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, iavf_logtype_tx,	\
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, IAVF_TX,	\
+		"%s(): " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
diff --git a/drivers/net/ice/ice_logs.h b/drivers/net/ice/ice_logs.h
index a54e9d8b59..a84a5d453b 100644
--- a/drivers/net/ice/ice_logs.h
+++ b/drivers/net/ice/ice_logs.h
@@ -6,34 +6,34 @@
 #define _ICE_LOGS_H_
 
 extern int ice_logtype_init;
+#define RTE_LOGTYPE_ICE_INIT ice_logtype_init
 extern int ice_logtype_driver;
 #define RTE_LOGTYPE_ICE_DRIVER ice_logtype_driver
 
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, ice_logtype_init, "%s(): " fmt "\n", \
-		__func__, ##args)
+	RTE_LOG_LINE(level, ICE_INIT, "%s(): " fmt, __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_ETHDEV_DEBUG_RX
 extern int ice_logtype_rx;
-#define PMD_RX_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, ice_logtype_rx,	\
-		"%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_ICE_RX ice_logtype_rx
+#define PMD_RX_LOG(level, fmt, args...) \
+	RTE_LOG_LINE(level, ICE_RX, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
 extern int ice_logtype_tx;
-#define PMD_TX_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, ice_logtype_tx,	\
-		"%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_ICE_TX ice_logtype_tx
+#define PMD_TX_LOG(level, fmt, args...) \
+	RTE_LOG_LINE(level, ICE_TX, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #define PMD_DRV_LOG(level, fmt, args...) \
-	RTE_LOG(level, ICE_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, ICE_DRIVER, "%s(): " fmt, __func__, ## args)
 
 #endif /* _ICE_LOGS_H_ */
diff --git a/drivers/net/idpf/idpf_logs.h b/drivers/net/idpf/idpf_logs.h
index bf0774b8e4..c1629a0c48 100644
--- a/drivers/net/idpf/idpf_logs.h
+++ b/drivers/net/idpf/idpf_logs.h
@@ -8,25 +8,22 @@
 #include <rte_log.h>
 
 extern int idpf_logtype_init;
+#define RTE_LOGTYPE_IDPF_INIT idpf_logtype_init
 extern int idpf_logtype_driver;
+#define RTE_LOGTYPE_IDPF_DRIVER idpf_logtype_driver
 
 #define PMD_INIT_LOG(level, ...) \
-	rte_log(RTE_LOG_ ## level, \
-		idpf_logtype_init, \
+	RTE_LOG_LINE(level, IDPF_INIT, \
 		RTE_FMT("%s(): " \
-			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+			RTE_FMT_HEAD(__VA_ARGS__,), \
 			__func__, \
 			RTE_FMT_TAIL(__VA_ARGS__,)))
 
-#define PMD_DRV_LOG_RAW(level, ...) \
-	rte_log(RTE_LOG_ ## level, \
-		idpf_logtype_driver, \
+#define PMD_DRV_LOG(level, ...) \
+	RTE_LOG_LINE(level, IDPF_DRIVER, \
 		RTE_FMT("%s(): " \
-			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+			RTE_FMT_HEAD(__VA_ARGS__,), \
 			__func__, \
 			RTE_FMT_TAIL(__VA_ARGS__,)))
 
-#define PMD_DRV_LOG(level, fmt, args...) \
-	PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
-
 #endif /* _IDPF_LOGS_H_ */
diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h
index 4a574f10cb..1046b45297 100644
--- a/drivers/net/igc/igc_logs.h
+++ b/drivers/net/igc/igc_logs.h
@@ -12,31 +12,29 @@ extern "C" {
 #endif
 
 extern int igc_logtype_init;
+#define RTE_LOGTYPE_IGC_INIT igc_logtype_init
 extern int igc_logtype_driver;
 #define RTE_LOGTYPE_IGC_DRIVER igc_logtype_driver
 
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, igc_logtype_init, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, IGC_INIT, "%s(): " fmt, __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_ETHDEV_DEBUG_RX
-#define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_RX_LOG(...) PMD_DRV_LOG(__VA_ARGS__)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
-#define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_TX_LOG(...) PMD_DRV_LOG(__VA_ARGS__)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #define PMD_DRV_LOG(level, fmt, args...) \
-	RTE_LOG(level, IGC_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, IGC_DRIVER, "%s(): " fmt, __func__, ## args)
 
 #ifdef __cplusplus
 }
diff --git a/drivers/net/ipn3ke/ipn3ke_logs.h b/drivers/net/ipn3ke/ipn3ke_logs.h
index 147fd8039e..c47a70ba9f 100644
--- a/drivers/net/ipn3ke/ipn3ke_logs.h
+++ b/drivers/net/ipn3ke/ipn3ke_logs.h
@@ -8,10 +8,10 @@
 #include <rte_log.h>
 
 extern int ipn3ke_afu_logtype;
+#define RTE_LOGTYPE_IPN3KE_AFU ipn3ke_afu_logtype
 
 #define IPN3KE_AFU_PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, ipn3ke_afu_logtype, "%s(): " fmt "\n", \
-		__func__, ##args)
+	RTE_LOG_LINE(level, IPN3KE_AFU, "%s(): " fmt, __func__, ##args)
 
 #define IPN3KE_AFU_PMD_FUNC_TRACE() IPN3KE_AFU_PMD_LOG(DEBUG, ">>")
 
diff --git a/drivers/net/ixgbe/ixgbe_logs.h b/drivers/net/ixgbe/ixgbe_logs.h
index 5a2c5ccde0..44a8f40810 100644
--- a/drivers/net/ixgbe/ixgbe_logs.h
+++ b/drivers/net/ixgbe/ixgbe_logs.h
@@ -6,26 +6,26 @@
 #define _IXGBE_LOGS_H_
 
 extern int ixgbe_logtype_init;
+#define RTE_LOGTYPE_IXGBE_INIT ixgbe_logtype_init
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, ixgbe_logtype_init, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, IXGBE_INIT, "%s(): " fmt, __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_ETHDEV_DEBUG_RX
 extern int ixgbe_logtype_rx;
-#define PMD_RX_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, ixgbe_logtype_rx,	\
-		"%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_IXGBE_RX ixgbe_logtype_rx
+#define PMD_RX_LOG(level, fmt, args...) \
+	RTE_LOG_LINE(level, IXGBE_RX, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
 extern int ixgbe_logtype_tx;
-#define PMD_TX_LOG(level, fmt, args...)			\
-	rte_log(RTE_LOG_ ## level, ixgbe_logtype_tx,	\
-		"%s(): " fmt "\n", __func__, ## args)
+#define RTE_LOGTYPE_IXGBE_TX ixgbe_logtype_tx
+#define PMD_TX_LOG(level, fmt, args...) \
+	RTE_LOG_LINE(level, IXGBE_TX, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
@@ -33,6 +33,6 @@ extern int ixgbe_logtype_tx;
 extern int ixgbe_logtype_driver;
 #define RTE_LOGTYPE_IXGBE_DRIVER ixgbe_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
-	RTE_LOG(level, IXGBE_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, IXGBE_DRIVER, "%s(): " fmt, __func__, ## args)
 
 #endif /* _IXGBE_LOGS_H_ */
diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h
index 37f654f0e6..757d7a173f 100644
--- a/drivers/net/mana/mana.h
+++ b/drivers/net/mana/mana.h
@@ -466,16 +466,17 @@ struct mana_rxq {
 extern int mana_logtype_driver;
 #define RTE_LOGTYPE_MANA_DRIVER mana_logtype_driver
 extern int mana_logtype_init;
+#define RTE_LOGTYPE_MANA_INIT mana_logtype_init
 
 #define DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, mana_logtype_driver, "%s(): " fmt "\n", \
+	RTE_LOG_LINE(level, MANA_DRIVER, "%s(): " fmt, \
 		__func__, ## args)
 
 #define DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, MANA_DRIVER, fmt "\n", ## args)
+	RTE_LOG_DP_LINE(level, MANA_DRIVER, fmt, ## args)
 
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, mana_logtype_init, "%s(): " fmt "\n",\
+	RTE_LOG_LINE(level, MANA_INIT, "%s(): " fmt,\
 		__func__, ## args)
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
diff --git a/drivers/net/memif/rte_eth_memif.h b/drivers/net/memif/rte_eth_memif.h
index f21806c811..e0f19d1aca 100644
--- a/drivers/net/memif/rte_eth_memif.h
+++ b/drivers/net/memif/rte_eth_memif.h
@@ -28,10 +28,11 @@
 #define MAX_PKT_BURST				32
 
 extern int memif_logtype;
+#define RTE_LOGTYPE_MEMIF memif_logtype
 
 #define MIF_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, memif_logtype, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, MEMIF, \
+		"%s(): " fmt, __func__, ##args)
 
 enum memif_role_t {
 	MEMIF_ROLE_SERVER,
diff --git a/drivers/net/mlx4/mlx4_utils.h b/drivers/net/mlx4/mlx4_utils.h
index fca21fd79c..0cf972e607 100644
--- a/drivers/net/mlx4/mlx4_utils.h
+++ b/drivers/net/mlx4/mlx4_utils.h
@@ -25,6 +25,7 @@
 #endif
 
 extern int mlx4_logtype;
+#define RTE_LOGTYPE_MLX4 mlx4_logtype
 
 #ifdef RTE_LIBRTE_MLX4_DEBUG
 
@@ -46,8 +47,8 @@ pmd_drv_log_basename(const char *s)
 }
 
 #define PMD_DRV_LOG(level, ...) \
-	rte_log(RTE_LOG_ ## level, mlx4_logtype, \
-		RTE_FMT("%s:%u: %s(): " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+	RTE_LOG_LINE(level, MLX4, \
+		RTE_FMT("%s:%u: %s(): " RTE_FMT_HEAD(__VA_ARGS__,), \
 			pmd_drv_log_basename(__FILE__), \
 			__LINE__, \
 			__func__, \
@@ -63,9 +64,9 @@ pmd_drv_log_basename(const char *s)
  */
 
 #define PMD_DRV_LOG(level, ...) \
-	rte_log(RTE_LOG_ ## level, mlx4_logtype, \
+	RTE_LOG_LINE(level, MLX4, \
 		RTE_FMT(MLX4_DRIVER_NAME ": " \
-			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+			RTE_FMT_HEAD(__VA_ARGS__,), \
 		RTE_FMT_TAIL(__VA_ARGS__,)))
 #define MLX4_ASSERT(exp) RTE_ASSERT(exp)
 #define claim_zero(...) (__VA_ARGS__)
diff --git a/drivers/net/mvneta/mvneta_ethdev.h b/drivers/net/mvneta/mvneta_ethdev.h
index 9e711d8e5a..4bf6e8d54c 100644
--- a/drivers/net/mvneta/mvneta_ethdev.h
+++ b/drivers/net/mvneta/mvneta_ethdev.h
@@ -83,9 +83,9 @@ struct mvneta_priv {
 
 /** Current log type. */
 extern int mvneta_logtype;
+#define RTE_LOGTYPE_MVNETA mvneta_logtype
 
 #define MVNETA_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, mvneta_logtype, "%s(): " fmt "\n", \
-		__func__, ##args)
+	RTE_LOG_LINE(level, MVNETA, "%s(): " fmt, __func__, ##args)
 
 #endif /* _MVNETA_ETHDEV_H_ */
diff --git a/drivers/net/mvpp2/mrvl_ethdev.h b/drivers/net/mvpp2/mrvl_ethdev.h
index 178b5103ba..35a5231824 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.h
+++ b/drivers/net/mvpp2/mrvl_ethdev.h
@@ -200,9 +200,10 @@ extern const struct rte_tm_ops mrvl_tm_ops;
 
 /** Current log type. */
 extern int mrvl_logtype;
+#define RTE_LOGTYPE_MRVL mrvl_logtype
 
 #define MRVL_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, mrvl_logtype, "%s(): " fmt "\n", \
+	RTE_LOG_LINE(level, MRVL, "%s(): " fmt, \
 		__func__, ##args)
 
 extern struct pp2_bpool *dummy_pool[PP2_NUM_PKT_PROC];
diff --git a/drivers/net/netvsc/hn_logs.h b/drivers/net/netvsc/hn_logs.h
index cddadef09c..6ce3209955 100644
--- a/drivers/net/netvsc/hn_logs.h
+++ b/drivers/net/netvsc/hn_logs.h
@@ -6,31 +6,29 @@
 #include <rte_log.h>
 
 extern int hn_logtype_init;
+#define RTE_LOGTYPE_HN_INIT hn_logtype_init
 extern int hn_logtype_driver;
+#define RTE_LOGTYPE_HN_DRIVER hn_logtype_driver
 
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, hn_logtype_init, "%s(): " fmt "\n",\
-		__func__, ## args)
+	RTE_LOG_LINE(level, HN_INIT, "%s(): " fmt, __func__, ## args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_LIBRTE_NETVSC_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, hn_logtype_driver, \
-		"%s() rx: " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, HN_DRIVER, "%s() rx: " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_NETVSC_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, hn_logtype_driver, \
-		"%s() tx: " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, HN_DRIVER, "%s() tx: " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, hn_logtype_driver, "%s(): " fmt "\n", \
-		__func__, ## args)
+	RTE_LOG_LINE(level, HN_DRIVER, "%s(): " fmt, __func__, ## args)
 
 #endif /* _HN_LOGS_H_ */
diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c
index 1ba75ee804..b2dae6474a 100644
--- a/drivers/net/netvsc/hn_rndis.c
+++ b/drivers/net/netvsc/hn_rndis.c
@@ -95,8 +95,8 @@ void hn_rndis_dump(const void *buf)
 		const struct rndis_pktinfo *ppi;
 		unsigned int ppi_len;
 
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-			    "RNDIS_MSG_PACKET (len %u, data %u:%u, # oob %u %u:%u, pkt %u:%u)\n",
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
+			    "RNDIS_MSG_PACKET (len %u, data %u:%u, # oob %u %u:%u, pkt %u:%u)",
 			    rndis_msg->pkt.len,
 			    rndis_msg->pkt.dataoffset,
 			    rndis_msg->pkt.datalen,
@@ -116,8 +116,8 @@ void hn_rndis_dump(const void *buf)
 
 			ppi_data = ppi->data;
 
-			rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-				"    PPI (size %u, type %u, offs %u data %#x)\n",
+			RTE_LOG_LINE(DEBUG, HN_DRIVER,
+				"    PPI (size %u, type %u, offs %u data %#x)",
 				ppi->size, ppi->type, ppi->offset,
 				*(const uint32_t *)ppi_data);
 			if (ppi->size == 0)
@@ -129,8 +129,8 @@ void hn_rndis_dump(const void *buf)
 		break;
 	}
 	case RNDIS_INITIALIZE_MSG:
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-			    "RNDIS_MSG_INIT (len %u id %#x, ver %u.%u max xfer %u)\n",
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
+			    "RNDIS_MSG_INIT (len %u id %#x, ver %u.%u max xfer %u)",
 			    rndis_msg->init_request.len,
 			    rndis_msg->init_request.rid,
 			    rndis_msg->init_request.ver_major,
@@ -139,9 +139,9 @@ void hn_rndis_dump(const void *buf)
 		break;
 
 	case RNDIS_INITIALIZE_CMPLT:
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
 			    "RNDIS_MSG_INIT_C (len %u, id %#x, status 0x%x, vers %u.%u, "
-			    "flags %d, max xfer %u, max pkts %u, aligned %u)\n",
+			    "flags %d, max xfer %u, max pkts %u, aligned %u)",
 			    rndis_msg->init_complete.len,
 			    rndis_msg->init_complete.rid,
 			    rndis_msg->init_complete.status,
@@ -154,14 +154,14 @@ void hn_rndis_dump(const void *buf)
 		break;
 
 	case RNDIS_HALT_MSG:
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-			    "RNDIS_HALT (len %u id %#x)\n",
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
+			    "RNDIS_HALT (len %u id %#x)",
 			    rndis_msg->halt.len, rndis_msg->halt.rid);
 		break;
 
 	case RNDIS_QUERY_MSG:
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-			    "RNDIS_QUERY (len %u, id %#x, oid %#x, info %u:%u)\n",
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
+			    "RNDIS_QUERY (len %u, id %#x, oid %#x, info %u:%u)",
 			    rndis_msg->query_request.len,
 			    rndis_msg->query_request.rid,
 			    rndis_msg->query_request.oid,
@@ -170,8 +170,8 @@ void hn_rndis_dump(const void *buf)
 		break;
 
 	case RNDIS_QUERY_CMPLT:
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-			    "RNDIS_MSG_QUERY_C (len %u, id %#x, status 0x%x, buf %u:%u)\n",
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
+			    "RNDIS_MSG_QUERY_C (len %u, id %#x, status 0x%x, buf %u:%u)",
 			    rndis_msg->query_complete.len,
 			    rndis_msg->query_complete.rid,
 			    rndis_msg->query_complete.status,
@@ -180,8 +180,8 @@ void hn_rndis_dump(const void *buf)
 		break;
 
 	case RNDIS_SET_MSG:
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-			    "RNDIS_SET (len %u, id %#x, oid %#x, info %u:%u)\n",
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
+			    "RNDIS_SET (len %u, id %#x, oid %#x, info %u:%u)",
 			    rndis_msg->set_request.len,
 			    rndis_msg->set_request.rid,
 			    rndis_msg->set_request.oid,
@@ -190,16 +190,16 @@ void hn_rndis_dump(const void *buf)
 		break;
 
 	case RNDIS_SET_CMPLT:
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-			    "RNDIS_MSG_SET_C (len %u, id 0x%x, status 0x%x)\n",
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
+			    "RNDIS_MSG_SET_C (len %u, id 0x%x, status 0x%x)",
 			    rndis_msg->set_complete.len,
 			    rndis_msg->set_complete.rid,
 			    rndis_msg->set_complete.status);
 		break;
 
 	case RNDIS_INDICATE_STATUS_MSG:
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-			    "RNDIS_MSG_INDICATE (len %u, status %#x, buf len %u, buf offset %u)\n",
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
+			    "RNDIS_MSG_INDICATE (len %u, status %#x, buf len %u, buf offset %u)",
 			    rndis_msg->indicate_status.len,
 			    rndis_msg->indicate_status.status,
 			    rndis_msg->indicate_status.stbuflen,
@@ -207,38 +207,38 @@ void hn_rndis_dump(const void *buf)
 		break;
 
 	case RNDIS_RESET_MSG:
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-			    "RNDIS_RESET (len %u, id %#x)\n",
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
+			    "RNDIS_RESET (len %u, id %#x)",
 			    rndis_msg->reset_request.len,
 			    rndis_msg->reset_request.rid);
 		break;
 
 	case RNDIS_RESET_CMPLT:
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-			    "RNDIS_RESET_C (len %u, status %#x address %#x)\n",
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
+			    "RNDIS_RESET_C (len %u, status %#x address %#x)",
 			    rndis_msg->reset_complete.len,
 			    rndis_msg->reset_complete.status,
 			    rndis_msg->reset_complete.adrreset);
 		break;
 
 	case RNDIS_KEEPALIVE_MSG:
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-			    "RNDIS_KEEPALIVE (len %u, id %#x)\n",
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
+			    "RNDIS_KEEPALIVE (len %u, id %#x)",
 			    rndis_msg->keepalive_request.len,
 			    rndis_msg->keepalive_request.rid);
 		break;
 
 	case RNDIS_KEEPALIVE_CMPLT:
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-			    "RNDIS_KEEPALIVE_C (len %u, id %#x address %#x)\n",
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
+			    "RNDIS_KEEPALIVE_C (len %u, id %#x address %#x)",
 			    rndis_msg->keepalive_complete.len,
 			    rndis_msg->keepalive_complete.rid,
 			    rndis_msg->keepalive_complete.status);
 		break;
 
 	default:
-		rte_log(RTE_LOG_DEBUG, hn_logtype_driver,
-			    "RNDIS type %#x len %u\n",
+		RTE_LOG_LINE(DEBUG, HN_DRIVER,
+			    "RNDIS type %#x len %u",
 			    rndis_msg->hdr.type,
 			    rndis_msg->hdr.len);
 		break;
diff --git a/drivers/net/nfb/nfb.h b/drivers/net/nfb/nfb.h
index ca0b647571..f318bc8b7b 100644
--- a/drivers/net/nfb/nfb.h
+++ b/drivers/net/nfb/nfb.h
@@ -13,9 +13,9 @@
 #include <netcope/txmac.h>
 
 extern int nfb_logtype;
+#define RTE_LOGTYPE_NFB nfb_logtype
 #define NFB_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, nfb_logtype, "%s(): " fmt "\n", \
-		__func__, ## args)
+	RTE_LOG_LINE(level, NFB, "%s(): " fmt, __func__, ## args)
 
 #include "nfb_rx.h"
 #include "nfb_tx.h"
diff --git a/drivers/net/nfp/nfp_logs.h b/drivers/net/nfp/nfp_logs.h
index 690adabffd..e502ff863e 100644
--- a/drivers/net/nfp/nfp_logs.h
+++ b/drivers/net/nfp/nfp_logs.h
@@ -9,36 +9,36 @@
 #include <rte_log.h>
 
 extern int nfp_logtype_init;
+#define RTE_LOGTYPE_NFP_INIT nfp_logtype_init
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, nfp_logtype_init, \
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, NFP_INIT, "%s(): " fmt, __func__, ## args)
 
 #ifdef RTE_ETHDEV_DEBUG_RX
 extern int nfp_logtype_rx;
+#define RTE_LOGTYPE_NFP_RX nfp_logtype_rx
 #define PMD_RX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, nfp_logtype_rx, \
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, NFP_RX, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
 extern int nfp_logtype_tx;
+#define RTE_LOGTYPE_NFP_TX nfp_logtype_tx
 #define PMD_TX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, nfp_logtype_tx, \
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, NFP_TX, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 extern int nfp_logtype_cpp;
+#define RTE_LOGTYPE_NFP_CPP nfp_logtype_cpp
 #define PMD_CPP_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, nfp_logtype_cpp, \
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, NFP_CPP, "%s(): " fmt, __func__, ## args)
 
 extern int nfp_logtype_driver;
+#define RTE_LOGTYPE_NFP_DRIVER nfp_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, nfp_logtype_driver, \
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, NFP_DRIVER, "%s(): " fmt, __func__, ## args)
 
 #endif /* __NFP_LOGS_H__ */
diff --git a/drivers/net/ngbe/ngbe_logs.h b/drivers/net/ngbe/ngbe_logs.h
index e5165ffd60..4f5e4c5757 100644
--- a/drivers/net/ngbe/ngbe_logs.h
+++ b/drivers/net/ngbe/ngbe_logs.h
@@ -10,29 +10,33 @@
  * PMD_USER_LOG: for user
  */
 extern int ngbe_logtype_init;
+#define RTE_LOGTYPE_NGBE_INIT ngbe_logtype_init
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, ngbe_logtype_init, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, NGBE_INIT, \
+		"%s(): " fmt, __func__, ##args)
 
 extern int ngbe_logtype_driver;
+#define RTE_LOGTYPE_NGBE_DRIVER ngbe_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, ngbe_logtype_driver, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, NGBE_DRIVER, \
+		"%s(): " fmt, __func__, ##args)
 
 #ifdef RTE_ETHDEV_DEBUG_RX
 extern int ngbe_logtype_rx;
+#define RTE_LOGTYPE_NGBE_RX ngbe_logtype_rx
 #define PMD_RX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, ngbe_logtype_rx,	\
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, NGBE_RX,	\
+		"%s(): " fmt, __func__, ##args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_ETHDEV_DEBUG_TX
 extern int ngbe_logtype_tx;
+#define RTE_LOGTYPE_NGBE_TX ngbe_logtype_tx
 #define PMD_TX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, ngbe_logtype_tx,	\
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, NGBE_TX,	\
+		"%s(): " fmt, __func__, ##args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index f4ed3b8a7f..f5fec3d692 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -76,10 +76,11 @@ static struct rte_eth_link pmd_link = {
 };
 
 RTE_LOG_REGISTER_DEFAULT(eth_null_logtype, NOTICE);
+#define RTE_LOGTYPE_ETH_NULL eth_null_logtype
 
 #define PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, eth_null_logtype, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, ETH_NULL, \
+		"%s(): " fmt, __func__, ##args)
 
 static uint16_t
 eth_null_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
diff --git a/drivers/net/octeon_ep/otx_ep_common.h b/drivers/net/octeon_ep/otx_ep_common.h
index 7d5dd91a77..ea9788757e 100644
--- a/drivers/net/octeon_ep/otx_ep_common.h
+++ b/drivers/net/octeon_ep/otx_ep_common.h
@@ -68,18 +68,18 @@
 #define OTX_CUST_DATA_LEN 0
 
 #define otx_ep_info(fmt, args...)				\
-	rte_log(RTE_LOG_INFO, otx_net_ep_logtype,		\
-		"%s():%u " fmt "\n",				\
+	RTE_LOG_LINE(INFO, OTX_NET_EP,		\
+		"%s():%u " fmt,				\
 		__func__, __LINE__, ##args)
 
 #define otx_ep_err(fmt, args...)				\
-	rte_log(RTE_LOG_ERR, otx_net_ep_logtype,		\
-		"%s():%u " fmt "\n",				\
+	RTE_LOG_LINE(ERR, OTX_NET_EP,		\
+		"%s():%u " fmt,				\
 		__func__, __LINE__, ##args)
 
 #define otx_ep_dbg(fmt, args...)				\
-	rte_log(RTE_LOG_DEBUG, otx_net_ep_logtype,		\
-		"%s():%u " fmt "\n",				\
+	RTE_LOG_LINE(DEBUG, OTX_NET_EP,		\
+		"%s():%u " fmt,				\
 		__func__, __LINE__, ##args)
 
 /* IO Access */
diff --git a/drivers/net/octeon_ep/otx_ep_rxtx.c b/drivers/net/octeon_ep/otx_ep_rxtx.c
index 9680a59797..09ed3c8da0 100644
--- a/drivers/net/octeon_ep/otx_ep_rxtx.c
+++ b/drivers/net/octeon_ep/otx_ep_rxtx.c
@@ -916,9 +916,9 @@ otx_ep_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		next_fetch = (pkts == new_pkts - 1) ? 0 : 1;
 		oq_pkt = otx_ep_droq_read_packet(otx_ep, droq, next_fetch);
 		if (!oq_pkt) {
-			RTE_LOG_DP(ERR, OTX_NET_EP,
+			RTE_LOG_DP_LINE(ERR, OTX_NET_EP,
 				   "DROQ read pkt failed pending %" PRIu64
-				    "last_pkt_count %" PRIu64 "new_pkts %d.\n",
+				    "last_pkt_count %" PRIu64 "new_pkts %d.",
 				   droq->pkts_pending, droq->last_pkt_count,
 				   new_pkts);
 			droq->stats.rx_err++;
diff --git a/drivers/net/octeontx/octeontx_logs.h b/drivers/net/octeontx/octeontx_logs.h
index b58f296478..49ff18d8c4 100644
--- a/drivers/net/octeontx/octeontx_logs.h
+++ b/drivers/net/octeontx/octeontx_logs.h
@@ -6,21 +6,21 @@
 #define __OCTEONTX_LOGS_H__
 
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, otx_net_logtype_init, \
-			"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, OTX_NET_INIT, \
+			"%s(): " fmt, __func__, ## args)
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, ">>")
 
 #define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, otx_net_logtype_driver, \
-			"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, OTX_NET_DRIVER, \
+			"%s(): " fmt, __func__, ## args)
 
 #define PMD_MBOX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, otx_net_logtype_mbox, \
-			"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, OTX_NET_MBOX, \
+			"%s(): " fmt, __func__, ## args)
 
 #define octeontx_log_info(fmt, args...)			\
-	RTE_LOG(INFO, OTX_NET_DRIVER, fmt "\n", ## args)
+	RTE_LOG_LINE(INFO, OTX_NET_DRIVER, fmt, ## args)
 
 #define octeontx_log_err(s, ...) PMD_INIT_LOG(ERR, s, ##__VA_ARGS__)
 #define octeontx_log_dbg(s, ...) PMD_DRV_LOG(DEBUG, s, ##__VA_ARGS__)
@@ -30,8 +30,10 @@
 #define PMD_TX_LOG	PMD_DRV_LOG
 
 extern int otx_net_logtype_init;
+#define RTE_LOGTYPE_OTX_NET_INIT otx_net_logtype_init
 extern int otx_net_logtype_driver;
 #define RTE_LOGTYPE_OTX_NET_DRIVER otx_net_logtype_driver
 extern int otx_net_logtype_mbox;
+#define RTE_LOGTYPE_OTX_NET_MBOX otx_net_logtype_mbox
 
 #endif /* __OCTEONTX_LOGS_H__*/
diff --git a/drivers/net/pcap/pcap_osdep.h b/drivers/net/pcap/pcap_osdep.h
index bf41cba982..309a15bc80 100644
--- a/drivers/net/pcap/pcap_osdep.h
+++ b/drivers/net/pcap/pcap_osdep.h
@@ -8,9 +8,10 @@
 #include <rte_ether.h>
 
 #define PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, eth_pcap_logtype, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, ETH_PCAP, \
+		"%s(): " fmt, __func__, ##args)
 extern int eth_pcap_logtype;
+#define RTE_LOGTYPE_ETH_PCAP eth_pcap_logtype
 
 int osdep_iface_index_get(const char *name);
 int osdep_iface_mac_get(const char *name, struct rte_ether_addr *mac);
diff --git a/drivers/net/pfe/pfe_logs.h b/drivers/net/pfe/pfe_logs.h
index 369a50bec5..d0270caa60 100644
--- a/drivers/net/pfe/pfe_logs.h
+++ b/drivers/net/pfe/pfe_logs.h
@@ -6,12 +6,11 @@
 #define _PFE_LOGS_H_
 
 extern int pfe_logtype_pmd;
-#define RTE_LOGTYPE_PFE_PMD pfe_logtype_pmd
+#define RTE_LOGTYPE_PFE_NET pfe_logtype_pmd
 
 /* PMD related logs */
 #define PFE_PMD_LOG(level, fmt, args...) \
-	 rte_log(RTE_LOG_ ## level, pfe_logtype_pmd, "pfe_net: %s()" \
-		 fmt "\n", __func__, ##args)
+	 RTE_LOG_LINE(level, PFE_NET, "%s()" fmt, __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() PFE_PMD_LOG(DEBUG, " >>")
 
@@ -27,6 +26,6 @@ extern int pfe_logtype_pmd;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define PFE_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, PFE_PMD, fmt, ## args)
+	RTE_LOG_DP_LINE(level, PFE_NET, fmt, ## args)
 
 #endif /* _PFE_LOGS_H_ */
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 1346a0dba3..a206c40f4b 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -68,10 +68,11 @@ static struct rte_eth_link pmd_link = {
 };
 
 RTE_LOG_REGISTER_DEFAULT(eth_ring_logtype, NOTICE);
+#define RTE_LOGTYPE_ETH_RING eth_ring_logtype
 
 #define PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, eth_ring_logtype, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, ETH_RING, \
+		"%s(): " fmt, __func__, ##args)
 
 static uint16_t
 eth_ring_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index 1b90cf7a21..5d569454b5 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -51,10 +51,11 @@ static const struct softnic_conn_params conn_params_default = {
 };
 
 RTE_LOG_REGISTER_DEFAULT(pmd_softnic_logtype, NOTICE);
+#define RTE_LOGTYPE_PMD_SOFTNIC pmd_softnic_logtype
 
 #define PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, pmd_softnic_logtype, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, PMD_SOFTNIC, \
+		"%s(): " fmt, __func__, ##args)
 
 static int
 pmd_dev_infos_get(struct rte_eth_dev *dev __rte_unused,
diff --git a/drivers/net/tap/tap_log.h b/drivers/net/tap/tap_log.h
index fa06843a4c..23e992bf34 100644
--- a/drivers/net/tap/tap_log.h
+++ b/drivers/net/tap/tap_log.h
@@ -4,7 +4,8 @@
  */
 
 extern int tap_logtype;
+#define RTE_LOGTYPE_TAP tap_logtype
 
 #define TAP_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, tap_logtype, "%s(): " fmt "\n", \
+	RTE_LOG_LINE(level, TAP, "%s(): " fmt, \
 		__func__, ## args)
diff --git a/drivers/net/thunderx/nicvf_logs.h b/drivers/net/thunderx/nicvf_logs.h
index 3c455b4288..4a1ad7af63 100644
--- a/drivers/net/thunderx/nicvf_logs.h
+++ b/drivers/net/thunderx/nicvf_logs.h
@@ -20,25 +20,25 @@
 #endif
 
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, nicvf_logtype_init, \
-			"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, NICVF_INIT, "%s(): " fmt, __func__, ## args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, ">>")
 
 #define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, nicvf_logtype_driver, \
-			"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, NICVF_DRIVER, "%s(): " fmt, __func__, ## args)
 #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>")
 
 #define PMD_MBOX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, nicvf_logtype_mbox, \
-			"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, NICVF_MBOX, "%s(): " fmt, __func__, ## args)
 #define PMD_MBOX_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>")
 
 #define PMD_RX_LOG PMD_DRV_LOG
 #define PMD_TX_LOG PMD_DRV_LOG
 
 extern int nicvf_logtype_init;
+#define RTE_LOGTYPE_NICVF_INIT nicvf_logtype_init
 extern int nicvf_logtype_driver;
+#define RTE_LOGTYPE_NICVF_DRIVER nicvf_logtype_driver
 extern int nicvf_logtype_mbox;
+#define RTE_LOGTYPE_NICVF_MBOX nicvf_logtype_mbox
 
 #endif /* __THUNDERX_NICVF_LOGS__ */
diff --git a/drivers/net/txgbe/txgbe_logs.h b/drivers/net/txgbe/txgbe_logs.h
index b5a5a9233f..f0fc23f65c 100644
--- a/drivers/net/txgbe/txgbe_logs.h
+++ b/drivers/net/txgbe/txgbe_logs.h
@@ -12,38 +12,44 @@
  * PMD_USER_LOG: for user
  */
 extern int txgbe_logtype_init;
+#define RTE_LOGTYPE_TXGBE_INIT txgbe_logtype_init
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, txgbe_logtype_init, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, TXGBE_INIT, \
+		"%s(): " fmt, __func__, ##args)
 
 extern int txgbe_logtype_driver;
+#define RTE_LOGTYPE_TXGBE_DRIVER txgbe_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, txgbe_logtype_driver, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, TXGBE_DRIVER, \
+		"%s(): " fmt, __func__, ##args)
 
 #ifdef RTE_LIBRTE_TXGBE_DEBUG_RX
 extern int txgbe_logtype_rx;
+#define RTE_LOGTYPE_TXGBE_RX txgbe_logtype_rx
 #define PMD_RX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, txgbe_logtype_rx,	\
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, TXGBE_RX,	\
+		"%s(): " fmt, __func__, ##args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_TXGBE_DEBUG_TX
 extern int txgbe_logtype_tx;
+#define RTE_LOGTYPE_TXGBE_TX txgbe_logtype_tx
 #define PMD_TX_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, txgbe_logtype_tx,	\
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, TXGBE_TX,	\
+		"%s(): " fmt, __func__, ##args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
 #ifdef RTE_LIBRTE_TXGBE_DEBUG_TX_FREE
 extern int txgbe_logtype_tx_free;
+#define RTE_LOGTYPE_TXGBE_TX_FREE txgbe_logtype_tx_free
+#define RTE_LOGTYPE_TXGBE_TX txgbe_logtype_tx
 #define PMD_TX_FREE_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, txgbe_logtype_tx_free,	\
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, TXGBE_TX_FREE,	\
+		"%s(): " fmt, __func__, ##args)
 #else
 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while (0)
 #endif
diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index c3e045d892..9e7ab792ec 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -49,12 +49,12 @@
 #define NETVSC_MAX_ROUTE_LINE_SIZE 300
 
 RTE_LOG_REGISTER_DEFAULT(vdev_netvsc_logtype, NOTICE);
+#define RTE_LOGTYPE_VDEV_NETVSC vdev_netvsc_logtype
 
 #define DRV_LOG(level, ...) \
-	rte_log(RTE_LOG_ ## level, \
-		vdev_netvsc_logtype, \
+	RTE_LOG_LINE(level, VDEV_NETVSC, \
 		RTE_FMT(VDEV_NETVSC_DRIVER_NAME ": " \
-			RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+			RTE_FMT_HEAD(__VA_ARGS__,), \
 		RTE_FMT_TAIL(__VA_ARGS__,)))
 
 /** Context structure for a vdev_netvsc instance. */
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 6ccb228872..87c05caccd 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -25,8 +25,7 @@ RTE_LOG_REGISTER_DEFAULT(vhost_logtype, NOTICE);
 #define RTE_LOGTYPE_VHOST vhost_logtype
 
 #define VHOST_LOG_LINE(level, ...) \
-	RTE_LOG(level, VHOST, RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \
-		RTE_FMT_TAIL(__VA_ARGS__ ,)))
+	RTE_LOG_LINE(level, VHOST, __VA_ARGS__)
 
 enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM};
 
diff --git a/drivers/net/virtio/virtio_logs.h b/drivers/net/virtio/virtio_logs.h
index 01911514bd..a31a975df4 100644
--- a/drivers/net/virtio/virtio_logs.h
+++ b/drivers/net/virtio/virtio_logs.h
@@ -8,22 +8,23 @@
 #include <rte_log.h>
 
 extern int virtio_logtype_init;
+#define RTE_LOGTYPE_VIRTIO_INIT virtio_logtype_init
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, virtio_logtype_init, \
-		"%s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, VIRTIO_INIT, \
+		"%s(): " fmt, __func__, ##args)
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, VIRTIO_DRIVER, "%s() rx: " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, VIRTIO_DRIVER, "%s() rx: " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, VIRTIO_DRIVER, "%s() tx: " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, VIRTIO_DRIVER, "%s() tx: " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
@@ -31,7 +32,7 @@ extern int virtio_logtype_init;
 extern int virtio_logtype_driver;
 #define RTE_LOGTYPE_VIRTIO_DRIVER virtio_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, virtio_logtype_driver, \
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, VIRTIO_DRIVER, \
+		"%s(): " fmt, __func__, ## args)
 
 #endif /* _VIRTIO_LOGS_H_ */
diff --git a/drivers/net/vmxnet3/vmxnet3_logs.h b/drivers/net/vmxnet3/vmxnet3_logs.h
index 5962325d62..e39ce30207 100644
--- a/drivers/net/vmxnet3/vmxnet3_logs.h
+++ b/drivers/net/vmxnet3/vmxnet3_logs.h
@@ -6,28 +6,29 @@
 #define _VMXNET3_LOGS_H_
 
 extern int vmxnet3_logtype_init;
+#define RTE_LOGTYPE_VMXNET3_INIT vmxnet3_logtype_init
 #define PMD_INIT_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_init, \
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, VMXNET3_INIT, \
+		"%s(): " fmt, __func__, ## args)
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-	RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, VMXNET3_DRIVER, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-	RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, VMXNET3_DRIVER, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE
 #define PMD_TX_FREE_LOG(level, fmt, args...) \
-	RTE_LOG(level, VMXNET3_DRIVER, "%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, VMXNET3_DRIVER, "%s(): " fmt, __func__, ## args)
 #else
 #define PMD_TX_FREE_LOG(level, fmt, args...) do { } while(0)
 #endif
@@ -35,7 +36,6 @@ extern int vmxnet3_logtype_init;
 extern int vmxnet3_logtype_driver;
 #define RTE_LOGTYPE_VMXNET3_DRIVER vmxnet3_logtype_driver
 #define PMD_DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, vmxnet3_logtype_driver, \
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, VMXNET3_DRIVER, "%s(): " fmt, __func__, ## args)
 
 #endif /* _VMXNET3_LOGS_H_ */
diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
index 790b4d2a5a..0ab952bb84 100644
--- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
+++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
@@ -27,10 +27,10 @@ extern "C" {
 #endif
 
 extern int cnxk_logtype_bphy;
+#define RTE_LOGTYPE_CNXK_BPHY cnxk_logtype_bphy
 
 #define CNXK_BPHY_LOG(level, fmt, args...)	\
-	rte_log(RTE_LOG_ ## level, cnxk_logtype_bphy, \
-		"%s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, CNXK_BPHY, "%s(): " fmt, __func__, ## args)
 
 /** Available message types */
 enum cnxk_bphy_cgx_msg_type {
diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio.h b/drivers/raw/cnxk_gpio/cnxk_gpio.h
index 336d7ac373..1ee9d66912 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio.h
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio.h
@@ -6,9 +6,10 @@
 #define _CNXK_GPIO_H_
 
 extern int cnxk_logtype_gpio;
+#define RTE_LOGTYPE_CNXK_GPIO cnxk_logtype_gpio
 
 #define CNXK_GPIO_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, cnxk_logtype_gpio, fmt "\n", ## args)
+	RTE_LOG_LINE(level, CNXK_GPIO, fmt, ## args)
 
 struct cnxk_gpiochip;
 
diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h
index f5f2455413..746f02bb10 100644
--- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h
+++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h
@@ -13,12 +13,12 @@ extern int dpaa2_cmdif_logtype;
 #define RTE_LOGTYPE_DPAA2_CMDIF dpaa2_cmdif_logtype
 
 #define DPAA2_CMDIF_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, dpaa2_cmdif_logtype, "dpaa2_cmdif: " \
-		fmt "\n", ## args)
+	RTE_LOG_LINE(level, DPAA2_CMDIF, \
+		fmt, ## args)
 
 #define DPAA2_CMDIF_DEBUG(fmt, args...) \
-	rte_log(RTE_LOG_DEBUG, dpaa2_cmdif_logtype, "dpaa2_cmdif: %s(): " \
-		fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(DEBUG, DPAA2_CMDIF, "%s(): " \
+		fmt, __func__, ## args)
 
 #define DPAA2_CMDIF_FUNC_TRACE() DPAA2_CMDIF_DEBUG(">>")
 
@@ -31,7 +31,7 @@ extern int dpaa2_cmdif_logtype;
 
 /* DP Logs, toggled out at compile time if level lower than current level */
 #define DPAA2_CMDIF_DP_LOG(level, fmt, args...) \
-	RTE_LOG_DP(level, DPAA2_CMDIF, "dpaa2_cmdif: " fmt "\n", ## args)
+	RTE_LOG_DP_LINE(level, DPAA2_CMDIF, fmt, ## args)
 
 #define DPAA2_CMDIF_DP_DEBUG(fmt, args...) \
 	DPAA2_CMDIF_DP_LOG(DEBUG, fmt, ## args)
diff --git a/drivers/raw/ifpga/ifpga_rawdev.h b/drivers/raw/ifpga/ifpga_rawdev.h
index 0fb66cbaae..973d83f6e9 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.h
+++ b/drivers/raw/ifpga/ifpga_rawdev.h
@@ -6,11 +6,12 @@
 #define _IFPGA_RAWDEV_H_
 
 extern int ifpga_rawdev_logtype;
+#define RTE_LOGTYPE_IFPGA_RAWDEV ifpga_rawdev_logtype
 
 #define IFPGA_RAWDEV_NAME_FMT "IFPGA:%02x:%02x.%x"
 
 #define IFPGA_RAWDEV_PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, ifpga_rawdev_logtype, "%s(): " fmt "\n", \
+	RTE_LOG_LINE(level, IFPGA_RAWDEV, "%s(): " fmt, \
 				__func__, ##args)
 
 #define IFPGA_RAWDEV_PMD_FUNC_TRACE() IFPGA_RAWDEV_PMD_LOG(DEBUG, ">>")
diff --git a/drivers/raw/ntb/ntb.h b/drivers/raw/ntb/ntb.h
index 563ceddf18..784e6baa9b 100644
--- a/drivers/raw/ntb/ntb.h
+++ b/drivers/raw/ntb/ntb.h
@@ -8,9 +8,10 @@
 #include <stdbool.h>
 
 extern int ntb_logtype;
+#define RTE_LOGTYPE_NTB ntb_logtype
 
 #define NTB_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, ntb_logtype,	"%s(): " fmt "\n", \
+	RTE_LOG_LINE(level, NTB,	"%s(): " fmt, \
 		__func__, ##args)
 
 /* Vendor ID */
diff --git a/drivers/raw/skeleton/skeleton_rawdev.h b/drivers/raw/skeleton/skeleton_rawdev.h
index c3f92e72ab..9e853633f0 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.h
+++ b/drivers/raw/skeleton/skeleton_rawdev.h
@@ -8,9 +8,10 @@
 #include <rte_rawdev.h>
 
 extern int skeleton_pmd_logtype;
+#define RTE_LOGTYPE_SKELETON_PMD skeleton_pmd_logtype
 
 #define SKELETON_PMD_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, skeleton_pmd_logtype, "%s(): " fmt "\n", \
+	RTE_LOG_LINE(level, SKELETON_PMD, "%s(): " fmt, \
 		__func__, ##args)
 
 #define SKELETON_PMD_FUNC_TRACE() SKELETON_PMD_LOG(DEBUG, ">>")
diff --git a/drivers/raw/skeleton/skeleton_rawdev_test.c b/drivers/raw/skeleton/skeleton_rawdev_test.c
index b7a7f623aa..00b77284d8 100644
--- a/drivers/raw/skeleton/skeleton_rawdev_test.c
+++ b/drivers/raw/skeleton/skeleton_rawdev_test.c
@@ -19,7 +19,7 @@
 #define TEST_DEV_NAME "rawdev_skeleton"
 
 #define SKELDEV_LOGS(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, skeleton_pmd_logtype, fmt "\n", \
+	RTE_LOG_LINE(level, SKELETON_PMD, fmt, \
 		##args)
 
 #define SKELDEV_TEST_INFO(fmt, args...) \
diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.c
index 8479172bfa..54067f94aa 100644
--- a/drivers/vdpa/ifc/base/ifcvf.c
+++ b/drivers/vdpa/ifc/base/ifcvf.c
@@ -224,10 +224,10 @@ ifcvf_enable_mq(struct ifcvf_hw *hw)
 	if (mq_cfg) {
 		if (hw->device_type == IFCVF_BLK) {
 			*(u32 *)mq_cfg = nr_queue;
-			RTE_LOG(INFO, IFCVF_VDPA, "%d queues are enabled\n", nr_queue);
+			RTE_LOG_LINE(INFO, IFCVF_VDPA, "%d queues are enabled", nr_queue);
 		} else {
 			*(u32 *)mq_cfg = nr_queue / 2;
-			RTE_LOG(INFO, IFCVF_VDPA, "%d queue pairs are enabled\n",
+			RTE_LOG_LINE(INFO, IFCVF_VDPA, "%d queue pairs are enabled",
 				nr_queue / 2);
 		}
 	}
@@ -246,7 +246,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)
 
 	cfg = hw->common_cfg;
 	if (!cfg) {
-		RTE_LOG(ERR, IFCVF_VDPA, "common_cfg in HW is NULL.\n");
+		RTE_LOG_LINE(ERR, IFCVF_VDPA, "common_cfg in HW is NULL.");
 		return -1;
 	}
 
@@ -258,7 +258,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)
 		IFCVF_WRITE_REG16(i + 1, &cfg->queue_msix_vector);
 		msix_vector = IFCVF_READ_REG16(&cfg->queue_msix_vector);
 		if (msix_vector == IFCVF_MSI_NO_VECTOR) {
-			RTE_LOG(ERR, IFCVF_VDPA, "queue %d, msix vec alloc failed\n",
+			RTE_LOG_LINE(ERR, IFCVF_VDPA, "queue %d, msix vec alloc failed",
 				i);
 			return -1;
 		}
@@ -307,7 +307,7 @@ ifcvf_disable_vring_hw(struct ifcvf_hw *hw, int i)
 
 	cfg = hw->common_cfg;
 	if (!cfg) {
-		RTE_LOG(ERR, IFCVF_VDPA, "common_cfg in HW is NULL.\n");
+		RTE_LOG_LINE(ERR, IFCVF_VDPA, "common_cfg in HW is NULL.");
 		return;
 	}
 
diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 2958368813..8b61da5968 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -33,9 +33,10 @@
 #define MIN(v1, v2)	((v1) < (v2) ? (v1) : (v2))
 
 RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);
+#define RTE_LOGTYPE_IFCVF_VDPA ifcvf_vdpa_logtype
 #define DRV_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \
-		"IFCVF %s(): " fmt "\n", __func__, ##args)
+	RTE_LOG_LINE(level, IFCVF_VDPA, \
+		"%s(): " fmt, __func__, ##args)
 
 #define IFCVF_USED_RING_LEN(size) \
 	((size) * sizeof(struct vring_used_elem) + sizeof(uint16_t) * 3)
diff --git a/drivers/vdpa/nfp/nfp_vdpa_log.h b/drivers/vdpa/nfp/nfp_vdpa_log.h
index cf342329b1..e2b163ca7e 100644
--- a/drivers/vdpa/nfp/nfp_vdpa_log.h
+++ b/drivers/vdpa/nfp/nfp_vdpa_log.h
@@ -9,13 +9,15 @@
 #include <rte_log.h>
 
 extern int nfp_logtype_vdpa;
+#define RTE_LOGTYPE_NFP_VDPA nfp_logtype_vdpa
 #define DRV_VDPA_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, nfp_logtype_vdpa, \
-		"NFP_VDPA: %s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, NFP_VDPA, \
+		"%s(): " fmt, __func__, ## args)
 
 extern int nfp_logtype_core;
+#define RTE_LOGTYPE_NFP_CORE nfp_logtype_core
 #define DRV_CORE_LOG(level, fmt, args...) \
-	rte_log(RTE_LOG_ ## level, nfp_logtype_core, \
-		"NFP_CORE: %s(): " fmt "\n", __func__, ## args)
+	RTE_LOG_LINE(level, NFP_CORE, \
+		"%s(): " fmt, __func__, ## args)
 
 #endif /* __NFP_VDPA_LOG_H__ */
-- 
2.46.0


  parent reply	other threads:[~2024-09-07 14:56 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-07 14:54 [PATCH 00/11] Use RTE_LOG_LINE in drivers David Marchand
2024-09-07 14:54 ` [PATCH 01/11] devtools: fix forbidden token check with multiple files David Marchand
2024-09-07 14:54 ` [PATCH 02/11] devtools: report all warnings in forbidden token check David Marchand
2024-09-07 14:54 ` [PATCH 03/11] net/dpaa: remove broken debug macros David Marchand
2024-09-07 14:54 ` [PATCH 04/11] net/sfc: fix driver logtype token David Marchand
2024-09-08  8:35   ` Andrew Rybchenko
2024-09-07 14:54 ` [PATCH 05/11] drivers: reuse default logtype for SFC drivers David Marchand
2024-09-08  8:44   ` Andrew Rybchenko
2024-09-07 14:54 ` [PATCH 06/11] drivers: move log wrappers to Intel base drivers David Marchand
2024-09-07 14:54 ` [PATCH 07/11] net/txgbe: move wrapper to base driver David Marchand
2024-09-09  6:18   ` Jiawen Wu
2024-09-09  6:50     ` David Marchand
2024-09-09  7:23       ` Jiawen Wu
2024-09-07 14:54 ` [PATCH 08/11] drivers: replace logging helpers David Marchand
2024-09-07 14:54 ` [PATCH 09/11] drivers: remove redundant newline from logs David Marchand
2024-09-09  1:09   ` fengchengwen
2024-09-07 14:54 ` [PATCH 10/11] drivers: split multilines log messages David Marchand
2024-09-07 14:54 ` David Marchand [this message]
2024-09-08  8:55   ` [PATCH 11/11] drivers: use per line logging in helpers Andrew Rybchenko
2024-09-09  6:55     ` David Marchand
2024-09-09  7:23       ` Andrew Rybchenko
2024-09-09  1:19   ` fengchengwen
2024-09-10 10:56   ` David Marchand
2024-09-12  8:26 ` [PATCH v2 00/14] Use RTE_LOG_LINE in drivers David Marchand
2024-09-12  8:26   ` [PATCH v2 01/14] devtools: fix forbidden token check with multiple files David Marchand
2024-09-12 13:54     ` Thomas Monjalon
2024-09-12  8:26   ` [PATCH v2 02/14] devtools: report all warnings in forbidden token check David Marchand
2024-09-12 14:10     ` Thomas Monjalon
2024-09-12  8:26   ` [PATCH v2 03/14] net/dpaa: remove broken debug macros David Marchand
2024-10-01 10:18     ` Thomas Monjalon
2024-10-01 12:08       ` David Marchand
2024-10-01 13:00         ` Hemant Agrawal
2024-09-12  8:26   ` [PATCH v2 04/14] net/sfc: fix driver logtype token David Marchand
2024-09-12  8:26   ` [PATCH v2 05/14] drivers: reuse default logtype for SFC drivers David Marchand
2024-09-12  8:26   ` [PATCH v2 06/14] drivers: move log wrappers to Intel base drivers David Marchand
2024-09-12  8:26   ` [PATCH v2 07/14] net/txgbe: move wrapper to base driver David Marchand
2024-09-12  8:26   ` [PATCH v2 08/14] event/dlb2: fix base driver logs David Marchand
2024-09-12  8:26   ` [PATCH v2 09/14] event/dsw: use a dynamic logtype David Marchand
2024-09-12  8:26   ` [PATCH v2 10/14] drivers: replace logging helpers David Marchand
2024-09-12  8:26   ` [PATCH v2 11/14] drivers: remove redundant newline from logs David Marchand
2024-09-12  8:26   ` [PATCH v2 12/14] drivers: split multilines log messages David Marchand
2024-09-12  8:26   ` [PATCH v2 13/14] net/octeon_ep: avoid warning on uninitialized variable David Marchand
2024-09-12  8:26   ` [PATCH v2 14/14] drivers: use per line logging in helpers David Marchand
2024-10-01 12:10     ` Thomas Monjalon
2024-09-16  9:32   ` [PATCH v2 00/14] Use RTE_LOG_LINE in drivers David Marchand
2024-09-16 15:13   ` Patrick Robb
2024-10-04 13:04   ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240907145433.1479091-12-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=amitbern@amazon.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=anoobj@marvell.com \
    --cc=apeksha.gupta@nxp.com \
    --cc=ashish.gupta@marvell.com \
    --cc=atrwajee@amazon.com \
    --cc=bruce.richardson@intel.com \
    --cc=chaoyong.he@corigine.com \
    --cc=chenbox@nvidia.com \
    --cc=ciara.loftus@intel.com \
    --cc=cloud.wangxiaoyun@huawei.com \
    --cc=conor.walsh@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=eagostini@nvidia.com \
    --cc=evgenys@amazon.com \
    --cc=fanzhang.oss@gmail.com \
    --cc=fengchengwen@huawei.com \
    --cc=g.singh@nxp.com \
    --cc=gmuthukrishn@marvell.com \
    --cc=grive@u256.net \
    --cc=haijie1@huawei.com \
    --cc=harry.van.haaren@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=hkalra@marvell.com \
    --cc=hyonkim@cisco.com \
    --cc=irusskikh@marvell.com \
    --cc=jack.bond-preston@foss.arm.com \
    --cc=jerinj@marvell.com \
    --cc=jeroendb@google.com \
    --cc=jgrajcia@cisco.com \
    --cc=jianjay.zhou@huawei.com \
    --cc=jianwang@trustnetic.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=jingjing.wu@intel.com \
    --cc=jochen.behrens@broadcom.com \
    --cc=johndale@cisco.com \
    --cc=joshwash@google.com \
    --cc=jpalider@marvell.com \
    --cc=jsrikanth@marvell.com \
    --cc=julien_dpdk@jaube.fr \
    --cc=kai.ji@intel.com \
    --cc=kevin.laatz@intel.com \
    --cc=kirankumark@marvell.com \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=lee.daly@intel.com \
    --cc=liangma@liangbit.com \
    --cc=linville@tuxdriver.com \
    --cc=lironh@marvell.com \
    --cc=longli@microsoft.com \
    --cc=matan@nvidia.com \
    --cc=matt.peters@windriver.com \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mczekaj@marvell.com \
    --cc=michaelsh@marvell.com \
    --cc=mtahhan@redhat.com \
    --cc=mtetsuyah@gmail.com \
    --cc=ndabilpuram@marvell.com \
    --cc=nicolas.chautru@intel.com \
    --cc=nikhil.agarwal@amd.com \
    --cc=nipun.gupta@amd.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=parav@nvidia.com \
    --cc=pbhagavatula@marvell.com \
    --cc=peter.mccarthy@intel.com \
    --cc=raveendra.padasalagi@broadcom.com \
    --cc=rbeider@amazon.com \
    --cc=rnagadheeraj@marvell.com \
    --cc=rosen.xu@intel.com \
    --cc=rushilg@google.com \
    --cc=sachin.saxena@nxp.com \
    --cc=selwin.sebastian@amd.com \
    --cc=shaibran@amazon.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=spinler@cesnet.cz \
    --cc=ssahu@marvell.com \
    --cc=stephen@networkplumber.org \
    --cc=steven.webster@windriver.com \
    --cc=tduszynski@marvell.com \
    --cc=thomas@monjalon.net \
    --cc=vattunuru@marvell.com \
    --cc=viacheslavo@nvidia.com \
    --cc=vikas.gupta@broadcom.com \
    --cc=vvelumuri@marvell.com \
    --cc=wathsala.vithanage@arm.com \
    --cc=weh@microsoft.com \
    --cc=xuanziyang2@huawei.com \
    --cc=xuemingl@nvidia.com \
    --cc=yisen.zhuang@huawei.com \
    --cc=zhangfei.gao@linaro.org \
    --cc=zr@semihalf.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).