Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant attributes from LogV implementation #33984

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/platform/ESP32/Logging.cpp
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
#include <platform/logging/LogV.h>

#include <lib/core/CHIPConfig.h>
#include <lib/support/EnforceFormat.h>
#include <lib/support/logging/Constants.h>

#include <stdio.h>
@@ -19,7 +18,7 @@ namespace chip {
namespace Logging {
namespace Platform {

void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
char tag[11];

6 changes: 3 additions & 3 deletions src/platform/Linux/Logging.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* See Project CHIP LICENSE file for licensing information. */

#include <platform/logging/LogV.h>

#include <lib/core/CHIPConfig.h>
#include <lib/support/EnforceFormat.h>
#include <lib/support/logging/Constants.h>
#include <platform/logging/LogV.h>

#include <cinttypes>
#include <cstdio>
@@ -35,7 +35,7 @@ namespace Platform {
/**
* CHIP log output functions.
*/
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
struct timeval tv;

6 changes: 3 additions & 3 deletions src/platform/NuttX/Logging.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* See Project CHIP LICENSE file for licensing information. */

#include <platform/logging/LogV.h>

#include <lib/core/CHIPConfig.h>
#include <lib/support/EnforceFormat.h>
#include <lib/support/logging/Constants.h>
#include <platform/logging/LogV.h>

#include <cinttypes>
#include <cstdio>
@@ -35,7 +35,7 @@ namespace Platform {
/**
* CHIP log output functions.
*/
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
struct timeval tv;

6 changes: 3 additions & 3 deletions src/platform/Tizen/Logging.cpp
Original file line number Diff line number Diff line change
@@ -15,15 +15,15 @@
* limitations under the License.
*/

#include <platform/logging/LogV.h>

#include <cstdint>
#include <cstdio>

#include <dlog.h>

#include <lib/core/CHIPConfig.h>
#include <lib/support/EnforceFormat.h>
#include <lib/support/logging/Constants.h>
#include <platform/logging/LogV.h>

namespace chip {
namespace Logging {
@@ -32,7 +32,7 @@ namespace Platform {
/**
* CHIP log output functions.
*/
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
static constexpr char kLogTag[] = "CHIP";

3 changes: 1 addition & 2 deletions src/platform/Zephyr/Logging.cpp
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
#include <platform/logging/LogV.h>

#include <lib/core/CHIPConfig.h>
#include <lib/support/EnforceFormat.h>
#include <lib/support/logging/Constants.h>

#include <zephyr/kernel.h>
@@ -42,7 +41,7 @@ namespace Platform {
* CHIP log output function.
*/

void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
char formattedMsg[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE];
snprintfcb(formattedMsg, sizeof(formattedMsg), "[%s]", module);
6 changes: 3 additions & 3 deletions src/platform/logging/impl/android/Logging.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/* See Project chip LICENSE file for licensing information. */

#include <lib/support/EnforceFormat.h>
#include <lib/support/logging/Constants.h>
#include <platform/logging/LogV.h>

#include <lib/support/logging/Constants.h>

#include <android/log.h>

namespace chip {
namespace Logging {
namespace Platform {

void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
int priority = (category == kLogCategory_Error) ? ANDROID_LOG_ERROR : ANDROID_LOG_DEBUG;
__android_log_vprint(priority, module, msg, v);
6 changes: 3 additions & 3 deletions src/platform/logging/impl/stdio/Logging.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/* See Project CHIP LICENSE file for licensing information. */

#include <lib/support/EnforceFormat.h>
#include <lib/support/logging/Constants.h>
#include <platform/logging/LogV.h>

#include <lib/support/logging/Constants.h>

#include <stdio.h>

namespace chip {
namespace Logging {
namespace Platform {

void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
printf("CHIP:%s: ", module);
vprintf(msg, v);
6 changes: 3 additions & 3 deletions src/platform/logging/impl/stdio/darwin/Logging.cpp
Original file line number Diff line number Diff line change
@@ -15,10 +15,10 @@
* limitations under the License.
*/

#include <platform/logging/LogV.h>

#include <lib/core/CHIPConfig.h>
#include <lib/support/EnforceFormat.h>
#include <lib/support/logging/Constants.h>
#include <platform/logging/LogV.h>
#include <pthread.h>
#include <stdio.h>
#include <sys/time.h>
@@ -28,7 +28,7 @@ namespace chip {
namespace Logging {
namespace Platform {

void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
timeval time;
gettimeofday(&time, nullptr);
10 changes: 5 additions & 5 deletions src/platform/mbed/Logging.cpp
Original file line number Diff line number Diff line change
@@ -21,15 +21,15 @@
* Logging implementation for Mbed platform
*/

#include <lib/core/CHIPConfig.h>
#include <lib/support/EnforceFormat.h>
#include <lib/support/logging/CHIPLogging.h>
#include <lib/support/logging/Constants.h>
#include <platform/logging/LogV.h>

#include <stdio.h>
#include <string.h>

#include <lib/core/CHIPConfig.h>
#include <lib/support/logging/CHIPLogging.h>
#include <lib/support/logging/Constants.h>

#include "mbed-trace/mbed_trace.h"

#ifdef MBED_TRACE_FILTER_LENGTH
@@ -66,7 +66,7 @@ char logMsgBuffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE];
/**
* CHIP log output functions.
*/
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
size_t prefixLen = 0;
snprintf(logMsgBuffer, sizeof(logMsgBuffer), "[%s]", module);
5 changes: 3 additions & 2 deletions src/platform/nxp/k32w/k32w0/Logging.cpp
Original file line number Diff line number Diff line change
@@ -2,15 +2,16 @@

#include <platform/logging/LogV.h>

#include <cstring>
#include <inttypes.h>

#include <lib/core/CHIPConfig.h>
#include <lib/support/EnforceFormat.h>
#include <lib/support/logging/Constants.h>
#include <platform/CHIPDeviceConfig.h>
#include <src/lib/support/CodeUtils.h>

#include "fsl_debug_console.h"
#include <cstring>

#define K32W_LOG_MODULE_NAME chip
#define EOL_CHARS "\r\n" /* End of Line Characters */
@@ -128,7 +129,7 @@ namespace Platform {
/**
* CHIP log output function.
*/
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
(void) module;
(void) category;
2 changes: 1 addition & 1 deletion src/platform/nxp/k32w/k32w1/Logging.cpp
Original file line number Diff line number Diff line change
@@ -146,7 +146,7 @@ namespace Platform {
/**
* CHIP log output function.
*/
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
(void) module;
(void) category;
6 changes: 3 additions & 3 deletions src/platform/openiotsdk/Logging.cpp
Original file line number Diff line number Diff line change
@@ -22,11 +22,11 @@
* for Open IOT SDK platform.
*/

#include <platform/logging/LogV.h>

#include <lib/core/CHIPConfig.h>
#include <lib/support/EnforceFormat.h>
#include <lib/support/logging/CHIPLogging.h>
#include <lib/support/logging/Constants.h>
#include <platform/logging/LogV.h>

#include <stdio.h>
#include <string.h>
@@ -50,7 +50,7 @@ namespace Platform {
/**
* CHIP log output functions.
*/
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
char logMsgBuffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE];

3 changes: 1 addition & 2 deletions src/platform/qpg/Logging.cpp
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@

#include <lib/core/CHIPConfig.h>
#include <lib/support/CHIPPlatformMemory.h>
#include <lib/support/EnforceFormat.h>
#include <lib/support/logging/Constants.h>
#include <platform/CHIPDeviceConfig.h>
#include <system/SystemClock.h>
@@ -67,7 +66,7 @@ static size_t AddTimeStampAndPrefixStr(char * logBuffer, const char * prefix, si
* CHIP log output function.
*/

void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
char formattedMsg[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE];
size_t formattedMsgLen;
6 changes: 3 additions & 3 deletions src/platform/webos/Logging.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* See Project CHIP LICENSE file for licensing information. */

#include <lib/support/EnforceFormat.h>
#include <lib/support/logging/Constants.h>
#include <platform/logging/LogV.h>

#include <cinttypes>
@@ -10,6 +8,8 @@
#include <sys/time.h>
#include <unistd.h>

#include <lib/support/logging/Constants.h>

#ifdef USE_SYSLOG
#include <syslog.h>
#endif
@@ -33,7 +33,7 @@ namespace Platform {
/**
* CHIP log output functions.
*/
void ENFORCE_FORMAT(3, 0) LogV(const char * module, uint8_t category, const char * msg, va_list v)
void LogV(const char * module, uint8_t category, const char * msg, va_list v)
{
struct timeval tv;