get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/129738/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 129738,
    "url": "https://patches.dpdk.org/api/patches/129738/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230731101703.1178204-3-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20230731101703.1178204-3-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230731101703.1178204-3-bruce.richardson@intel.com",
    "date": "2023-07-31T10:17:02",
    "name": "[v6,2/3] log: separate logging functions out of EAL",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "640f3584683321064f2fc92299657362e6931846",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230731101703.1178204-3-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 29040,
            "url": "https://patches.dpdk.org/api/series/29040/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=29040",
            "date": "2023-07-31T10:17:00",
            "name": "[v6,1/3] eal/windows: move fnmatch function to header file",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/29040/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/129738/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/129738/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2291742FA3;\n\tMon, 31 Jul 2023 12:17:30 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5CF2643251;\n\tMon, 31 Jul 2023 12:17:24 +0200 (CEST)",
            "from mgamail.intel.com (unknown [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id 6A04E40A89\n for <dev@dpdk.org>; Mon, 31 Jul 2023 12:17:21 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 31 Jul 2023 03:17:19 -0700",
            "from silpixa00401385.ir.intel.com ([10.237.214.14])\n by fmsmga004.fm.intel.com with ESMTP; 31 Jul 2023 03:17:18 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1690798641; x=1722334641;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=LQ2R5X4j/E6ZfPBp3sOUjzPazdlk4a6mq22nEj+hMKk=;\n b=flq/OGTZ+v0yjJa5/atMWYVAh8zQetbIyVCiKJNVapC9ATi51h1aG1g9\n bB8mb7M0RjQ7WGNgBjksqFrOcwLsG2wwBmlZOao7yJHdhP8N6SNpiIF8Z\n VzoDZR03StV3dHMXVDaVAsU9ZKaz+wGOKwYEbORmlJpZMD9nXPDQuPmbj\n YRj64T1n/oHvzkTfWkfRT+xX1eNsMlybF0rWXeQe2MrA3iUyVFKaZTZYx\n CWH3+QUhNRlOhkHpa2Sc9BKhItJ0tpwDX6oJqvNHFSMZlPFwLX9GeZP2i\n dMRJr1cBLf7n1DsfCFWeRWZNUZIHddlxfXGfYWBpvnM/4JhrQ/EdeyP/x w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10787\"; a=\"455351312\"",
            "E=Sophos;i=\"6.01,244,1684825200\"; d=\"scan'208\";a=\"455351312\"",
            "E=McAfee;i=\"6600,9927,10787\"; a=\"798203037\"",
            "E=Sophos;i=\"6.01,244,1684825200\"; d=\"scan'208\";a=\"798203037\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Bruce Richardson <bruce.richardson@intel.com>, =?utf-8?q?Morten_Br=C3=B8?=\n\t=?utf-8?q?rup?= <mb@smartsharesystems.com>,\n Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "Subject": "[PATCH v6 2/3] log: separate logging functions out of EAL",
        "Date": "Mon, 31 Jul 2023 11:17:02 +0100",
        "Message-Id": "<20230731101703.1178204-3-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20230731101703.1178204-1-bruce.richardson@intel.com>",
        "References": "<20220829151901.376754-1-bruce.richardson@intel.com>\n <20230731101703.1178204-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Move the logging capability to a separate library, free from EAL. Rename\nfiles as appropriate, and use meson.build to select the correct file to\nbe built for each operating system, rather than having a subdir per-os.\nAdd new documentation section in programmers guide to cover logging in\nmore detail.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\nAcked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n doc/api/doxy-api.conf.in                      |   1 +\n .../prog_guide/env_abstraction_layer.rst      |   4 +-\n doc/guides/prog_guide/index.rst               |   1 +\n doc/guides/prog_guide/log_lib.rst             | 115 ++++++++++++++++++\n lib/eal/common/eal_common_options.c           |   2 +-\n lib/eal/common/eal_private.h                  |   7 --\n lib/eal/common/meson.build                    |   1 -\n lib/eal/include/meson.build                   |   1 -\n lib/eal/linux/eal.c                           |   2 +-\n lib/eal/linux/meson.build                     |   1 -\n lib/eal/meson.build                           |   2 +-\n lib/eal/version.map                           |  17 ---\n lib/eal/windows/eal.c                         |   2 +-\n lib/eal/windows/meson.build                   |   1 -\n lib/kvargs/meson.build                        |   3 +-\n .../common/eal_common_log.c => log/log.c}     |   7 +-\n lib/log/log_freebsd.c                         |  12 ++\n .../common/eal_log.h => log/log_internal.h}   |  18 ++-\n lib/{eal/linux/eal_log.c => log/log_linux.c}  |   2 +-\n .../windows/eal_log.c => log/log_windows.c}   |   2 +-\n lib/log/meson.build                           |   9 ++\n lib/{eal/include => log}/rte_log.h            |   0\n lib/log/version.map                           |  34 ++++++\n lib/meson.build                               |   1 +\n lib/telemetry/meson.build                     |   3 +-\n 25 files changed, 202 insertions(+), 46 deletions(-)\n create mode 100644 doc/guides/prog_guide/log_lib.rst\n rename lib/{eal/common/eal_common_log.c => log/log.c} (99%)\n create mode 100644 lib/log/log_freebsd.c\n rename lib/{eal/common/eal_log.h => log/log_internal.h} (69%)\n rename lib/{eal/linux/eal_log.c => log/log_linux.c} (97%)\n rename lib/{eal/windows/eal_log.c => log/log_windows.c} (93%)\n create mode 100644 lib/log/meson.build\n rename lib/{eal/include => log}/rte_log.h (100%)\n create mode 100644 lib/log/version.map",
    "diff": "diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in\nindex 1a4210b948..40f7dd2877 100644\n--- a/doc/api/doxy-api.conf.in\n+++ b/doc/api/doxy-api.conf.in\n@@ -52,6 +52,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \\\n                           @TOPDIR@/lib/kni \\\n                           @TOPDIR@/lib/kvargs \\\n                           @TOPDIR@/lib/latencystats \\\n+                          @TOPDIR@/lib/log \\\n                           @TOPDIR@/lib/lpm \\\n                           @TOPDIR@/lib/mbuf \\\n                           @TOPDIR@/lib/member \\\ndiff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst\nindex 93c8a031be..8033f6cebd 100644\n--- a/doc/guides/prog_guide/env_abstraction_layer.rst\n+++ b/doc/guides/prog_guide/env_abstraction_layer.rst\n@@ -443,9 +443,7 @@ Per-lcore variables are implemented using *Thread Local Storage* (TLS) to provid\n Logs\n ~~~~\n \n-A logging API is provided by EAL.\n-By default, in a Linux application, logs are sent to syslog and also to the console.\n-However, the log function can be overridden by the user to use a different logging mechanism.\n+While originally part of EAL, DPDK logging functionality is now provided by the :ref:`Log_Library`.\n \n Trace and Debug Functions\n ^^^^^^^^^^^^^^^^^^^^^^^^^\ndiff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst\nindex d89cd3edb6..ac91060992 100644\n--- a/doc/guides/prog_guide/index.rst\n+++ b/doc/guides/prog_guide/index.rst\n@@ -12,6 +12,7 @@ Programmer's Guide\n     overview\n     source_org\n     env_abstraction_layer\n+    log_lib\n     service_cores\n     trace_lib\n     rcu_lib\ndiff --git a/doc/guides/prog_guide/log_lib.rst b/doc/guides/prog_guide/log_lib.rst\nnew file mode 100644\nindex 0000000000..706ddcfef3\n--- /dev/null\n+++ b/doc/guides/prog_guide/log_lib.rst\n@@ -0,0 +1,115 @@\n+..  SPDX-License-Identifier: BSD-3-Clause\n+    Copyright(c) 2023 Intel Corporation.\n+\n+.. _log_library:\n+\n+Log Library\n+============\n+\n+The DPDK Log library provides the logging functionality for other DPDK libraries and drivers.\n+By default, in a Linux application, logs are sent to syslog and also to the console.\n+On FreeBSD and Windows applications, logs are sent only to the console.\n+However, the log function can be overridden by the user to use a different logging mechanism.\n+\n+Log Levels\n+-----------\n+\n+Log messages from apps and libraries are reported with a given level of severity.\n+These levels, specified in ``rte_log.h`` are (from most to least important):\n+\n+#. Emergency\n+#. Alert\n+#. Critical\n+#. Error\n+#. Warning\n+#. Notice\n+#. Information\n+#. Debug\n+\n+At runtime, only messages of a configured level or above (i.e. of higher importance)\n+will be emitted by the application to the log output.\n+That level can be configured either by the application calling the relevant APIs from the logging library,\n+or by the user passing the ``--log-level`` parameter to the EAL via the application.\n+\n+Setting Global Log Level\n+~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+To adjust the global log level for an application,\n+just pass a numeric level or a level name to the ``--log-level`` EAL parameter.\n+For example::\n+\n+\t/path/to/app --log-level=error\n+\n+\t/path/to/app --log-level=debug\n+\n+\t/path/to/app --log-level=5   # warning\n+\n+Within an application, the log level can be similarly set using the ``rte_log_set_global_level`` API.\n+\n+Setting Log Level for a Component\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+In some cases, for example, for debugging purposes,\n+it may be desirable to increase or decrease the log level for only a specific component, or set of components.\n+To facilitate this, the ``--log-level`` argument also accepts an, optionally wildcarded, component name,\n+along with the desired level for that component.\n+For example::\n+\n+\t/path/to/app --log-level=lib.eal:crit\n+\n+\t/path/to/app --log-level=lib.*:warning\n+\n+Within an application, the same result can be got using the ``rte_log_set_level_pattern()`` or ``rte_log_set_level_regex()`` APIs.\n+\n+Using Logging APIs to Generate Log Messages\n+--------------------------------------------\n+\n+To output log messages, ``rte_log()`` API function should be used.\n+As well as the log message, ``rte_log()`` takes two additional parameters:\n+\n+* The log level\n+* The log component type\n+\n+The log level is a numeric value as discussed above.\n+The component type is a unique id that identifies the particular DPDK component to the logging system.\n+To get this id, each component needs to register itself at startup,\n+using the macro ``RTE_LOG_REGISTER_DEFAULT``.\n+This macro takes two parameters, with the second being the default log level for the component.\n+The first parameter, called \"type\", the name of the \"logtype\", or \"component type\" variable used in the component.\n+This variable will be defined by the macro, and should be passed as the second parameter in calls to ``rte_log()``.\n+In general, most DPDK components define their own logging macros to simplify the calls to the log APIs.\n+They do this by:\n+\n+* Hiding the component type parameter inside the macro so it never needs to be passed explicitly.\n+* Using the log-level definitions given in ``rte_log.h`` to allow short textual names to be used in\n+  place of the numeric log levels.\n+\n+The following code is taken from ``rte_dmadev.c`` and shows the log registration,\n+and subsequent definition of a shortcut logging macro.\n+It can be used as a template for any new components using DPDK logging.\n+\n+.. code:: C\n+\n+\tRTE_LOG_REGISTER_DEFAULT(rte_dma_logtype, INFO);\n+\t#define RTE_DMA_LOG(level, ...) \\\n+\t\trte_log(RTE_LOG_ ## level, rte_dma_logtype, RTE_FMT(\"dma: \" \\\n+\t\t\tRTE_FMT_HEAD(__VA_ARGS__,) \"\\n\", RTE_FMT_TAIL(__VA_ARGS__,)))\n+\n+.. note::\n+\n+\tBecause the log registration macro provides the logtype variable definition,\n+\tit should be placed near the top of the C file using it.\n+\tIf not, the logtype variable should be defined as an \"extern int\" near the top of the file.\n+\n+\tSimilarly, if logging is to be done by multiple files in a component,\n+\tonly one file should register the logtype via the macro,\n+\tand the logtype should be defined as an \"extern int\" in a common header file.\n+\tAny component-specific logging macro should similarly be defined in that header.\n+\n+Throughout the dmadev library, all logging calls are therefore of the form:\n+\n+.. code:: C\n+\n+\tRTE_DMA_LOG(ERR, \"Name can't be NULL\");\n+\n+\tRTE_DMA_LOG(WARNING, \"Device %d already started\", dev_id);\ndiff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c\nindex 062f1d8d9c..d74b581567 100644\n--- a/lib/eal/common/eal_common_options.c\n+++ b/lib/eal/common/eal_common_options.c\n@@ -39,7 +39,7 @@\n #include \"eal_options.h\"\n #include \"eal_filesystem.h\"\n #include \"eal_private.h\"\n-#include \"eal_log.h\"\n+#include \"log_internal.h\"\n #ifndef RTE_EXEC_ENV_WINDOWS\n #include \"eal_trace.h\"\n #endif\ndiff --git a/lib/eal/common/eal_private.h b/lib/eal/common/eal_private.h\nindex d7f83776c1..5eadba4902 100644\n--- a/lib/eal/common/eal_private.h\n+++ b/lib/eal/common/eal_private.h\n@@ -152,13 +152,6 @@ int rte_eal_tailqs_init(void);\n  */\n int rte_eal_intr_init(void);\n \n-/**\n- * Close the default log stream\n- *\n- * This function is private to EAL.\n- */\n-void rte_eal_log_cleanup(void);\n-\n /**\n  * Init alarm mechanism. This is to allow a callback be called after\n  * specific time.\ndiff --git a/lib/eal/common/meson.build b/lib/eal/common/meson.build\nindex 917758cc65..22a626ba6f 100644\n--- a/lib/eal/common/meson.build\n+++ b/lib/eal/common/meson.build\n@@ -18,7 +18,6 @@ sources += files(\n         'eal_common_interrupts.c',\n         'eal_common_launch.c',\n         'eal_common_lcore.c',\n-        'eal_common_log.c',\n         'eal_common_mcfg.c',\n         'eal_common_memalloc.c',\n         'eal_common_memory.c',\ndiff --git a/lib/eal/include/meson.build b/lib/eal/include/meson.build\nindex b0db9b3b3a..a0463efac7 100644\n--- a/lib/eal/include/meson.build\n+++ b/lib/eal/include/meson.build\n@@ -28,7 +28,6 @@ headers += files(\n         'rte_launch.h',\n         'rte_lcore.h',\n         'rte_lock_annotations.h',\n-        'rte_log.h',\n         'rte_malloc.h',\n         'rte_mcslock.h',\n         'rte_memory.h',\ndiff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c\nindex c6efd92014..2f9203c87d 100644\n--- a/lib/eal/linux/eal.c\n+++ b/lib/eal/linux/eal.c\n@@ -50,10 +50,10 @@\n #include \"eal_hugepages.h\"\n #include \"eal_memcfg.h\"\n #include \"eal_trace.h\"\n-#include \"eal_log.h\"\n #include \"eal_options.h\"\n #include \"eal_vfio.h\"\n #include \"hotplug_mp.h\"\n+#include \"log_internal.h\"\n \n #define MEMSIZE_IF_NO_HUGE_PAGE (64ULL * 1024ULL * 1024ULL)\n \ndiff --git a/lib/eal/linux/meson.build b/lib/eal/linux/meson.build\nindex 5af456db9e..e99ebed256 100644\n--- a/lib/eal/linux/meson.build\n+++ b/lib/eal/linux/meson.build\n@@ -11,7 +11,6 @@ sources += files(\n         'eal_hugepage_info.c',\n         'eal_interrupts.c',\n         'eal_lcore.c',\n-        'eal_log.c',\n         'eal_memalloc.c',\n         'eal_memory.c',\n         'eal_thread.c',\ndiff --git a/lib/eal/meson.build b/lib/eal/meson.build\nindex 9aa941a5ae..0fb974c78b 100644\n--- a/lib/eal/meson.build\n+++ b/lib/eal/meson.build\n@@ -22,7 +22,7 @@ subdir(exec_env)\n \n subdir(arch_subdir)\n \n-deps += ['kvargs']\n+deps += ['log', 'kvargs']\n if not is_windows\n     deps += ['telemetry']\n endif\ndiff --git a/lib/eal/version.map b/lib/eal/version.map\nindex bdb98cf479..7940431e5a 100644\n--- a/lib/eal/version.map\n+++ b/lib/eal/version.map\n@@ -140,21 +140,6 @@ DPDK_24 {\n \trte_lcore_iterate;\n \trte_lcore_to_cpu_id;\n \trte_lcore_to_socket_id;\n-\trte_log;\n-\trte_log_can_log;\n-\trte_log_cur_msg_loglevel;\n-\trte_log_cur_msg_logtype;\n-\trte_log_dump;\n-\trte_log_get_global_level;\n-\trte_log_get_level;\n-\trte_log_get_stream;\n-\trte_log_list_types;\n-\trte_log_register;\n-\trte_log_register_type_and_pick_level;\n-\trte_log_set_global_level;\n-\trte_log_set_level;\n-\trte_log_set_level_pattern;\n-\trte_log_set_level_regexp;\n \trte_malloc;\n \trte_malloc_dump_heaps;\n \trte_malloc_dump_stats;\n@@ -225,7 +210,6 @@ DPDK_24 {\n \trte_mp_request_async;\n \trte_mp_request_sync;\n \trte_mp_sendmsg;\n-\trte_openlog_stream;\n \trte_rand;\n \trte_rand_max;\n \trte_realloc;\n@@ -299,7 +283,6 @@ DPDK_24 {\n \trte_vfio_noiommu_is_enabled; # WINDOWS_NO_EXPORT\n \trte_vfio_release_device; # WINDOWS_NO_EXPORT\n \trte_vfio_setup_device; # WINDOWS_NO_EXPORT\n-\trte_vlog;\n \trte_zmalloc;\n \trte_zmalloc_socket;\n \ndiff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c\nindex 096cb98d1c..22dc7f6ee1 100644\n--- a/lib/eal/windows/eal.c\n+++ b/lib/eal/windows/eal.c\n@@ -27,8 +27,8 @@\n #include \"eal_firmware.h\"\n #include \"eal_hugepages.h\"\n #include \"eal_trace.h\"\n-#include \"eal_log.h\"\n #include \"eal_windows.h\"\n+#include \"log_internal.h\"\n \n #define MEMSIZE_IF_NO_HUGE_PAGE (64ULL * 1024ULL * 1024ULL)\n \ndiff --git a/lib/eal/windows/meson.build b/lib/eal/windows/meson.build\nindex e4b2427610..7756d417be 100644\n--- a/lib/eal/windows/meson.build\n+++ b/lib/eal/windows/meson.build\n@@ -12,7 +12,6 @@ sources += files(\n         'eal_hugepages.c',\n         'eal_interrupts.c',\n         'eal_lcore.c',\n-        'eal_log.c',\n         'eal_memalloc.c',\n         'eal_memory.c',\n         'eal_mp.c',\ndiff --git a/lib/kvargs/meson.build b/lib/kvargs/meson.build\nindex b746516965..7eae744a8f 100644\n--- a/lib/kvargs/meson.build\n+++ b/lib/kvargs/meson.build\n@@ -1,7 +1,6 @@\n # SPDX-License-Identifier: BSD-3-Clause\n # Copyright(c) 2017 Intel Corporation\n \n-includes = [global_inc]\n-\n+deps += 'log'\n sources = files('rte_kvargs.c')\n headers = files('rte_kvargs.h')\ndiff --git a/lib/eal/common/eal_common_log.c b/lib/log/log.c\nsimilarity index 99%\nrename from lib/eal/common/eal_common_log.c\nrename to lib/log/log.c\nindex bd7b188ceb..c3ede383b2 100644\n--- a/lib/eal/common/eal_common_log.c\n+++ b/lib/log/log.c\n@@ -15,8 +15,11 @@\n #include <rte_log.h>\n #include <rte_per_lcore.h>\n \n-#include \"eal_log.h\"\n-#include \"eal_private.h\"\n+#include \"log_internal.h\"\n+\n+#ifdef RTE_EXEC_ENV_WINDOWS\n+#define strdup _strdup\n+#endif\n \n struct rte_log_dynamic_type {\n \tconst char *name;\ndiff --git a/lib/log/log_freebsd.c b/lib/log/log_freebsd.c\nnew file mode 100644\nindex 0000000000..698d3c5423\n--- /dev/null\n+++ b/lib/log/log_freebsd.c\n@@ -0,0 +1,12 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2023 Intel Corporation\n+ */\n+\n+#include <rte_common.h>\n+#include \"log_internal.h\"\n+\n+int\n+eal_log_init(__rte_unused const char *id, __rte_unused int facility)\n+{\n+\treturn 0;\n+}\ndiff --git a/lib/eal/common/eal_log.h b/lib/log/log_internal.h\nsimilarity index 69%\nrename from lib/eal/common/eal_log.h\nrename to lib/log/log_internal.h\nindex c784fa6043..20d6313898 100644\n--- a/lib/eal/common/eal_log.h\n+++ b/lib/log/log_internal.h\n@@ -2,31 +2,43 @@\n  * Copyright 2021 Mellanox Technologies, Ltd\n  */\n \n-#ifndef EAL_LOG_H\n-#define EAL_LOG_H\n+#ifndef LOG_INTERNAL_H\n+#define LOG_INTERNAL_H\n \n #include <stdio.h>\n #include <stdint.h>\n+#include <rte_compat.h>\n \n /*\n  * Initialize the default log stream.\n  */\n+__rte_internal\n int eal_log_init(const char *id, int facility);\n \n /*\n  * Determine where log data is written when no call to rte_openlog_stream.\n  */\n+__rte_internal\n void eal_log_set_default(FILE *default_log);\n \n /*\n  * Save a log option for later.\n  */\n+__rte_internal\n int eal_log_save_regexp(const char *regexp, uint32_t level);\n+__rte_internal\n int eal_log_save_pattern(const char *pattern, uint32_t level);\n \n /*\n  * Convert log level to string.\n  */\n+__rte_internal\n const char *eal_log_level2str(uint32_t level);\n \n-#endif /* EAL_LOG_H */\n+/*\n+ * Close the default log stream\n+ */\n+__rte_internal\n+void rte_eal_log_cleanup(void);\n+\n+#endif /* LOG_INTERNAL_H */\ndiff --git a/lib/eal/linux/eal_log.c b/lib/log/log_linux.c\nsimilarity index 97%\nrename from lib/eal/linux/eal_log.c\nrename to lib/log/log_linux.c\nindex d44416fd65..2dfb0c974b 100644\n--- a/lib/eal/linux/eal_log.c\n+++ b/lib/log/log_linux.c\n@@ -8,7 +8,7 @@\n \n #include <rte_log.h>\n \n-#include \"eal_log.h\"\n+#include \"log_internal.h\"\n \n /*\n  * default log function\ndiff --git a/lib/eal/windows/eal_log.c b/lib/log/log_windows.c\nsimilarity index 93%\nrename from lib/eal/windows/eal_log.c\nrename to lib/log/log_windows.c\nindex d4ea47f1c8..a6a0889550 100644\n--- a/lib/eal/windows/eal_log.c\n+++ b/lib/log/log_windows.c\n@@ -4,7 +4,7 @@\n \n #include <rte_common.h>\n #include <rte_log.h>\n-#include \"eal_log.h\"\n+#include \"log_internal.h\"\n \n /* set the log to default function, called during eal init process. */\n int\ndiff --git a/lib/log/meson.build b/lib/log/meson.build\nnew file mode 100644\nindex 0000000000..6baff83ee5\n--- /dev/null\n+++ b/lib/log/meson.build\n@@ -0,0 +1,9 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2022 Intel Corporation\n+\n+includes += global_inc\n+sources = files(\n+        'log.c',\n+        'log_' + exec_env + '.c'\n+)\n+headers = files('rte_log.h')\ndiff --git a/lib/eal/include/rte_log.h b/lib/log/rte_log.h\nsimilarity index 100%\nrename from lib/eal/include/rte_log.h\nrename to lib/log/rte_log.h\ndiff --git a/lib/log/version.map b/lib/log/version.map\nnew file mode 100644\nindex 0000000000..0648f8831a\n--- /dev/null\n+++ b/lib/log/version.map\n@@ -0,0 +1,34 @@\n+DPDK_24 {\n+\tglobal:\n+\n+\trte_log;\n+\trte_log_cur_msg_loglevel;\n+\trte_log_cur_msg_logtype;\n+\trte_log_can_log;\n+\trte_log_dump;\n+\trte_log_get_global_level;\n+\trte_log_get_level;\n+\trte_log_get_stream;\n+\trte_log_list_types;\n+\trte_log_register;\n+\trte_log_register_type_and_pick_level;\n+\trte_log_set_global_level;\n+\trte_log_set_level;\n+\trte_log_set_level_pattern;\n+\trte_log_set_level_regexp;\n+\trte_openlog_stream;\n+\trte_vlog;\n+\n+\tlocal: *;\n+};\n+\n+INTERNAL {\n+\tglobal:\n+\n+\teal_log_init;\n+\teal_log_level2str;\n+\teal_log_save_pattern;\n+\teal_log_save_regexp;\n+\teal_log_set_default;\n+\trte_eal_log_cleanup;\n+};\ndiff --git a/lib/meson.build b/lib/meson.build\nindex fac2f52cad..c5e4642337 100644\n--- a/lib/meson.build\n+++ b/lib/meson.build\n@@ -9,6 +9,7 @@\n # given as a dep, no need to mention ring. This is especially true for the\n # core libs which are widely reused, so their deps are kept to a minimum.\n libraries = [\n+        'log',\n         'kvargs', # eal depends on kvargs\n         'telemetry', # basic info querying\n         'eal', # everything depends on eal\ndiff --git a/lib/telemetry/meson.build b/lib/telemetry/meson.build\nindex f84c9aa3be..489d000047 100644\n--- a/lib/telemetry/meson.build\n+++ b/lib/telemetry/meson.build\n@@ -1,8 +1,7 @@\n # SPDX-License-Identifier: BSD-3-Clause\n # Copyright(c) 2018 Intel Corporation\n \n-includes = [global_inc]\n-\n+deps += 'log'\n sources = files('telemetry.c', 'telemetry_data.c', 'telemetry_legacy.c')\n headers = files('rte_telemetry.h')\n includes += include_directories('../metrics')\n",
    "prefixes": [
        "v6",
        "2/3"
    ]
}