From ba691daa173f0c29406ae5f075e53e9540a63534 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Mon, 16 Sep 2024 14:33:47 +0800 Subject: [PATCH 01/13] feat: add new log mechanism --- .clang-format | 2 +- core/include/ten_utils/lib/string.h | 4 +- .../binding/go/ten_env/ten_env_internal.h | 10 +- .../go/ten_env/ten_env_return_result.h | 2 +- .../binding/python/ten_env/ten_env.h | 3 + .../extension_thread/extension_thread.h | 17 +- .../ten_runtime/ten_env/log.h | 18 +- .../ten_runtime/ten_env/ten_env.h | 3 + core/include_internal/ten_utils/lib/string.h | 14 ++ core/include_internal/ten_utils/log/new.h | 67 +++++++ .../ten_utils/log/new_level.h | 12 ++ core/include_internal/ten_utils/log/new_pid.h | 12 ++ .../include_internal/ten_utils/log/new_time.h | 19 ++ .../ten_utils/log/new_time_cache.h | 30 +++ .../binding/go/interface/ten/ten_env.go | 59 +++++- .../go/interface/ten/{ten.h => ten_env.h} | 63 +++--- .../binding/go/interface/ten/ten_export.go | 2 +- .../binding/go/interface/ten/ten_property.go | 68 +++---- .../binding/go/interface/ten/ten_return.go | 2 +- .../binding/go/native/addon/addon.c | 2 +- .../ten_runtime/binding/go/native/app/app.c | 4 +- .../binding/go/native/extension/extension.c | 4 +- .../native/extension_group/extension_group.c | 4 +- .../binding/go/native/ten_env/ten_env.c | 12 +- .../ten_env/ten_env_addon_create_extension.c | 4 +- .../ten_env/ten_env_addon_destroy_extension.c | 4 +- .../ten_env/ten_env_create_instance_done.c | 7 +- .../go/native/ten_env/ten_env_get_property.c | 64 +++--- .../ten_env/ten_env_get_property_async.c | 7 +- .../go/native/ten_env/ten_env_init_property.c | 4 +- .../native/ten_env/ten_env_is_cmd_connected.c | 4 +- .../binding/go/native/ten_env/ten_env_log.c | 126 ++++++++++++ .../ten_env_on_create_extension_done.c | 4 +- .../native/ten_env/ten_env_on_deinit_done.c | 21 +- .../ten_env_on_delete_extension_done.c | 4 +- .../go/native/ten_env/ten_env_on_init_done.c | 10 +- .../go/native/ten_env/ten_env_on_start_done.c | 4 +- .../go/native/ten_env/ten_env_on_stop_done.c | 4 +- .../go/native/ten_env/ten_env_return_result.c | 8 +- .../go/native/ten_env/ten_env_return_value.c | 2 +- .../native/ten_env/ten_env_send_audio_frame.c | 7 +- .../go/native/ten_env/ten_env_send_cmd.c | 4 +- .../go/native/ten_env/ten_env_send_data.c | 4 +- .../go/native/ten_env/ten_env_send_json.c | 4 +- .../native/ten_env/ten_env_send_video_frame.c | 7 +- .../go/native/ten_env/ten_env_set_property.c | 37 ++-- .../ten_env/ten_env_set_property_async.c | 4 +- .../binding/python/interface/ten/__init__.py | 2 + .../interface/ten/libten_runtime_python.pyi | 9 + .../binding/python/interface/ten/ten_env.py | 27 +++ .../python/interface/ten/ten_env_log_level.py | 16 ++ .../binding/python/native/ten_env/ten_env.c | 1 + .../native/ten_env/ten_env_get_property.c | 4 +- .../python/native/ten_env/ten_env_log.c | 104 ++++++++++ .../ten_env/ten_env_on_create_instance_done.c | 3 +- .../native/ten_env/ten_env_return_result.c | 5 +- .../python/native/ten_env/ten_env_send_cmd.c | 2 +- .../extension_thread/extension_thread.c | 7 +- core/src/ten_runtime/msg/msg.c | 2 +- core/src/ten_runtime/ten_env/internal/log.c | 47 +++-- .../ten_runtime/ten_env/{ten.c => ten_env.c} | 7 +- .../general/transport/backend/uv/stream/tcp.c | 4 +- core/src/ten_utils/lib/sys/general/error.c | 4 +- core/src/ten_utils/lib/sys/general/string.c | 26 ++- core/src/ten_utils/log/new.c | 182 ++++++++++++++++++ core/src/ten_utils/log/new_level.c | 29 +++ core/src/ten_utils/log/new_pid.c | 60 ++++++ core/src/ten_utils/log/new_time.c | 77 ++++++++ core/src/ten_utils/log/new_time_cache.c | 91 +++++++++ core/src/ten_utils/value/value.c | 2 +- core/src/ten_utils/value/value_kv.c | 2 +- tests/common/client/tcp.c | 4 +- .../default_extension_go/default_extension.go | 2 +- .../default_extension_python/extension.py | 12 +- 74 files changed, 1254 insertions(+), 254 deletions(-) create mode 100644 core/include_internal/ten_utils/lib/string.h create mode 100644 core/include_internal/ten_utils/log/new.h create mode 100644 core/include_internal/ten_utils/log/new_level.h create mode 100644 core/include_internal/ten_utils/log/new_pid.h create mode 100644 core/include_internal/ten_utils/log/new_time.h create mode 100644 core/include_internal/ten_utils/log/new_time_cache.h rename core/src/ten_runtime/binding/go/interface/ten/{ten.h => ten_env.h} (87%) create mode 100644 core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c create mode 100644 core/src/ten_runtime/binding/python/interface/ten/ten_env_log_level.py create mode 100644 core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c rename core/src/ten_runtime/ten_env/{ten.c => ten_env.c} (98%) create mode 100644 core/src/ten_utils/log/new.c create mode 100644 core/src/ten_utils/log/new_level.c create mode 100644 core/src/ten_utils/log/new_pid.c create mode 100644 core/src/ten_utils/log/new_time.c create mode 100644 core/src/ten_utils/log/new_time_cache.c diff --git a/.clang-format b/.clang-format index 4dc31c8499..d89aea4cdf 100644 --- a/.clang-format +++ b/.clang-format @@ -107,7 +107,7 @@ IndentAccessModifiers: false IndentCaseLabels: true IndentCaseBlocks: false IndentGotoLabels: true -IndentPPDirectives: BeforeHash +IndentPPDirectives: None IndentExternBlock: AfterExternBlock IndentRequires: false IndentWidth: 2 diff --git a/core/include/ten_utils/lib/string.h b/core/include/ten_utils/lib/string.h index da57b5a63c..21983ebc22 100644 --- a/core/include/ten_utils/lib/string.h +++ b/core/include/ten_utils/lib/string.h @@ -119,8 +119,8 @@ TEN_UTILS_API void ten_string_clear(ten_string_t *self); */ TEN_UTILS_API void ten_string_reserve(ten_string_t *self, size_t extra); -TEN_UTILS_API void ten_string_set_from_va_list(ten_string_t *self, - const char *fmt, va_list ap); +TEN_UTILS_API void ten_string_append_from_va_list(ten_string_t *self, + const char *fmt, va_list ap); /** * @brief Set the string object with a c string. diff --git a/core/include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h b/core/include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h index 12ec726155..a1e42ea944 100644 --- a/core/include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h +++ b/core/include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h @@ -13,7 +13,7 @@ #include "include_internal/ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/binding/go/interface/ten/common.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/rwlock.h" @@ -42,9 +42,11 @@ typedef struct ten_go_ten_env_t { ten_go_bridge_t bridge; - ten_env_t *c_ten; // Point to the corresponding C ten. - ten_env_proxy_t - *c_ten_proxy; // Point to the corresponding C ten_env_proxy if any. + // Point to the corresponding C ten. + ten_env_t *c_ten_env; + + // Point to the corresponding C ten_env_proxy if any. + ten_env_proxy_t *c_ten_env_proxy; ten_rwlock_t *lock; } ten_go_ten_env_t; diff --git a/core/include_internal/ten_runtime/binding/go/ten_env/ten_env_return_result.h b/core/include_internal/ten_runtime/binding/go/ten_env/ten_env_return_result.h index e5c7982ccf..04b96466d3 100644 --- a/core/include_internal/ten_runtime/binding/go/ten_env/ten_env_return_result.h +++ b/core/include_internal/ten_runtime/binding/go/ten_env/ten_env_return_result.h @@ -6,7 +6,7 @@ #include "ten_runtime/ten_config.h" #include "ten_runtime/binding/go/interface/ten/common.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/common/status_code.h" #include "ten_utils/value/value.h" diff --git a/core/include_internal/ten_runtime/binding/python/ten_env/ten_env.h b/core/include_internal/ten_runtime/binding/python/ten_env/ten_env.h index 88e1fcd3b6..3c1b5825da 100644 --- a/core/include_internal/ten_runtime/binding/python/ten_env/ten_env.h +++ b/core/include_internal/ten_runtime/binding/python/ten_env/ten_env.h @@ -116,3 +116,6 @@ TEN_RUNTIME_PRIVATE_API PyObject *ten_py_ten_env_set_property_float( TEN_RUNTIME_PRIVATE_API PyObject *ten_py_ten_env_init_property_from_json( PyObject *self, PyObject *args); + +TEN_RUNTIME_PRIVATE_API PyObject *ten_py_ten_env_log(PyObject *self, + PyObject *args); diff --git a/core/include_internal/ten_runtime/extension_thread/extension_thread.h b/core/include_internal/ten_runtime/extension_thread/extension_thread.h index f4dc1c95a4..9bcc7525e7 100644 --- a/core/include_internal/ten_runtime/extension_thread/extension_thread.h +++ b/core/include_internal/ten_runtime/extension_thread/extension_thread.h @@ -7,6 +7,7 @@ #include "ten_runtime/ten_config.h" +#include "include_internal/ten_utils/log/new.h" #include "ten_utils/container/list.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/error.h" @@ -80,6 +81,8 @@ typedef struct ten_extension_thread_t { ten_extension_context_t *extension_context; ten_runloop_t *runloop; + + ten_log_new_t log; } ten_extension_thread_t; TEN_RUNTIME_API bool ten_extension_thread_not_call_by_me( @@ -88,13 +91,15 @@ TEN_RUNTIME_API bool ten_extension_thread_not_call_by_me( TEN_RUNTIME_PRIVATE_API bool ten_extension_thread_call_by_me( ten_extension_thread_t *self); -TEN_RUNTIME_PRIVATE_API bool ten_extension_thread_check_integrity_if_in_lock_mode( +TEN_RUNTIME_PRIVATE_API bool +ten_extension_thread_check_integrity_if_in_lock_mode( ten_extension_thread_t *self); TEN_RUNTIME_PRIVATE_API bool ten_extension_thread_check_integrity( ten_extension_thread_t *self, bool check_thread); -TEN_RUNTIME_PRIVATE_API ten_extension_thread_t *ten_extension_thread_create(void); +TEN_RUNTIME_PRIVATE_API ten_extension_thread_t *ten_extension_thread_create( + void); TEN_RUNTIME_PRIVATE_API void ten_extension_thread_attach_to_context_and_group( ten_extension_thread_t *self, ten_extension_context_t *extension_context, @@ -135,8 +140,8 @@ TEN_RUNTIME_PRIVATE_API void ten_extension_thread_start_to_add_all_created_extension_to_engine( ten_extension_thread_t *self); -TEN_RUNTIME_PRIVATE_API ten_runloop_t *ten_extension_thread_get_attached_runloop( - ten_extension_thread_t *self); +TEN_RUNTIME_PRIVATE_API ten_runloop_t * +ten_extension_thread_get_attached_runloop(ten_extension_thread_t *self); -TEN_RUNTIME_PRIVATE_API void ten_extension_thread_process_acquire_lock_mode_task( - void *self_, void *arg); +TEN_RUNTIME_PRIVATE_API void +ten_extension_thread_process_acquire_lock_mode_task(void *self_, void *arg); diff --git a/core/include_internal/ten_runtime/ten_env/log.h b/core/include_internal/ten_runtime/ten_env/log.h index 98c1efd3c1..14ed9a020b 100644 --- a/core/include_internal/ten_runtime/ten_env/log.h +++ b/core/include_internal/ten_runtime/ten_env/log.h @@ -7,11 +7,19 @@ #include "ten_runtime/ten_config.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/new.h" typedef struct ten_env_t ten_env_t; -TEN_RUNTIME_PRIVATE_API void ten_log(ten_env_t *self, const char *func_name, - const char *file_name, size_t lineno, - TEN_LOG_LEVEL level, const char *tag, - const char *fmt, ...); +TEN_RUNTIME_API void ten_env_log(ten_env_t *self, TEN_LOG_NEW_LEVEL level, + const char *func_name, const char *file_name, + size_t line_no, const char *msg); + +TEN_RUNTIME_API void ten_env_log_formatted( + ten_env_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, + const char *file_name, size_t line_no, const char *fmt, ...); + +TEN_RUNTIME_API void ten_env_log_with_size_formatted( + ten_env_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, + size_t func_name_len, const char *file_name, size_t file_name_len, + size_t line_no, const char *fmt, ...); diff --git a/core/include_internal/ten_runtime/ten_env/ten_env.h b/core/include_internal/ten_runtime/ten_env/ten_env.h index 209ce1764c..5a95c0cdb9 100644 --- a/core/include_internal/ten_runtime/ten_env/ten_env.h +++ b/core/include_internal/ten_runtime/ten_env/ten_env.h @@ -9,6 +9,7 @@ #include "include_internal/ten_runtime/addon/addon.h" #include "include_internal/ten_runtime/binding/common.h" +#include "include_internal/ten_utils/log/new.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/io/runloop.h" #include "ten_utils/macro/check.h" @@ -71,6 +72,8 @@ typedef struct ten_env_t { ten_destroy_handler_in_target_lang_func_t destroy_handler; ten_list_t ten_proxy_list; + + ten_log_new_t log; } ten_env_t; TEN_RUNTIME_PRIVATE_API ten_runloop_t *ten_env_get_attached_runloop( diff --git a/core/include_internal/ten_utils/lib/string.h b/core/include_internal/ten_utils/lib/string.h new file mode 100644 index 0000000000..b1f18f3c3f --- /dev/null +++ b/core/include_internal/ten_utils/lib/string.h @@ -0,0 +1,14 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#pragma once + +#include "ten_utils/ten_config.h" + +#include "ten_utils/lib/string.h" + +TEN_UTILS_PRIVATE_API void ten_string_init_from_va_list(ten_string_t *self, + const char *fmt, + va_list ap); diff --git a/core/include_internal/ten_utils/log/new.h b/core/include_internal/ten_utils/log/new.h new file mode 100644 index 0000000000..16b2dfaa8d --- /dev/null +++ b/core/include_internal/ten_utils/log/new.h @@ -0,0 +1,67 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#pragma once + +#include "ten_utils/ten_config.h" + +#include +#include +#include + +#include "ten_utils/lib/signature.h" + +#define TEN_LOG_NEW_SIGNATURE 0xC0EE0CE92149D61AU + +typedef enum TEN_LOG_NEW_LEVEL { + TEN_LOG_NEW_INVALID, + + TEN_LOG_NEW_VERBOSE, + TEN_LOG_NEW_DEBUG, + TEN_LOG_NEW_INFO, + TEN_LOG_NEW_WARN, + TEN_LOG_NEW_ERROR, + TEN_LOG_NEW_FATAL, +} TEN_LOG_NEW_LEVEL; + +typedef struct ten_log_new_t { + ten_signature_t signature; +} ten_log_new_t; + +#define TEN_LOG_NEW(log, level, fmt, ...) \ + ten_log_new_log_formatted(log, level, __func__, __FILE__, __LINE__, fmt, \ + ##__VA_ARGS__) + +TEN_UTILS_PRIVATE_API bool ten_log_new_check_integrity(ten_log_new_t *self); + +TEN_UTILS_API void ten_log_new_init(ten_log_new_t *self); + +TEN_UTILS_PRIVATE_API ten_log_new_t *ten_log_new_create(void); + +TEN_UTILS_API void ten_log_new_deinit(ten_log_new_t *self); + +TEN_UTILS_PRIVATE_API void ten_log_new_destroy(ten_log_new_t *self); + +TEN_UTILS_API void ten_log_new_log_formatted( + ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, + const char *file_name, size_t line_no, const char *fmt, ...); + +TEN_UTILS_API void ten_log_new_log_with_size_from_va_list( + ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, + size_t func_name_len, const char *file_name, size_t file_name_len, + size_t line_no, const char *fmt, va_list ap); + +TEN_UTILS_API void ten_log_new_log_from_va_list( + ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, + const char *file_name, size_t line_no, const char *fmt, va_list ap); + +TEN_UTILS_API void ten_log_new_log(ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, + const char *func_name, const char *file_name, + size_t line_no, const char *msg); + +TEN_UTILS_PRIVATE_API void ten_log_new_log_with_size( + ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, + size_t func_name_len, const char *file_name, size_t file_name_len, + size_t line_no, const char *msg, size_t msg_len); diff --git a/core/include_internal/ten_utils/log/new_level.h b/core/include_internal/ten_utils/log/new_level.h new file mode 100644 index 0000000000..efe0514d75 --- /dev/null +++ b/core/include_internal/ten_utils/log/new_level.h @@ -0,0 +1,12 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#pragma once + +#include "ten_utils/ten_config.h" + +#include "include_internal/ten_utils/log/new.h" + +TEN_UTILS_PRIVATE_API char ten_log_new_level_char(TEN_LOG_NEW_LEVEL level); diff --git a/core/include_internal/ten_utils/log/new_pid.h b/core/include_internal/ten_utils/log/new_pid.h new file mode 100644 index 0000000000..62a44811c0 --- /dev/null +++ b/core/include_internal/ten_utils/log/new_pid.h @@ -0,0 +1,12 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#pragma once + +#include "ten_utils/ten_config.h" + +#include + +TEN_UTILS_PRIVATE_API void ten_log_new_get_pid_tid(int64_t *pid, int64_t *tid); diff --git a/core/include_internal/ten_utils/log/new_time.h b/core/include_internal/ten_utils/log/new_time.h new file mode 100644 index 0000000000..7a34469098 --- /dev/null +++ b/core/include_internal/ten_utils/log/new_time.h @@ -0,0 +1,19 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#pragma once + +#include "ten_utils/ten_config.h" + +#include + +#include "ten_utils/lib/string.h" + +TEN_UTILS_PRIVATE_API void ten_log_new_get_time(struct tm *time_info, + size_t *msec); + +TEN_UTILS_PRIVATE_API void ten_log_new_add_time_string(ten_string_t *buf, + struct tm *time_info, + size_t msec); diff --git a/core/include_internal/ten_utils/log/new_time_cache.h b/core/include_internal/ten_utils/log/new_time_cache.h new file mode 100644 index 0000000000..7d32623dbf --- /dev/null +++ b/core/include_internal/ten_utils/log/new_time_cache.h @@ -0,0 +1,30 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#pragma once + +#include "ten_utils/ten_config.h" + +#include +#include + +#if !defined(_WIN32) && !defined(_WIN64) + + #include + #include + + #if defined(__linux__) + #include + #elif defined(__MACH__) + #include + #endif + +TEN_UTILS_PRIVATE_API bool ten_log_new_time_cache_get(const struct timeval *tv, + struct tm *tm); + +TEN_UTILS_PRIVATE_API void ten_log_new_time_cache_set(const struct timeval *tv, + struct tm *tm); + +#endif diff --git a/core/src/ten_runtime/binding/go/interface/ten/ten_env.go b/core/src/ten_runtime/binding/go/interface/ten/ten_env.go index 18563c97e0..0990005470 100644 --- a/core/src/ten_runtime/binding/go/interface/ten/ten_env.go +++ b/core/src/ten_runtime/binding/go/interface/ten/ten_env.go @@ -6,12 +6,14 @@ package ten -//#include "ten.h" +//#include "ten_env.h" import "C" import ( "fmt" "log" + "runtime" + "strings" "unsafe" ) @@ -21,6 +23,19 @@ type ( ResultHandler func(TenEnv, CmdResult) ) +type LogLevel int32 + +const ( + logLevelInvalid LogLevel = iota + + LogLevelVerbose + LogLevelDebug + LogLevelInfo + LogLevelWarn + LogLevelError + LogLevelFatal +) + // TenEnv represents the interface for the TEN (Run Time Environment) component. type TenEnv interface { postSyncJob(payload job) any @@ -74,6 +89,8 @@ type TenEnv interface { ) error InitPropertyFromJSONBytes(value []byte) error + + Log(level LogLevel, msg string, args ...interface{}) error } // Making a compile-time assertion which indicates that if 'ten' type doesn't @@ -518,3 +535,43 @@ func (p *tenEnv) SetPropertyAsync( } return nil } + +func (p *tenEnv) Log(level LogLevel, msg string, args ...interface{}) error { + // Format the message with the provided arguments + formattedMsg := fmt.Sprintf(msg, args...) + + // Get caller info + pc, fileName, lineNo, ok := runtime.Caller( + 1, // 1 means the caller of this function + ) + funcName := "unknown" + if ok { + fn := runtime.FuncForPC(pc) + if fn != nil { + funcName = fn.Name() + + parts := strings.Split(funcName, ".") + if len(parts) > 0 { + // The last part is the method name. + funcName = parts[len(parts)-1] + } + } + } else { + fileName = "unknown" + lineNo = 0 + } + + C.ten_go_ten_env_log( + p.cPtr, + C.int(level), + unsafe.Pointer(unsafe.StringData(funcName)), + C.int(len(funcName)), + unsafe.Pointer(unsafe.StringData(fileName)), + C.int(len(fileName)), + C.int(lineNo), + unsafe.Pointer(unsafe.StringData(formattedMsg)), + C.int(len(formattedMsg)), + ) + + return nil +} diff --git a/core/src/ten_runtime/binding/go/interface/ten/ten.h b/core/src/ten_runtime/binding/go/interface/ten/ten_env.h similarity index 87% rename from core/src/ten_runtime/binding/go/interface/ten/ten.h rename to core/src/ten_runtime/binding/go/interface/ten/ten_env.h index d1d5120d11..c06d8f6b34 100644 --- a/core/src/ten_runtime/binding/go/interface/ten/ten.h +++ b/core/src/ten_runtime/binding/go/interface/ten/ten_env.h @@ -191,7 +191,7 @@ const char *ten_go_ten_env_debug_info(uintptr_t bridge_addr); * * @param value_addr The output for the ten_value_t* of the property. */ -ten_go_status_t ten_go_ten_env_property_get_type_and_size( +ten_go_status_t ten_go_ten_env_get_property_type_and_size( uintptr_t bridge_addr, const void *path, int path_len, uint8_t *type, uintptr_t *size, uintptr_t *value_addr); @@ -207,116 +207,116 @@ ten_go_status_t ten_go_ten_env_property_get_type_and_size( * * @param value The output for the value of the property. */ -ten_go_status_t ten_go_ten_env_property_get_int8(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_int8(uintptr_t bridge_addr, const void *path, int path_len, int8_t *value); -ten_go_status_t ten_go_ten_env_property_get_int16(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_int16(uintptr_t bridge_addr, const void *path, int path_len, int16_t *value); -ten_go_status_t ten_go_ten_env_property_get_int32(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_int32(uintptr_t bridge_addr, const void *path, int path_len, int32_t *value); -ten_go_status_t ten_go_ten_env_property_get_int64(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_int64(uintptr_t bridge_addr, const void *path, int path_len, int64_t *value); -ten_go_status_t ten_go_ten_env_property_get_uint8(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_uint8(uintptr_t bridge_addr, const void *path, int path_len, uint8_t *value); -ten_go_status_t ten_go_ten_env_property_get_uint16(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_uint16(uintptr_t bridge_addr, const void *path, int path_len, uint16_t *value); -ten_go_status_t ten_go_ten_env_property_get_uint32(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_uint32(uintptr_t bridge_addr, const void *path, int path_len, uint32_t *value); -ten_go_status_t ten_go_ten_env_property_get_uint64(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_uint64(uintptr_t bridge_addr, const void *path, int path_len, uint64_t *value); -ten_go_status_t ten_go_ten_env_property_get_float32(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_float32(uintptr_t bridge_addr, const void *path, int path_len, float *value); -ten_go_status_t ten_go_ten_env_property_get_float64(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_float64(uintptr_t bridge_addr, const void *path, int path_len, double *value); -ten_go_status_t ten_go_ten_env_property_get_bool(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_bool(uintptr_t bridge_addr, const void *path, int path_len, bool *value); -ten_go_status_t ten_go_ten_env_property_get_ptr(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_ptr(uintptr_t bridge_addr, const void *path, int path_len, ten_go_handle_t *value); -ten_go_status_t ten_go_ten_env_property_set_bool(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_bool(uintptr_t bridge_addr, const void *path, int path_len, bool value); -ten_go_status_t ten_go_ten_env_property_set_int8(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_int8(uintptr_t bridge_addr, const void *path, int path_len, int8_t value); -ten_go_status_t ten_go_ten_env_property_set_int16(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_int16(uintptr_t bridge_addr, const void *path, int path_len, int16_t value); -ten_go_status_t ten_go_ten_env_property_set_int32(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_int32(uintptr_t bridge_addr, const void *path, int path_len, int32_t value); -ten_go_status_t ten_go_ten_env_property_set_int64(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_int64(uintptr_t bridge_addr, const void *path, int path_len, int64_t value); -ten_go_status_t ten_go_ten_env_property_set_uint8(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_uint8(uintptr_t bridge_addr, const void *path, int path_len, uint8_t value); -ten_go_status_t ten_go_ten_env_property_set_uint16(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_uint16(uintptr_t bridge_addr, const void *path, int path_len, uint16_t value); -ten_go_status_t ten_go_ten_env_property_set_uint32(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_uint32(uintptr_t bridge_addr, const void *path, int path_len, uint32_t value); -ten_go_status_t ten_go_ten_env_property_set_uint64(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_uint64(uintptr_t bridge_addr, const void *path, int path_len, uint64_t value); -ten_go_status_t ten_go_ten_env_property_set_float32(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_float32(uintptr_t bridge_addr, const void *path, int path_len, float value); -ten_go_status_t ten_go_ten_env_property_set_float64(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_float64(uintptr_t bridge_addr, const void *path, int path_len, double value); -ten_go_status_t ten_go_ten_env_property_set_string(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_string(uintptr_t bridge_addr, const void *path, int path_len, const void *value, int value_len); -ten_go_status_t ten_go_ten_env_property_set_buf(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_buf(uintptr_t bridge_addr, const void *path, int path_len, void *value, int value_len); -ten_go_status_t ten_go_ten_env_property_set_ptr(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_ptr(uintptr_t bridge_addr, const void *path, int path_len, ten_go_handle_t value); @@ -332,7 +332,7 @@ ten_go_status_t ten_go_ten_env_property_set_ptr(uintptr_t bridge_addr, * and @a json_str will be copied to the slice and destroy using * ten_go_copy_c_str_to_slice_and_free. */ -ten_go_status_t ten_go_ten_env_property_get_json_and_size( +ten_go_status_t ten_go_ten_env_get_property_json_and_size( uintptr_t bridge_addr, const void *path, int path_len, uintptr_t *json_str_len, const char **json_str); @@ -343,7 +343,7 @@ ten_go_status_t ten_go_ten_env_property_get_json_and_size( * it points to must be a valid json data. * @param json_str_len The length of the underlying array of the GO slice. */ -ten_go_status_t ten_go_ten_env_property_set_json_bytes(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_json_bytes(uintptr_t bridge_addr, const void *path, int path_len, const void *json_str, @@ -351,3 +351,8 @@ ten_go_status_t ten_go_ten_env_property_set_json_bytes(uintptr_t bridge_addr, ten_go_status_t ten_go_ten_env_init_property_from_json_bytes( uintptr_t bridge_addr, const void *json_str, int json_str_len); + +ten_go_status_t ten_go_ten_env_log(uintptr_t bridge_addr, int level, + const void *func_name, int func_name_len, + const void *file_name, int file_name_len, + int line_no, const void *msg, int msg_len); diff --git a/core/src/ten_runtime/binding/go/interface/ten/ten_export.go b/core/src/ten_runtime/binding/go/interface/ten/ten_export.go index 2e8c0f752f..1aa91275db 100644 --- a/core/src/ten_runtime/binding/go/interface/ten/ten_export.go +++ b/core/src/ten_runtime/binding/go/interface/ten/ten_export.go @@ -6,7 +6,7 @@ package ten -//#include "ten.h" +//#include "ten_env.h" import "C" import ( diff --git a/core/src/ten_runtime/binding/go/interface/ten/ten_property.go b/core/src/ten_runtime/binding/go/interface/ten/ten_property.go index effcc0d93f..7d1732bcf5 100644 --- a/core/src/ten_runtime/binding/go/interface/ten/ten_property.go +++ b/core/src/ten_runtime/binding/go/interface/ten/ten_property.go @@ -6,7 +6,7 @@ package ten -//#include "ten.h" +//#include "ten_env.h" //#include "value.h" import "C" @@ -23,7 +23,7 @@ func (p *tenEnv) getPropertyTypeAndSize( defer p.keepAlive() var ptInC propTypeInC - apiStatus := C.ten_go_ten_env_property_get_type_and_size( + apiStatus := C.ten_go_ten_env_get_property_type_and_size( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -49,7 +49,7 @@ func (p *tenEnv) GetPropertyInt8(path string) (int8, error) { return getPropInt8(func(v *C.int8_t) C.ten_go_status_t { defer p.keepAlive() - return C.ten_go_ten_env_property_get_int8( + return C.ten_go_ten_env_get_property_int8( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -68,7 +68,7 @@ func (p *tenEnv) GetPropertyInt16(path string) (int16, error) { return getPropInt16(func(v *C.int16_t) C.ten_go_status_t { defer p.keepAlive() - return C.ten_go_ten_env_property_get_int16( + return C.ten_go_ten_env_get_property_int16( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -87,7 +87,7 @@ func (p *tenEnv) GetPropertyInt32(path string) (int32, error) { return getPropInt32(func(v *C.int32_t) C.ten_go_status_t { defer p.keepAlive() - return C.ten_go_ten_env_property_get_int32( + return C.ten_go_ten_env_get_property_int32( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -106,7 +106,7 @@ func (p *tenEnv) GetPropertyInt64(path string) (int64, error) { return getPropInt64(func(v *C.int64_t) C.ten_go_status_t { defer p.keepAlive() - return C.ten_go_ten_env_property_get_int64( + return C.ten_go_ten_env_get_property_int64( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -125,7 +125,7 @@ func (p *tenEnv) GetPropertyUint8(path string) (uint8, error) { return getPropUint8(func(v *C.uint8_t) C.ten_go_status_t { defer p.keepAlive() - return C.ten_go_ten_env_property_get_uint8( + return C.ten_go_ten_env_get_property_uint8( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -144,7 +144,7 @@ func (p *tenEnv) GetPropertyUint16(path string) (uint16, error) { return getPropUint16(func(v *C.uint16_t) C.ten_go_status_t { defer p.keepAlive() - return C.ten_go_ten_env_property_get_uint16( + return C.ten_go_ten_env_get_property_uint16( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -163,7 +163,7 @@ func (p *tenEnv) GetPropertyUint32(path string) (uint32, error) { return getPropUint32(func(v *C.uint32_t) C.ten_go_status_t { defer p.keepAlive() - return C.ten_go_ten_env_property_get_uint32( + return C.ten_go_ten_env_get_property_uint32( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -182,7 +182,7 @@ func (p *tenEnv) GetPropertyUint64(path string) (uint64, error) { return getPropUint64(func(v *C.uint64_t) C.ten_go_status_t { defer p.keepAlive() - return C.ten_go_ten_env_property_get_uint64( + return C.ten_go_ten_env_get_property_uint64( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -201,7 +201,7 @@ func (p *tenEnv) GetPropertyFloat32(path string) (float32, error) { return getPropFloat32(func(v *C.float) C.ten_go_status_t { defer p.keepAlive() - return C.ten_go_ten_env_property_get_float32( + return C.ten_go_ten_env_get_property_float32( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -220,7 +220,7 @@ func (p *tenEnv) GetPropertyFloat64(path string) (float64, error) { return getPropFloat64(func(v *C.double) C.ten_go_status_t { defer p.keepAlive() - return C.ten_go_ten_env_property_get_float64( + return C.ten_go_ten_env_get_property_float64( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -239,7 +239,7 @@ func (p *tenEnv) GetPropertyBool(path string) (bool, error) { return getPropBool(func(v *C.bool) C.ten_go_status_t { defer p.keepAlive() - return C.ten_go_ten_env_property_get_bool( + return C.ten_go_ten_env_get_property_bool( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -258,7 +258,7 @@ func (p *tenEnv) GetPropertyPtr(path string) (any, error) { return getPropPtr(func(v *cHandle) C.ten_go_status_t { defer p.keepAlive() - return C.ten_go_ten_env_property_get_ptr( + return C.ten_go_ten_env_get_property_ptr( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -387,7 +387,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { var err error switch pt { case propTypeBool: - apiStatus := C.ten_go_ten_env_property_set_bool( + apiStatus := C.ten_go_ten_env_set_property_bool( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -396,7 +396,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { err = withGoStatus(&apiStatus) case propTypeInt8: - apiStatus := C.ten_go_ten_env_property_set_int8( + apiStatus := C.ten_go_ten_env_set_property_int8( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -405,7 +405,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { err = withGoStatus(&apiStatus) case propTypeInt16: - apiStatus := C.ten_go_ten_env_property_set_int16( + apiStatus := C.ten_go_ten_env_set_property_int16( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -414,7 +414,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { err = withGoStatus(&apiStatus) case propTypeInt32: - apiStatus := C.ten_go_ten_env_property_set_int32( + apiStatus := C.ten_go_ten_env_set_property_int32( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -423,7 +423,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { err = withGoStatus(&apiStatus) case propTypeInt64: - apiStatus := C.ten_go_ten_env_property_set_int64( + apiStatus := C.ten_go_ten_env_set_property_int64( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -433,7 +433,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { case propTypeInt: if is64bit { - apiStatus := C.ten_go_ten_env_property_set_int64( + apiStatus := C.ten_go_ten_env_set_property_int64( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -441,7 +441,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { ) err = withGoStatus(&apiStatus) } else { - apiStatus := C.ten_go_ten_env_property_set_int32( + apiStatus := C.ten_go_ten_env_set_property_int32( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -451,7 +451,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { } case propTypeUint8: - apiStatus := C.ten_go_ten_env_property_set_uint8( + apiStatus := C.ten_go_ten_env_set_property_uint8( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -460,7 +460,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { err = withGoStatus(&apiStatus) case propTypeUint16: - apiStatus := C.ten_go_ten_env_property_set_uint16( + apiStatus := C.ten_go_ten_env_set_property_uint16( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -469,7 +469,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { err = withGoStatus(&apiStatus) case propTypeUint32: - apiStatus := C.ten_go_ten_env_property_set_uint32( + apiStatus := C.ten_go_ten_env_set_property_uint32( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -478,7 +478,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { err = withGoStatus(&apiStatus) case propTypeUint64: - apiStatus := C.ten_go_ten_env_property_set_uint64( + apiStatus := C.ten_go_ten_env_set_property_uint64( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -488,7 +488,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { case propTypeUint: if is64bit { - apiStatus := C.ten_go_ten_env_property_set_uint64( + apiStatus := C.ten_go_ten_env_set_property_uint64( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -496,7 +496,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { ) err = withGoStatus(&apiStatus) } else { - apiStatus := C.ten_go_ten_env_property_set_uint32( + apiStatus := C.ten_go_ten_env_set_property_uint32( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -506,7 +506,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { } case propTypeFloat32: - apiStatus := C.ten_go_ten_env_property_set_float32( + apiStatus := C.ten_go_ten_env_set_property_float32( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -515,7 +515,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { err = withGoStatus(&apiStatus) case propTypeFloat64: - apiStatus := C.ten_go_ten_env_property_set_float64( + apiStatus := C.ten_go_ten_env_set_property_float64( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -533,7 +533,7 @@ func (p *tenEnv) SetProperty(path string, value any) error { case propTypePtr: vh := newGoHandle(value) - apiStatus := C.ten_go_ten_env_property_set_ptr( + apiStatus := C.ten_go_ten_env_set_property_ptr( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -559,7 +559,7 @@ func (p *tenEnv) SetPropertyString(path string, value string) error { ) } - apiStatus := C.ten_go_ten_env_property_set_string( + apiStatus := C.ten_go_ten_env_set_property_string( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -580,7 +580,7 @@ func (p *tenEnv) SetPropertyBytes(path string, value []byte) error { ) } - apiStatus := C.ten_go_ten_env_property_set_buf( + apiStatus := C.ten_go_ten_env_set_property_buf( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -597,7 +597,7 @@ func (p *tenEnv) SetPropertyBytes(path string, value []byte) error { func (p *tenEnv) setPropertyFromJSONBytes(path string, value []byte) error { defer p.keepAlive() - apiStatus := C.ten_go_ten_env_property_set_json_bytes( + apiStatus := C.ten_go_ten_env_set_property_json_bytes( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), @@ -633,7 +633,7 @@ func (p *tenEnv) getPropertyToJSONBytes(path string) ([]byte, error) { var cJSONStr *C.char var cJSONStrLen C.uintptr_t - apiStatus := C.ten_go_ten_env_property_get_json_and_size( + apiStatus := C.ten_go_ten_env_get_property_json_and_size( p.cPtr, unsafe.Pointer(unsafe.StringData(path)), C.int(len(path)), diff --git a/core/src/ten_runtime/binding/go/interface/ten/ten_return.go b/core/src/ten_runtime/binding/go/interface/ten/ten_return.go index edd5689996..e7a011b9df 100644 --- a/core/src/ten_runtime/binding/go/interface/ten/ten_return.go +++ b/core/src/ten_runtime/binding/go/interface/ten/ten_return.go @@ -6,7 +6,7 @@ package ten -//#include "ten.h" +//#include "ten_env.h" import "C" func (p *tenEnv) ReturnResult(statusCmd CmdResult, cmd Cmd) error { diff --git a/core/src/ten_runtime/binding/go/native/addon/addon.c b/core/src/ten_runtime/binding/go/native/addon/addon.c index 2b642e61ae..d4bc09031e 100644 --- a/core/src/ten_runtime/binding/go/native/addon/addon.c +++ b/core/src/ten_runtime/binding/go/native/addon/addon.c @@ -21,7 +21,7 @@ #include "ten_runtime/addon/extension_group/extension_group.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_runtime/binding/go/native/app/app.c b/core/src/ten_runtime/binding/go/native/app/app.c index aa368ec296..d0c7d636d7 100644 --- a/core/src/ten_runtime/binding/go/native/app/app.c +++ b/core/src/ten_runtime/binding/go/native/app/app.c @@ -15,7 +15,7 @@ #include "include_internal/ten_runtime/global/signal.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" @@ -45,7 +45,7 @@ static void proxy_on_init(ten_app_t *app, ten_env_t *ten_env) { TEN_ASSERT(app_bridge, "Should not happen."); ten_go_ten_env_t *ten_bridge = ten_go_ten_env_wrap(ten_env); - ten_bridge->c_ten_proxy = ten_env_proxy_create(ten_env, 1, NULL); + ten_bridge->c_ten_env_proxy = ten_env_proxy_create(ten_env, 1, NULL); tenGoAppOnInit(app_bridge->bridge.go_instance, ten_go_ten_env_go_handle(ten_bridge)); diff --git a/core/src/ten_runtime/binding/go/native/extension/extension.c b/core/src/ten_runtime/binding/go/native/extension/extension.c index fdd975e343..eb2bb1dc0e 100644 --- a/core/src/ten_runtime/binding/go/native/extension/extension.c +++ b/core/src/ten_runtime/binding/go/native/extension/extension.c @@ -17,7 +17,7 @@ #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" @@ -108,7 +108,7 @@ static void proxy_on_init(ten_extension_t *self, ten_env_t *ten_env) { "Should not happen."); ten_go_ten_env_t *ten_bridge = ten_go_ten_env_wrap(ten_env); - ten_bridge->c_ten_proxy = ten_env_proxy_create(ten_env, 1, NULL); + ten_bridge->c_ten_env_proxy = ten_env_proxy_create(ten_env, 1, NULL); tenGoExtensionOnInit(ten_go_extension_go_handle(extension_bridge), ten_go_ten_env_go_handle(ten_bridge)); diff --git a/core/src/ten_runtime/binding/go/native/extension_group/extension_group.c b/core/src/ten_runtime/binding/go/native/extension_group/extension_group.c index 2681898c6a..4717e6be8a 100644 --- a/core/src/ten_runtime/binding/go/native/extension_group/extension_group.c +++ b/core/src/ten_runtime/binding/go/native/extension_group/extension_group.c @@ -16,7 +16,7 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/container/list.h" @@ -100,7 +100,7 @@ static void proxy_on_init(ten_extension_group_t *self, ten_env_t *ten_env) { "Should not happen."); ten_go_ten_env_t *ten_bridge = ten_go_ten_env_wrap(ten_env); - ten_bridge->c_ten_proxy = ten_env_proxy_create(ten_env, 1, NULL); + ten_bridge->c_ten_env_proxy = ten_env_proxy_create(ten_env, 1, NULL); tenGoExtensionGroupOnInit(extension_group_bridge->bridge.go_instance, ten_go_ten_env_go_handle(ten_bridge)); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env.c index 8ebc4b30b5..e1c076aa78 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env.c @@ -15,7 +15,7 @@ #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/alloc.h" @@ -55,7 +55,7 @@ static void ten_go_ten_env_destroy_c_part(void *ten_bridge_) { ten_go_ten_env_t *ten_bridge = (ten_go_ten_env_t *)ten_bridge_; TEN_ASSERT(ten_bridge && ten_go_ten_env_check_integrity(ten_bridge), "Should not happen."); - ten_bridge->c_ten = NULL; + ten_bridge->c_ten_env = NULL; ten_go_bridge_destroy_c_part(&ten_bridge->bridge); // Remove the Go ten object from the global map. @@ -68,7 +68,7 @@ static void ten_go_ten_env_close(void *ten_bridge_) { "Should not happen."); ten_rwlock_lock(ten_bridge->lock, 0); - ten_bridge->c_ten = NULL; + ten_bridge->c_ten_env = NULL; ten_rwlock_unlock(ten_bridge->lock, 0); } @@ -95,8 +95,8 @@ ten_go_ten_env_t *ten_go_ten_env_wrap(ten_env_t *c_ten) { ten_bridge->bridge.sp_ref_by_go = ten_shared_ptr_clone(ten_bridge->bridge.sp_ref_by_c); - ten_bridge->c_ten = c_ten; - ten_bridge->c_ten_proxy = NULL; + ten_bridge->c_ten_env = c_ten; + ten_bridge->c_ten_env_proxy = NULL; ten_binding_handle_set_me_in_target_lang((ten_binding_handle_t *)c_ten, ten_bridge); @@ -130,7 +130,7 @@ const char *ten_go_ten_env_debug_info(uintptr_t bridge_addr) { ten_string_t debug_info; ten_string_init_formatted(&debug_info, "ten attach_to type: %d", - self->c_ten->attach_to); + self->c_ten_env->attach_to); const char *res = ten_go_str_dup(ten_string_get_raw_str(&debug_info)); ten_string_deinit(&debug_info); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_create_extension.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_create_extension.c index 10d08d78e6..9301781b49 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_create_extension.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_create_extension.c @@ -15,7 +15,7 @@ #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" @@ -148,7 +148,7 @@ bool ten_go_ten_env_addon_create_extension(uintptr_t bridge_addr, ten_env_notify_addon_create_extension_info_create( addon_name, instance_name, callback_info); - if (!ten_env_proxy_notify(self->c_ten_proxy, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_env_notify_addon_create_extension, addon_extension_create_info, false, &err)) { TEN_LOGD("TEN/GO failed to addon_extension_create."); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_destroy_extension.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_destroy_extension.c index 5071aa0b24..65576b41f9 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_destroy_extension.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_destroy_extension.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/binding/go/interface/ten/common.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" @@ -121,7 +121,7 @@ void ten_go_ten_env_addon_destroy_extension(uintptr_t bridge_addr, ten_env_notify_addon_destroy_extension_info_create( ten_go_extension_c_extension(extension_bridge), callback_info); - if (!ten_env_proxy_notify(self->c_ten_proxy, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_env_notify_addon_destroy_extension, addon_extension_destroy_info, false, &err)) { TEN_LOGD("TEN/GO failed to addon_extension_destroy."); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_create_instance_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_create_instance_done.c index cae536694f..1a1e176536 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_create_instance_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_create_instance_done.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/binding/go/extension_group/extension_group.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten.h" #include "ten_utils/macro/check.h" @@ -44,8 +44,9 @@ void ten_go_ten_env_on_create_instance_done(uintptr_t bridge_addr, ten_error_t err; ten_error_init(&err); - bool rc = ten_env_on_create_instance_done( - self->c_ten, c_extension_or_extension_group, (void *)context_addr, &err); + bool rc = ten_env_on_create_instance_done(self->c_ten_env, + c_extension_or_extension_group, + (void *)context_addr, &err); TEN_ASSERT(rc, "Should not happen."); ten_error_deinit(&err); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property.c index 4e68c233ae..cb5e86336f 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/value/value.h" #include "ten_runtime/binding/go/interface/ten/common.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/binding/go/interface/ten/value.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" @@ -100,7 +100,7 @@ static void ten_env_notify_get_property(ten_env_t *ten_env, void *user_data) { ten_error_deinit(&err); } -static ten_value_t *ten_go_ten_env_property_get_and_check_if_exists( +static ten_value_t *ten_go_ten_env_get_property_and_check_if_exists( ten_go_ten_env_t *self, const void *path, int path_len, ten_go_status_t *status) { TEN_ASSERT(self && ten_go_ten_env_check_integrity(self), @@ -115,13 +115,13 @@ static ten_value_t *ten_go_ten_env_property_get_and_check_if_exists( ten_env_notify_get_property_info_t *info = ten_env_notify_get_property_info_create(path, path_len); - if (!ten_env_proxy_notify(self->c_ten_proxy, ten_env_notify_get_property, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_env_notify_get_property, info, false, &err)) { ten_go_status_from_error(status, &err); goto done; } - // The ten_go_ten_property_get_and_check_if_exists() is called from a + // The ten_go_ten_env_get_property_and_check_if_exists() is called from a // goroutine in GO world. The goroutine runs on a OS thread (i.e., M is GO // world), and the M won't be scheduled to other goroutine until the cgo call // is completed (i.e., this function returns). The following @@ -150,7 +150,7 @@ static ten_value_t *ten_go_ten_env_property_get_and_check_if_exists( return c_value; } -ten_go_status_t ten_go_ten_env_property_get_type_and_size( +ten_go_status_t ten_go_ten_env_get_property_type_and_size( uintptr_t bridge_addr, const void *path, int path_len, uint8_t *type, uintptr_t *size, uintptr_t *value_addr) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -165,7 +165,7 @@ ten_go_status_t ten_go_ten_env_property_get_type_and_size( TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *c_value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *c_value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (c_value != NULL) { ten_go_ten_value_get_type_and_size(c_value, type, size); @@ -199,7 +199,7 @@ ten_go_status_t ten_go_ten_env_property_get_type_and_size( return status; } -ten_go_status_t ten_go_ten_env_property_get_int8(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_int8(uintptr_t bridge_addr, const void *path, int path_len, int8_t *value) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -214,7 +214,7 @@ ten_go_status_t ten_go_ten_env_property_get_int8(uintptr_t bridge_addr, TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *c_value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *c_value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (c_value != NULL) { ten_error_t err; @@ -235,7 +235,7 @@ ten_go_status_t ten_go_ten_env_property_get_int8(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_get_int16(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_int16(uintptr_t bridge_addr, const void *path, int path_len, int16_t *value) { @@ -251,7 +251,7 @@ ten_go_status_t ten_go_ten_env_property_get_int16(uintptr_t bridge_addr, TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *c_value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *c_value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (c_value != NULL) { ten_error_t err; @@ -272,7 +272,7 @@ ten_go_status_t ten_go_ten_env_property_get_int16(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_get_int32(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_int32(uintptr_t bridge_addr, const void *path, int path_len, int32_t *value) { @@ -288,7 +288,7 @@ ten_go_status_t ten_go_ten_env_property_get_int32(uintptr_t bridge_addr, TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *c_value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *c_value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (c_value != NULL) { ten_error_t err; @@ -309,7 +309,7 @@ ten_go_status_t ten_go_ten_env_property_get_int32(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_get_int64(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_int64(uintptr_t bridge_addr, const void *path, int path_len, int64_t *value) { @@ -325,7 +325,7 @@ ten_go_status_t ten_go_ten_env_property_get_int64(uintptr_t bridge_addr, TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *c_value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *c_value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (c_value != NULL) { ten_error_t err; @@ -346,7 +346,7 @@ ten_go_status_t ten_go_ten_env_property_get_int64(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_get_uint8(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_uint8(uintptr_t bridge_addr, const void *path, int path_len, uint8_t *value) { @@ -362,7 +362,7 @@ ten_go_status_t ten_go_ten_env_property_get_uint8(uintptr_t bridge_addr, TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *c_value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *c_value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (c_value != NULL) { ten_error_t err; @@ -383,7 +383,7 @@ ten_go_status_t ten_go_ten_env_property_get_uint8(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_get_uint16(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_uint16(uintptr_t bridge_addr, const void *path, int path_len, uint16_t *value) { @@ -399,7 +399,7 @@ ten_go_status_t ten_go_ten_env_property_get_uint16(uintptr_t bridge_addr, TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *c_value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *c_value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (c_value != NULL) { ten_error_t err; @@ -420,7 +420,7 @@ ten_go_status_t ten_go_ten_env_property_get_uint16(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_get_uint32(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_uint32(uintptr_t bridge_addr, const void *path, int path_len, uint32_t *value) { @@ -436,7 +436,7 @@ ten_go_status_t ten_go_ten_env_property_get_uint32(uintptr_t bridge_addr, TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *c_value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *c_value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (c_value != NULL) { ten_error_t err; @@ -457,7 +457,7 @@ ten_go_status_t ten_go_ten_env_property_get_uint32(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_get_uint64(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_uint64(uintptr_t bridge_addr, const void *path, int path_len, uint64_t *value) { @@ -473,7 +473,7 @@ ten_go_status_t ten_go_ten_env_property_get_uint64(uintptr_t bridge_addr, TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *c_value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *c_value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (c_value != NULL) { ten_error_t err; @@ -494,7 +494,7 @@ ten_go_status_t ten_go_ten_env_property_get_uint64(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_get_float32(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_float32(uintptr_t bridge_addr, const void *path, int path_len, float *value) { @@ -510,7 +510,7 @@ ten_go_status_t ten_go_ten_env_property_get_float32(uintptr_t bridge_addr, TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *c_value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *c_value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (c_value != NULL) { ten_error_t err; @@ -531,7 +531,7 @@ ten_go_status_t ten_go_ten_env_property_get_float32(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_get_float64(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_float64(uintptr_t bridge_addr, const void *path, int path_len, double *value) { @@ -547,7 +547,7 @@ ten_go_status_t ten_go_ten_env_property_get_float64(uintptr_t bridge_addr, TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *c_value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *c_value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (c_value != NULL) { ten_error_t err; @@ -568,7 +568,7 @@ ten_go_status_t ten_go_ten_env_property_get_float64(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_get_bool(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_bool(uintptr_t bridge_addr, const void *path, int path_len, bool *value) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -583,7 +583,7 @@ ten_go_status_t ten_go_ten_env_property_get_bool(uintptr_t bridge_addr, TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *c_value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *c_value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (c_value != NULL) { ten_error_t err; @@ -604,7 +604,7 @@ ten_go_status_t ten_go_ten_env_property_get_bool(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_get_ptr(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_get_property_ptr(uintptr_t bridge_addr, const void *path, int path_len, ten_go_handle_t *value) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -619,7 +619,7 @@ ten_go_status_t ten_go_ten_env_property_get_ptr(uintptr_t bridge_addr, TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *c_value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *c_value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (c_value != NULL) { ten_go_ten_value_get_ptr(c_value, value, &status); @@ -634,7 +634,7 @@ ten_go_status_t ten_go_ten_env_property_get_ptr(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_get_json_and_size( +ten_go_status_t ten_go_ten_env_get_property_json_and_size( uintptr_t bridge_addr, const void *path, int path_len, uintptr_t *json_str_len, const char **json_str) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -649,7 +649,7 @@ ten_go_status_t ten_go_ten_env_property_get_json_and_size( TEN_GO_TEN_IS_ALIVE_REGION_BEGIN( self, { ten_go_status_set_errno(&status, TEN_ERRNO_TEN_IS_CLOSED); }); - ten_value_t *value = ten_go_ten_env_property_get_and_check_if_exists( + ten_value_t *value = ten_go_ten_env_get_property_and_check_if_exists( self, path, path_len, &status); if (value != NULL) { ten_go_ten_value_to_json(value, json_str_len, json_str, &status); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property_async.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property_async.c index 213d0d7b16..c212a42a5a 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property_async.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property_async.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/value/value.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/binding/go/interface/ten/value.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" @@ -103,8 +103,9 @@ bool ten_go_ten_env_get_property_async(uintptr_t bridge_addr, const char *path, get_property_info = ten_env_notify_get_property_info_create( path, ten_go_callback_info_create(callback_id)); - if (!ten_env_proxy_notify(self->c_ten_proxy, ten_notify_get_property_async, - get_property_info, false, &err)) { + if (!ten_env_proxy_notify(self->c_ten_env_proxy, + ten_notify_get_property_async, get_property_info, + false, &err)) { TEN_LOGD("TEN/GO failed to get_property."); ten_env_notify_get_property_info_destroy(get_property_info); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_init_property.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_init_property.c index 635a6a7bd8..c9cbdf1290 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_init_property.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_init_property.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "ten_runtime/binding/go/interface/ten/common.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/ten_env/internal/metadata.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" @@ -84,7 +84,7 @@ ten_go_status_t ten_go_ten_env_init_property_from_json_bytes( ten_env_notify_init_property_info_create(json_str, json_str_len); TEN_ASSERT(info, "Should not happen."); - if (!ten_env_proxy_notify(self->c_ten_proxy, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_env_notify_init_property_from_json, info, false, &err)) { ten_go_status_from_error(&status, &err); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_is_cmd_connected.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_is_cmd_connected.c index 14d348ec06..a548ed664f 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_is_cmd_connected.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_is_cmd_connected.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/macro/check.h" @@ -73,7 +73,7 @@ bool ten_go_ten_env_is_cmd_connected(uintptr_t bridge_addr, const char *name) { ten_env_notify_is_cmd_connected_info_t *info = ten_env_notify_is_cmd_connected_info_create(name); - if (!ten_env_proxy_notify(self->c_ten_proxy, ten_notify_is_cmd_connected, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_notify_is_cmd_connected, info, false, &err)) { TEN_LOGD("TEN/GO failed to is_cmd_connected."); result = false; diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c new file mode 100644 index 0000000000..337f1212b5 --- /dev/null +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c @@ -0,0 +1,126 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#include +#include +#include + +#include "include_internal/ten_runtime/binding/go/internal/common.h" +#include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" +#include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" +#include "include_internal/ten_runtime/ten_env/log.h" +#include "ten_runtime/binding/go/interface/ten/common.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" +#include "ten_utils/lib/error.h" +#include "ten_utils/macro/check.h" +#include "ten_utils/macro/memory.h" + +typedef struct ten_env_notify_log_info_t { + int32_t level; + const char *func_name; + size_t func_name_len; + const char *file_name; + size_t file_name_len; + size_t line_no; + const char *msg; + size_t msg_len; + ten_event_t *completed; +} ten_env_notify_log_info_t; + +static ten_env_notify_log_info_t *ten_env_notify_log_info_create( + int32_t level, const char *func_name, size_t func_name_len, + const char *file_name, size_t file_name_len, size_t line_no, + const char *msg, size_t msg_len) { + ten_env_notify_log_info_t *info = + TEN_MALLOC(sizeof(ten_env_notify_log_info_t)); + TEN_ASSERT(info, "Failed to allocate memory."); + + info->level = level; + info->func_name = func_name; + info->func_name_len = func_name_len; + info->file_name = file_name; + info->file_name_len = file_name_len; + info->line_no = line_no; + info->msg = msg; + info->msg_len = msg_len; + info->completed = ten_event_create(0, 1); + + return info; +} + +static void ten_env_notify_log_info_destroy(ten_env_notify_log_info_t *info) { + TEN_ASSERT(info, "Invalid argument."); + + ten_event_destroy(info->completed); + + TEN_FREE(info); +} + +static void ten_env_notify_log(ten_env_t *ten_env, void *user_data) { + TEN_ASSERT(user_data, "Invalid argument."); + TEN_ASSERT(ten_env && ten_env_check_integrity(ten_env, true), + "Should not happen."); + + ten_env_notify_log_info_t *info = user_data; + TEN_ASSERT(info, "Should not happen."); + + ten_env_log_with_size_formatted(ten_env, info->level, info->func_name, + info->func_name_len, info->file_name, + info->file_name_len, info->line_no, "%.*s", + info->msg_len, info->msg); + + ten_event_set(info->completed); +} + +ten_go_status_t ten_go_ten_env_log(uintptr_t bridge_addr, int level, + const void *func_name, int func_name_len, + const void *file_name, int file_name_len, + int line_no, const void *msg, int msg_len) { + ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); + TEN_ASSERT(self && ten_go_ten_env_check_integrity(self), + "Should not happen."); + + // According to the document of `unsafe.StringData()`, the underlying data + // (i.e., value here) of an empty GO string is unspecified. So it's unsafe to + // access. We should handle this case explicitly. + const char *func_name_value = NULL; + if (func_name_len > 0) { + func_name_value = (const char *)func_name; + } + + const char *file_name_value = NULL; + if (file_name_len > 0) { + file_name_value = (const char *)file_name; + } + + const char *msg_value = NULL; + if (msg_len > 0) { + msg_value = (const char *)msg; + } + + ten_env_notify_log_info_t *info = ten_env_notify_log_info_create( + level, func_name_value, func_name_len, file_name_value, file_name_len, + line_no, msg_value, msg_len); + + ten_go_status_t status; + ten_go_status_init_with_errno(&status, TEN_ERRNO_OK); + + ten_error_t err; + ten_error_init(&err); + + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_env_notify_log, info, + false, &err)) { + ten_go_status_from_error(&status, &err); + goto done; + } + + ten_event_wait(info->completed, -1); + +done: + ten_error_deinit(&err); + ten_env_notify_log_info_destroy(info); + + return status; +} diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_create_extension_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_create_extension_done.c index aa83c83e64..38a772f811 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_create_extension_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_create_extension_done.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/macro/check.h" @@ -95,7 +95,7 @@ void ten_go_ten_env_on_create_extensions_done( *on_create_extensions_done_info = ten_env_notify_on_create_extensions_done_info_create(&result); - if (!ten_env_proxy_notify(self->c_ten_proxy, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_notify_on_create_extensions_done, on_create_extensions_done_info, false, &err)) { TEN_LOGD("TEN/GO failed to on_create_extensions_done."); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_deinit_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_deinit_done.c index e778c36f2f..63adbe7329 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_deinit_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_deinit_done.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/rwlock.h" #include "ten_utils/macro/check.h" @@ -26,14 +26,15 @@ static void ten_env_notify_on_deinit_done(ten_env_t *ten_env, void *user_data) { ten_go_ten_env_t *ten_bridge = user_data; TEN_ASSERT(ten_bridge, "Should not happen."); - if (ten_bridge->c_ten_proxy) { - TEN_ASSERT(ten_env_proxy_get_thread_cnt(ten_bridge->c_ten_proxy, NULL) == 1, - "Should not happen."); + if (ten_bridge->c_ten_env_proxy) { + TEN_ASSERT( + ten_env_proxy_get_thread_cnt(ten_bridge->c_ten_env_proxy, NULL) == 1, + "Should not happen."); - ten_env_proxy_t *ten_env_proxy = ten_bridge->c_ten_proxy; + ten_env_proxy_t *ten_env_proxy = ten_bridge->c_ten_env_proxy; ten_rwlock_lock(ten_bridge->lock, 0); - ten_bridge->c_ten_proxy = NULL; + ten_bridge->c_ten_env_proxy = NULL; ten_rwlock_unlock(ten_bridge->lock, 0); bool rc = ten_env_proxy_release(ten_env_proxy, &err); @@ -66,11 +67,11 @@ void ten_go_ten_env_on_deinit_done(uintptr_t bridge_addr) { ten_error_init(&err); bool rc = true; - if (self->c_ten->attach_to == TEN_ENV_ATTACH_TO_ADDON) { - rc = ten_env_on_deinit_done(self->c_ten, &err); + if (self->c_ten_env->attach_to == TEN_ENV_ATTACH_TO_ADDON) { + rc = ten_env_on_deinit_done(self->c_ten_env, &err); } else { - rc = ten_env_proxy_notify(self->c_ten_proxy, ten_env_notify_on_deinit_done, - self, false, &err); + rc = ten_env_proxy_notify(self->c_ten_env_proxy, + ten_env_notify_on_deinit_done, self, false, &err); } TEN_ASSERT(rc, "Should not happen."); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_delete_extension_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_delete_extension_done.c index 5d2487f360..42ea092194 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_delete_extension_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_delete_extension_done.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/macro/check.h" @@ -39,7 +39,7 @@ void ten_go_ten_env_on_destroy_extensions_done(uintptr_t bridge_addr) { ten_error_t err; ten_error_init(&err); - if (!ten_env_proxy_notify(self->c_ten_proxy, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_env_notify_on_destroy_extensions_done, NULL, false, &err)) { TEN_LOGD("TEN/GO failed to on_destroy_extensions_done."); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_init_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_init_done.c index c419d7be16..42e1afdf72 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_init_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_init_done.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" @@ -43,11 +43,11 @@ void ten_go_ten_env_on_init_done(uintptr_t bridge_addr) { bool rc = true; - if (self->c_ten->attach_to == TEN_ENV_ATTACH_TO_ADDON) { - rc = ten_env_on_init_done(self->c_ten, &err); + if (self->c_ten_env->attach_to == TEN_ENV_ATTACH_TO_ADDON) { + rc = ten_env_on_init_done(self->c_ten_env, &err); } else { - rc = ten_env_proxy_notify(self->c_ten_proxy, ten_env_notify_on_init_done, - NULL, false, &err); + rc = ten_env_proxy_notify(self->c_ten_env_proxy, + ten_env_notify_on_init_done, NULL, false, &err); } TEN_ASSERT(rc, "Should not happen."); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_start_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_start_done.c index ab50051a9b..9e669ebed0 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_start_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_start_done.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/macro/check.h" @@ -41,7 +41,7 @@ void ten_go_ten_env_on_start_done(uintptr_t bridge_addr) { ten_error_init(&err); TEN_UNUSED bool rc = ten_env_proxy_notify( - self->c_ten_proxy, ten_env_notify_on_start_done, NULL, false, &err); + self->c_ten_env_proxy, ten_env_notify_on_start_done, NULL, false, &err); TEN_ASSERT(rc, "Should not happen."); ten_error_deinit(&err); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_stop_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_stop_done.c index 186fd45425..d6a69a31ab 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_stop_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_stop_done.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/macro/check.h" @@ -40,7 +40,7 @@ void ten_go_ten_env_on_stop_done(uintptr_t bridge_addr) { ten_error_init(&err); TEN_UNUSED bool rc = ten_env_proxy_notify( - self->c_ten_proxy, ten_env_notify_on_stop_done, NULL, false, &err); + self->c_ten_env_proxy, ten_env_notify_on_stop_done, NULL, false, &err); TEN_ASSERT(rc, "Should not happen."); ten_error_deinit(&err); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_result.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_result.c index d908f1bc4f..aeb135de04 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_result.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_result.c @@ -14,7 +14,7 @@ #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" @@ -113,7 +113,7 @@ ten_go_status_t ten_go_ten_env_return_result(uintptr_t bridge_addr, ten_env_notify_return_result_info_create( ten_go_msg_move_c_msg(cmd_result), ten_go_msg_move_c_msg(cmd)); - if (!ten_env_proxy_notify(self->c_ten_proxy, ten_notify_return_result, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_notify_return_result, return_result_info, false, &err)) { ten_env_notify_return_result_info_destroy(return_result_info); ten_go_status_from_error(&api_status, &err); @@ -148,7 +148,7 @@ ten_go_status_t ten_go_ten_env_return_result_directly( ten_env_notify_return_result_info_create( ten_go_msg_move_c_msg(cmd_result), NULL); - if (!ten_env_proxy_notify(self->c_ten_proxy, ten_notify_return_result, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_notify_return_result, return_result_info, false, &err)) { ten_env_notify_return_result_info_destroy(return_result_info); ten_go_status_from_error(&api_status, &err); @@ -185,7 +185,7 @@ bool ten_go_ten_return_status_value(ten_go_ten_env_t *self, ten_go_msg_t *cmd, ten_env_notify_return_result_info_t *return_result_info = ten_env_notify_return_result_info_create(cmd_result, ten_go_msg_move_c_msg(cmd)); - if (!ten_env_proxy_notify(self->c_ten_proxy, ten_notify_return_result, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_notify_return_result, return_result_info, false, &err)) { result = false; ten_env_notify_return_result_info_destroy(return_result_info); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_value.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_value.c index 98fb0cc309..53e4af6a6e 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_value.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_value.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_return_result.h" #include "include_internal/ten_runtime/binding/go/value/value.h" #include "ten_runtime/binding/go/interface/ten/msg.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_utils/lib/error.h" #include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_audio_frame.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_audio_frame.c index 3b17e144b9..0be4ecd304 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_audio_frame.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_audio_frame.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/macro/check.h" @@ -83,8 +83,9 @@ bool ten_go_ten_env_send_audio_frame(uintptr_t bridge_addr, ten_env_notify_send_audio_frame_info_create( ten_go_msg_move_c_msg(audio_frame)); - if (!ten_env_proxy_notify(self->c_ten_proxy, ten_env_notify_send_audio_frame, - notify_info, false, &err)) { + if (!ten_env_proxy_notify(self->c_ten_env_proxy, + ten_env_notify_send_audio_frame, notify_info, false, + &err)) { ten_env_notify_send_audio_frame_info_destroy(notify_info); result = false; } diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_cmd.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_cmd.c index 0f906f2921..433523b3cf 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_cmd.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_cmd.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" @@ -101,7 +101,7 @@ ten_go_status_t ten_go_ten_env_send_cmd(uintptr_t bridge_addr, ten_go_msg_move_c_msg(cmd), handler_id <= 0 ? TEN_GO_NO_RESPONSE_HANDLER : handler_id); - if (!ten_env_proxy_notify(self->c_ten_proxy, ten_env_notify_send_cmd, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_env_notify_send_cmd, notify_info, false, &err)) { ten_env_notify_send_cmd_info_destroy(notify_info); ten_go_status_from_error(&status, &err); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_data.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_data.c index c38cb8148b..af9a5cc7a6 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_data.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_data.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" @@ -86,7 +86,7 @@ ten_go_status_t ten_go_ten_env_send_data(uintptr_t bridge_addr, ten_env_notify_send_data_info_t *notify_info = ten_env_notify_send_data_info_create(ten_go_msg_move_c_msg(data)); - if (!ten_env_proxy_notify(self->c_ten_proxy, ten_env_notify_send_data, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_env_notify_send_data, notify_info, false, &err)) { ten_env_notify_send_data_info_destroy(notify_info); ten_go_status_from_error(&status, &err); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_json.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_json.c index 1f3c712707..bc5988236b 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_json.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_json.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "ten_runtime/binding/go/interface/ten/common.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" @@ -103,7 +103,7 @@ ten_go_status_t ten_go_ten_env_send_json(uintptr_t bridge_addr, ten_error_t err; ten_error_init(&err); - if (!ten_env_proxy_notify(self->c_ten_proxy, ten_env_notify_send_json, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_env_notify_send_json, notify_info, false, &err)) { ten_env_notify_send_json_info_destroy(notify_info); ten_go_status_from_error(&status, &err); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_video_frame.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_video_frame.c index d67e1becbe..c2f170ed3d 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_video_frame.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_video_frame.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" @@ -89,8 +89,9 @@ ten_go_status_t ten_go_ten_env_send_video_frame( ten_env_notify_send_video_frame_info_create( ten_go_msg_move_c_msg(video_frame)); - if (!ten_env_proxy_notify(self->c_ten_proxy, ten_env_notify_send_video_frame, - notify_info, false, &err)) { + if (!ten_env_proxy_notify(self->c_ten_env_proxy, + ten_env_notify_send_video_frame, notify_info, false, + &err)) { ten_env_notify_send_video_frame_info_destroy(notify_info); ten_go_status_from_error(&status, &err); } diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property.c index 3985dc7145..168cb3ee7a 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/value/value.h" #include "ten_runtime/binding/go/interface/ten/common.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/binding/go/interface/ten/value.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" @@ -91,10 +91,11 @@ static void ten_go_ten_env_set_property(ten_go_ten_env_t *self, ten_error_t err; ten_error_init(&err); + ten_env_notify_set_property_info_t *info = ten_env_notify_set_property_info_create(path, path_len, value); - if (!ten_env_proxy_notify(self->c_ten_proxy, ten_env_notify_set_property, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_env_notify_set_property, info, false, &err)) { ten_go_status_from_error(status, &err); goto done; @@ -104,14 +105,16 @@ static void ten_go_ten_env_set_property(ten_go_ten_env_t *self, done: ten_env_notify_set_property_info_destroy(info); + ten_error_deinit(&err); + TEN_GO_TEN_IS_ALIVE_REGION_END(self); ten_is_close: return; } -ten_go_status_t ten_go_ten_env_property_set_bool(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_bool(uintptr_t bridge_addr, const void *path, int path_len, bool value) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -130,7 +133,7 @@ ten_go_status_t ten_go_ten_env_property_set_bool(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_int8(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_int8(uintptr_t bridge_addr, const void *path, int path_len, int8_t value) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -149,7 +152,7 @@ ten_go_status_t ten_go_ten_env_property_set_int8(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_int16(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_int16(uintptr_t bridge_addr, const void *path, int path_len, int16_t value) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -168,7 +171,7 @@ ten_go_status_t ten_go_ten_env_property_set_int16(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_int32(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_int32(uintptr_t bridge_addr, const void *path, int path_len, int32_t value) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -187,7 +190,7 @@ ten_go_status_t ten_go_ten_env_property_set_int32(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_int64(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_int64(uintptr_t bridge_addr, const void *path, int path_len, int64_t value) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -206,7 +209,7 @@ ten_go_status_t ten_go_ten_env_property_set_int64(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_uint8(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_uint8(uintptr_t bridge_addr, const void *path, int path_len, uint8_t value) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -225,7 +228,7 @@ ten_go_status_t ten_go_ten_env_property_set_uint8(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_uint16(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_uint16(uintptr_t bridge_addr, const void *path, int path_len, uint16_t value) { @@ -245,7 +248,7 @@ ten_go_status_t ten_go_ten_env_property_set_uint16(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_uint32(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_uint32(uintptr_t bridge_addr, const void *path, int path_len, uint32_t value) { @@ -265,7 +268,7 @@ ten_go_status_t ten_go_ten_env_property_set_uint32(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_uint64(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_uint64(uintptr_t bridge_addr, const void *path, int path_len, uint64_t value) { @@ -285,7 +288,7 @@ ten_go_status_t ten_go_ten_env_property_set_uint64(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_float32(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_float32(uintptr_t bridge_addr, const void *path, int path_len, float value) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -304,7 +307,7 @@ ten_go_status_t ten_go_ten_env_property_set_float32(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_float64(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_float64(uintptr_t bridge_addr, const void *path, int path_len, double value) { @@ -324,7 +327,7 @@ ten_go_status_t ten_go_ten_env_property_set_float64(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_string(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_string(uintptr_t bridge_addr, const void *path, int path_len, const void *value, @@ -355,7 +358,7 @@ ten_go_status_t ten_go_ten_env_property_set_string(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_buf(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_buf(uintptr_t bridge_addr, const void *path, int path_len, void *value, int value_len) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -374,7 +377,7 @@ ten_go_status_t ten_go_ten_env_property_set_buf(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_ptr(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_ptr(uintptr_t bridge_addr, const void *path, int path_len, ten_go_handle_t value) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); @@ -393,7 +396,7 @@ ten_go_status_t ten_go_ten_env_property_set_ptr(uintptr_t bridge_addr, return status; } -ten_go_status_t ten_go_ten_env_property_set_json_bytes(uintptr_t bridge_addr, +ten_go_status_t ten_go_ten_env_set_property_json_bytes(uintptr_t bridge_addr, const void *path, int path_len, const void *json_str, diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property_async.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property_async.c index 99957a9f40..916ca289e3 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property_async.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property_async.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/value/value.h" -#include "ten_runtime/binding/go/interface/ten/ten.h" +#include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/binding/go/interface/ten/value.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" @@ -107,7 +107,7 @@ bool ten_go_ten_env_set_property_async(uintptr_t bridge_addr, const char *name, name, ten_go_value_c_value(value), ten_go_callback_info_create(callback_id)); - if (!ten_env_proxy_notify(self->c_ten_proxy, ten_env_notify_set_property, + if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_env_notify_set_property, set_property_info, false, &err)) { TEN_LOGD("TEN/GO failed to set_property: %s", name); ten_env_notify_set_property_info_destroy(set_property_info, true); diff --git a/core/src/ten_runtime/binding/python/interface/ten/__init__.py b/core/src/ten_runtime/binding/python/interface/ten/__init__.py index 7df949f7f3..37c3329267 100644 --- a/core/src/ten_runtime/binding/python/interface/ten/__init__.py +++ b/core/src/ten_runtime/binding/python/interface/ten/__init__.py @@ -16,6 +16,7 @@ from .video_frame import VideoFrame, PixelFmt from .audio_frame import AudioFrame, AudioFrameDataFmt from .data import Data +from .ten_env_log_level import TenEnvLogLevel # Specify what should be imported when a user imports * from the # ten_runtime_python package. @@ -34,4 +35,5 @@ "CmdResult", "PixelFmt", "AudioFrameDataFmt", + "TenEnvLogLevel", ] diff --git a/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi b/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi index d5eea9c588..e5c839a219 100644 --- a/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi +++ b/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi @@ -4,6 +4,7 @@ # information. # from .ten_env_attach_to_enum import _TenEnvAttachTo +from .ten_env_log_level import TenEnvLogLevel class _Msg: def to_json(self) -> str: ... @@ -108,6 +109,14 @@ class _TenEnv: def is_property_exist(self, path: str) -> bool: ... def is_cmd_connected(self, msg_name: str) -> bool: ... def init_property_from_json(self, json_str: str) -> None: ... + def log( + self, + level: TenEnvLogLevel, + func_name: str | None, + file_name: str | None, + line_no: int, + msg: str, + ) -> None: ... class _App: def run(self, run_in_background_flag: int) -> None: ... diff --git a/core/src/ten_runtime/binding/python/interface/ten/ten_env.py b/core/src/ten_runtime/binding/python/interface/ten/ten_env.py index de96911bf0..a304f8aaff 100644 --- a/core/src/ten_runtime/binding/python/interface/ten/ten_env.py +++ b/core/src/ten_runtime/binding/python/interface/ten/ten_env.py @@ -4,6 +4,7 @@ # information. # from typing import Callable +import inspect from libten_runtime_python import _Extension, _TenEnv from .ten_env_attach_to_enum import _TenEnvAttachTo from .cmd_result import CmdResult @@ -11,6 +12,7 @@ from .video_frame import VideoFrame from .audio_frame import AudioFrame from .data import Data +from .ten_env_log_level import TenEnvLogLevel class TenEnv: ... # type: ignore @@ -109,3 +111,28 @@ def set_property_float(self, path: str, value: float) -> None: def init_property_from_json(self, json_str: str) -> None: return self._internal.init_property_from_json(json_str) + + def log( + self, + level: TenEnvLogLevel, + *args, + ) -> None: + msg = " ".join(map(str, args)) + + # Get the current frame and the caller's frame. + frame = inspect.currentframe() + if frame is not None: + caller_frame = frame.f_back + if caller_frame is not None: + # Extract information from the caller's frame + file_name = caller_frame.f_code.co_filename + func_name = caller_frame.f_code.co_name + line_no = caller_frame.f_lineno + + return self._internal.log( + level, func_name, file_name, line_no, msg + ) + else: + return self._internal.log(level, None, None, 0, msg) + else: + return self._internal.log(level, None, None, 0, msg) diff --git a/core/src/ten_runtime/binding/python/interface/ten/ten_env_log_level.py b/core/src/ten_runtime/binding/python/interface/ten/ten_env_log_level.py new file mode 100644 index 0000000000..83db269c8b --- /dev/null +++ b/core/src/ten_runtime/binding/python/interface/ten/ten_env_log_level.py @@ -0,0 +1,16 @@ +# +# This file is part of the TEN Framework project. +# See https://github.com/TEN-framework/ten_framework/LICENSE for license +# information. +# +from enum import IntEnum + + +class TenEnvLogLevel(IntEnum): + INVALID = 0 + VERBOSE = 1 + DEBUG = 2 + INFO = 3 + WARN = 4 + ERROR = 5 + FATAL = 6 diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env.c index 9538834505..73eada59b4 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env.c @@ -170,6 +170,7 @@ PyTypeObject *ten_py_ten_env_type(void) { {"is_cmd_connected", ten_py_ten_env_is_cmd_connected, METH_VARARGS, NULL}, {"init_property_from_json", ten_py_ten_env_init_property_from_json, METH_VARARGS, NULL}, + {"log", ten_py_ten_env_log, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL}, }; diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_get_property.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_get_property.c index 73666f657a..1272530d1a 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_get_property.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_get_property.c @@ -298,13 +298,13 @@ PyObject *ten_py_ten_env_is_property_exist(PyObject *self, PyObject *args) { if (PyTuple_GET_SIZE(args) != 1) { return ten_py_raise_py_value_error_exception( - "Invalid argument count when ten.is_property_exist."); + "Invalid argument count when ten_env.is_property_exist."); } const char *path = NULL; if (!PyArg_ParseTuple(args, "s", &path)) { return ten_py_raise_py_value_error_exception( - "Failed to parse argument when ten.is_property_exist."); + "Failed to parse argument when ten_env.is_property_exist."); } ten_error_t err; diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c new file mode 100644 index 0000000000..5e3a64b73f --- /dev/null +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c @@ -0,0 +1,104 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#include + +#include "include_internal/ten_runtime/binding/python/common/error.h" +#include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" +#include "include_internal/ten_runtime/ten_env/log.h" +#include "include_internal/ten_utils/log/new.h" +#include "ten_utils/macro/check.h" +#include "ten_utils/macro/memory.h" + +typedef struct ten_env_notify_log_info_t { + int32_t level; + const char *func_name; + const char *file_name; + size_t line_no; + const char *msg; + ten_event_t *completed; +} ten_env_notify_log_info_t; + +static ten_env_notify_log_info_t *ten_env_notify_log_info_create( + int32_t level, const char *func_name, const char *file_name, size_t line_no, + const char *msg) { + ten_env_notify_log_info_t *info = + TEN_MALLOC(sizeof(ten_env_notify_log_info_t)); + TEN_ASSERT(info, "Failed to allocate memory."); + + info->level = level; + info->func_name = func_name; + info->file_name = file_name; + info->line_no = line_no; + info->msg = msg; + info->completed = ten_event_create(0, 1); + + return info; +} + +static void ten_env_notify_log_info_destroy(ten_env_notify_log_info_t *info) { + TEN_ASSERT(info, "Invalid argument."); + + ten_event_destroy(info->completed); + + TEN_FREE(info); +} + +static void ten_env_notify_log(ten_env_t *ten_env, void *user_data) { + TEN_ASSERT(user_data, "Invalid argument."); + TEN_ASSERT(ten_env && ten_env_check_integrity(ten_env, true), + "Should not happen."); + + ten_env_notify_log_info_t *info = user_data; + TEN_ASSERT(info, "Should not happen."); + + ten_env_log(ten_env, info->level, info->func_name, info->file_name, + info->line_no, info->msg); + + ten_event_set(info->completed); +} + +PyObject *ten_py_ten_env_log(PyObject *self, PyObject *args) { + ten_py_ten_env_t *py_ten = (ten_py_ten_env_t *)self; + TEN_ASSERT(py_ten && ten_py_ten_env_check_integrity(py_ten), + "Invalid argument."); + + if (PyTuple_GET_SIZE(args) != 5) { + return ten_py_raise_py_value_error_exception( + "Invalid argument count when ten_env.log."); + } + + TEN_LOG_NEW_LEVEL level = TEN_LOG_NEW_INVALID; + const char *func_name = NULL; + const char *file_name = NULL; + size_t line_no = 0; + const char *msg = NULL; + if (!PyArg_ParseTuple(args, "issis", &level, &func_name, &file_name, &line_no, + &msg)) { + return ten_py_raise_py_value_error_exception( + "Failed to parse argument when ten_env.log."); + } + + ten_error_t err; + ten_error_init(&err); + + ten_env_notify_log_info_t *info = + ten_env_notify_log_info_create(level, func_name, file_name, line_no, msg); + + if (!ten_env_proxy_notify(py_ten->c_ten_env_proxy, ten_env_notify_log, info, + false, &err)) { + goto done; + } + + PyThreadState *saved_py_thread_state = PyEval_SaveThread(); + ten_event_wait(info->completed, -1); + PyEval_RestoreThread(saved_py_thread_state); + +done: + ten_error_deinit(&err); + ten_env_notify_log_info_destroy(info); + + Py_RETURN_NONE; +} diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_create_instance_done.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_create_instance_done.c index 9f2fd9b459..10e22410ae 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_create_instance_done.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_create_instance_done.c @@ -26,8 +26,7 @@ PyObject *ten_py_ten_env_on_create_instance_done(PyObject *self, if (!PyArg_ParseTuple(args, "O!l", ten_py_extension_py_type(), &extension, &context)) { ten_py_raise_py_value_error_exception( - "Invalid argument count when " - "ten.ten_py_ten_env_on_create_instance_done."); + "Invalid argument count when ten_env.on_create_instance_done."); } bool rc = ten_env_on_create_instance_done( diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_return_result.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_return_result.c index 6e4d15fd78..736f334fca 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_return_result.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_return_result.c @@ -80,7 +80,7 @@ PyObject *ten_py_ten_env_return_result(PyObject *self, PyObject *args) { if (PyTuple_GET_SIZE(args) != 2) { return ten_py_raise_py_value_error_exception( - "Invalid argument count when ten.ten_py_ten_env_return_result."); + "Invalid argument count when ten_env.return_result."); } bool success = true; @@ -145,8 +145,7 @@ PyObject *ten_py_ten_env_return_result_directly(PyObject *self, if (PyTuple_GET_SIZE(args) != 1) { return ten_py_raise_py_value_error_exception( - "Invalid argument count when " - "ten.ten_py_ten_env_return_result_directly."); + "Invalid argument count when ten_env.return_result_directly."); } bool success = true; diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c index 642ecce57f..94c97f6dfc 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c @@ -123,7 +123,7 @@ PyObject *ten_py_ten_env_send_cmd(PyObject *self, PyObject *args) { if (PyTuple_GET_SIZE(args) != 2) { return ten_py_raise_py_value_error_exception( - "Invalid argument count when ten.ten_py_ten_env_send_cmd."); + "Invalid argument count when ten_env.send_cmd."); } bool success = true; diff --git a/core/src/ten_runtime/extension_thread/extension_thread.c b/core/src/ten_runtime/extension_thread/extension_thread.c index 0e0304167f..651228931e 100644 --- a/core/src/ten_runtime/extension_thread/extension_thread.c +++ b/core/src/ten_runtime/extension_thread/extension_thread.c @@ -22,6 +22,7 @@ #include "include_internal/ten_runtime/extension_thread/msg_interface/common.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/new.h" #include "include_internal/ten_utils/sanitizer/thread_check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/ten_env/ten_env.h" @@ -104,6 +105,8 @@ ten_extension_thread_t *ten_extension_thread_create(void) { ten_sanitizer_thread_check_init(&self->thread_check); self->runloop = NULL; + ten_log_new_init(&self->log); + return self; } @@ -152,6 +155,8 @@ void ten_extension_thread_destroy(ten_extension_thread_t *self) { ten_mutex_destroy(self->lock_mode_lock); self->lock_mode_lock = NULL; + ten_log_new_deinit(&self->log); + TEN_FREE(self); } @@ -244,7 +249,7 @@ static void ten_extension_thread_inherit_thread_ownership( } void *ten_extension_thread_main_actual(ten_extension_thread_t *self) { - TEN_LOGD("Extension thread is started."); + TEN_LOG_NEW(&self->log, TEN_LOG_NEW_DEBUG, "Extension thread is started"); TEN_ASSERT(self && // TEN_NOLINTNEXTLINE(thread-check) diff --git a/core/src/ten_runtime/msg/msg.c b/core/src/ten_runtime/msg/msg.c index 5ac7db0632..5aba56bda4 100644 --- a/core/src/ten_runtime/msg/msg.c +++ b/core/src/ten_runtime/msg/msg.c @@ -931,7 +931,7 @@ static bool ten_raw_msg_dump_internal(ten_msg_t *msg, ten_error_t *err, ten_string_t description; ten_string_init(&description); - ten_string_set_from_va_list(&description, fmt, ap); + ten_string_append_from_va_list(&description, fmt, ap); const char *p = ten_string_get_raw_str(&description); diff --git a/core/src/ten_runtime/ten_env/internal/log.c b/core/src/ten_runtime/ten_env/internal/log.c index 6dffe14983..b32bb48752 100644 --- a/core/src/ten_runtime/ten_env/internal/log.c +++ b/core/src/ten_runtime/ten_env/internal/log.c @@ -5,25 +5,46 @@ // #include "include_internal/ten_runtime/ten_env/log.h" +#include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/new.h" #include "ten_runtime/ten_env/ten_env.h" -#include "ten_utils/log/log.h" -static void ten_vlog(ten_env_t *self, const char *func_name, - const char *file_name, const size_t lineno, - TEN_LOG_LEVEL level, const char *tag, const char *fmt, - va_list va) { +void ten_env_log(ten_env_t *self, TEN_LOG_NEW_LEVEL level, + const char *func_name, const char *file_name, size_t line_no, + const char *msg) { TEN_ASSERT(self && ten_env_check_integrity(self, true), "Should not happen."); - ten_log_vwrite_d(func_name, file_name, lineno, level, tag, fmt, va); + ten_log_new_log(&self->log, level, func_name, file_name, line_no, msg); } -void ten_log(ten_env_t *self, const char *func_name, const char *file_name, - const size_t lineno, TEN_LOG_LEVEL level, const char *tag, - const char *fmt, ...) { +void ten_env_log_formatted(ten_env_t *self, TEN_LOG_NEW_LEVEL level, + const char *func_name, const char *file_name, + size_t line_no, const char *fmt, ...) { TEN_ASSERT(self && ten_env_check_integrity(self, true), "Should not happen."); - va_list va; - va_start(va, fmt); - ten_vlog(self, func_name, file_name, lineno, level, tag, fmt, va); - va_end(va); + va_list ap; + va_start(ap, fmt); + + ten_log_new_log_from_va_list(&self->log, level, func_name, file_name, line_no, + fmt, ap); + + va_end(ap); +} + +void ten_env_log_with_size_formatted(ten_env_t *self, TEN_LOG_NEW_LEVEL level, + const char *func_name, + size_t func_name_len, + const char *file_name, + size_t file_name_len, size_t line_no, + const char *fmt, ...) { + TEN_ASSERT(self && ten_env_check_integrity(self, true), "Should not happen."); + + va_list ap; + va_start(ap, fmt); + + ten_log_new_log_with_size_from_va_list(&self->log, level, func_name, + func_name_len, file_name, + file_name_len, line_no, fmt, ap); + + va_end(ap); } diff --git a/core/src/ten_runtime/ten_env/ten.c b/core/src/ten_runtime/ten_env/ten_env.c similarity index 98% rename from core/src/ten_runtime/ten_env/ten.c rename to core/src/ten_runtime/ten_env/ten_env.c index d4efd2b66c..df39de041f 100644 --- a/core/src/ten_runtime/ten_env/ten.c +++ b/core/src/ten_runtime/ten_env/ten_env.c @@ -3,6 +3,8 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // +#include "include_internal/ten_runtime/ten_env/ten_env.h" + #include #include "include_internal/ten_runtime/addon/addon.h" @@ -14,7 +16,7 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/new.h" #include "ten_runtime/app/app.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/extension/extension.h" @@ -85,6 +87,7 @@ ten_env_t *ten_env_create(void) { self->close_handler = NULL; self->destroy_handler = NULL; ten_list_init(&self->ten_proxy_list); + ten_log_new_init(&self->log); self->attach_to = TEN_ENV_ATTACH_TO_INVALID; self->attached_target.addon_host = NULL; @@ -161,6 +164,8 @@ void ten_env_destroy(ten_env_t *self) { ten_sanitizer_thread_check_deinit(&self->thread_check); ten_signature_set(&self->signature, 0); + ten_log_new_deinit(&self->log); + TEN_FREE(self); } diff --git a/core/src/ten_utils/io/general/transport/backend/uv/stream/tcp.c b/core/src/ten_utils/io/general/transport/backend/uv/stream/tcp.c index 4978842b95..d5149e87ad 100644 --- a/core/src/ten_utils/io/general/transport/backend/uv/stream/tcp.c +++ b/core/src/ten_utils/io/general/transport/backend/uv/stream/tcp.c @@ -81,8 +81,8 @@ void ten_streambackend_tcp_dump_info(ten_streambackend_tcp_t *tcp_stream, ten_string_t description; ten_string_init(&description); - ten_string_set_from_va_list(&description, ten_string_get_raw_str(&new_fmt), - ap); + ten_string_append_from_va_list(&description, ten_string_get_raw_str(&new_fmt), + ap); ten_string_deinit(&new_fmt); va_end(ap); diff --git a/core/src/ten_utils/lib/sys/general/error.c b/core/src/ten_utils/lib/sys/general/error.c index e2a24fef3f..41ea436ff0 100644 --- a/core/src/ten_utils/lib/sys/general/error.c +++ b/core/src/ten_utils/lib/sys/general/error.c @@ -61,7 +61,7 @@ bool ten_error_append_errmsg(ten_error_t *self, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - ten_string_set_from_va_list(&self->err_msg, fmt, ap); + ten_string_append_from_va_list(&self->err_msg, fmt, ap); va_end(ap); return true; @@ -87,7 +87,7 @@ bool ten_error_vset(ten_error_t *self, ten_errno_t err_no, const char *fmt, self->err_no = err_no; ten_string_clear(&self->err_msg); - ten_string_set_from_va_list(&self->err_msg, fmt, ap); + ten_string_append_from_va_list(&self->err_msg, fmt, ap); return true; } diff --git a/core/src/ten_utils/lib/sys/general/string.c b/core/src/ten_utils/lib/sys/general/string.c index b560a80393..a7266a0445 100644 --- a/core/src/ten_utils/lib/sys/general/string.c +++ b/core/src/ten_utils/lib/sys/general/string.c @@ -18,7 +18,7 @@ #include "ten_utils/macro/memory.h" #if defined(_WIN32) || defined(_WIN64) - #define strtok_r strtok_s +#define strtok_r strtok_s #endif ten_string_t *ten_string_create(void) { @@ -38,8 +38,8 @@ ten_string_t *ten_string_create_from_c_str(const char *str, size_t size) { return result; } -void ten_string_set_from_va_list(ten_string_t *self, const char *fmt, - va_list ap) { +void ten_string_append_from_va_list(ten_string_t *self, const char *fmt, + va_list ap) { TEN_ASSERT(self && ten_string_check_integrity(self), "Invalid argument."); va_list cp; @@ -67,14 +67,14 @@ ten_string_t *ten_string_create_formatted(const char *fmt, ...) { ten_string_t *self = ten_string_create(); va_list ap; va_start(ap, fmt); - ten_string_set_from_va_list(self, fmt, ap); + ten_string_append_from_va_list(self, fmt, ap); va_end(ap); return self; } ten_string_t *ten_string_create_from_va_list(const char *fmt, va_list ap) { ten_string_t *self = ten_string_create(); - ten_string_set_from_va_list(self, fmt, ap); + ten_string_append_from_va_list(self, fmt, ap); return self; } @@ -101,14 +101,20 @@ void ten_string_init(ten_string_t *self) { self->buf[0] = 0; } -void ten_string_init_formatted(ten_string_t *self, const char *fmt, ...) { +void ten_string_init_from_va_list(ten_string_t *self, const char *fmt, + va_list ap) { TEN_ASSERT(self, "Invalid argument."); ten_string_init(self); + ten_string_append_from_va_list(self, fmt, ap); +} + +void ten_string_init_formatted(ten_string_t *self, const char *fmt, ...) { + TEN_ASSERT(self, "Invalid argument."); va_list ap; va_start(ap, fmt); - ten_string_set_from_va_list(self, fmt, ap); + ten_string_init_from_va_list(self, fmt, ap); va_end(ap); } @@ -139,7 +145,7 @@ void ten_string_set_formatted(ten_string_t *self, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - ten_string_set_from_va_list(self, fmt, ap); + ten_string_append_from_va_list(self, fmt, ap); va_end(ap); } @@ -151,7 +157,7 @@ void ten_string_prepend_from_va_list(ten_string_t *self, const char *fmt, ten_string_t new_str; ten_string_init(&new_str); - ten_string_set_from_va_list(&new_str, fmt, ap); + ten_string_append_from_va_list(&new_str, fmt, ap); ten_string_append_formatted(&new_str, "%s", ten_string_get_raw_str(self)); // Move the content of new_str to self. @@ -188,7 +194,7 @@ void ten_string_append_formatted(ten_string_t *self, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - ten_string_set_from_va_list(self, fmt, ap); + ten_string_append_from_va_list(self, fmt, ap); va_end(ap); } diff --git a/core/src/ten_utils/log/new.c b/core/src/ten_utils/log/new.c new file mode 100644 index 0000000000..6dd52fe93b --- /dev/null +++ b/core/src/ten_utils/log/new.c @@ -0,0 +1,182 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#include "include_internal/ten_utils/log/new.h" + +#include +#include +#include + +#include "include_internal/ten_utils/lib/string.h" +#include "include_internal/ten_utils/log/new_level.h" +#include "include_internal/ten_utils/log/new_pid.h" +#include "include_internal/ten_utils/log/new_time.h" +#include "ten_utils/lib/signature.h" +#include "ten_utils/lib/string.h" + +bool ten_log_new_check_integrity(ten_log_new_t *self) { + assert(self && "Invalid argument."); + + if (ten_signature_get(&self->signature) != + (ten_signature_t)TEN_LOG_NEW_SIGNATURE) { + return false; + } + + return true; +} + +void ten_log_new_init(ten_log_new_t *self) { + assert(self && "Invalid argument."); + + ten_signature_set(&self->signature, TEN_LOG_NEW_SIGNATURE); +} + +ten_log_new_t *ten_log_new_create(void) { + ten_log_new_t *log = malloc(sizeof(ten_log_new_t)); + assert(log && "Failed to allocate memory."); + + ten_log_new_init(log); + + return log; +} + +void ten_log_new_deinit(ten_log_new_t *self) { + assert(ten_log_new_check_integrity(self) && "Invalid argument."); +} + +void ten_log_new_destroy(ten_log_new_t *self) { + assert(ten_log_new_check_integrity(self) && "Invalid argument."); + + ten_log_new_deinit(self); + free(self); +} + +static const char *funcname(const char *func) { return func ? func : ""; } + +static const char *filename(const char *path, size_t path_len, + size_t *filename_len) { + assert(filename_len && "Invalid argument."); + + if (!path || path_len == 0) { + *filename_len = 0; + return ""; + } + + const char *filename = NULL; + size_t pos = 0; + + // Start from the end of the path and go backwards. + for (size_t i = path_len; i > 0; i--) { + if (path[i - 1] == '/' || path[i - 1] == '\\') { + filename = &path[i]; + pos = i; + break; + } + } + + if (!filename) { + filename = path; + pos = 0; + } + + // Calculate the length of the filename. + *filename_len = path_len - pos; + + return filename; +} + +void ten_log_new_log_from_va_list(ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, + const char *func_name, const char *file_name, + size_t line_no, const char *fmt, va_list ap) { + assert(ten_log_new_check_integrity(self) && "Invalid argument."); + + ten_string_t msg; + ten_string_init_from_va_list(&msg, fmt, ap); + + ten_log_new_log(self, level, func_name, file_name, line_no, + ten_string_get_raw_str(&msg)); + + ten_string_deinit(&msg); +} + +void ten_log_new_log_with_size_from_va_list( + ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, + size_t func_name_len, const char *file_name, size_t file_name_len, + size_t line_no, const char *fmt, va_list ap) { + assert(ten_log_new_check_integrity(self) && "Invalid argument."); + + ten_string_t msg; + ten_string_init_from_va_list(&msg, fmt, ap); + + ten_log_new_log_with_size(self, level, func_name, func_name_len, file_name, + file_name_len, line_no, + ten_string_get_raw_str(&msg), ten_string_len(&msg)); + + ten_string_deinit(&msg); +} + +void ten_log_new_log_formatted(ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, + const char *func_name, const char *file_name, + size_t line_no, const char *fmt, ...) { + assert(ten_log_new_check_integrity(self) && "Invalid argument."); + + va_list ap; + va_start(ap, fmt); + + ten_log_new_log_from_va_list(self, level, func_name, file_name, line_no, fmt, + ap); + + va_end(ap); +} + +void ten_log_new_log(ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, + const char *func_name, const char *file_name, + size_t line_no, const char *msg) { + ten_log_new_log_with_size(self, level, func_name, strlen(func_name), + file_name, strlen(file_name), line_no, msg, + strlen(msg)); +} + +void ten_log_new_log_with_size(ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, + const char *func_name, size_t func_name_len, + const char *file_name, size_t file_name_len, + size_t line_no, const char *msg, + size_t msg_len) { + assert(ten_log_new_check_integrity(self) && "Invalid argument."); + + ten_string_t buf; + ten_string_init(&buf); + + struct tm time_info; + size_t msec = 0; + ten_log_new_get_time(&time_info, &msec); + ten_log_new_add_time_string(&buf, &time_info, msec); + + int64_t pid = 0; + int64_t tid = 0; + ten_log_new_get_pid_tid(&pid, &tid); + + ten_string_append_formatted(&buf, " %d(%d) %c", pid, tid, + ten_log_new_level_char(level)); + + if (func_name_len) { + ten_string_append_formatted(&buf, " %.*s", func_name_len, + funcname(func_name)); + } + + size_t actual_file_name_len = 0; + const char *actual_file_name = + filename(file_name, file_name_len, &actual_file_name_len); + if (actual_file_name_len) { + ten_string_append_formatted(&buf, "@%.*s:%d", actual_file_name_len, + actual_file_name, line_no); + } + + ten_string_append_formatted(&buf, " %.*s", msg_len, msg); + + (void)fprintf(stderr, "%s\n", ten_string_get_raw_str(&buf)); + + ten_string_deinit(&buf); +} diff --git a/core/src/ten_utils/log/new_level.c b/core/src/ten_utils/log/new_level.c new file mode 100644 index 0000000000..68d192de3f --- /dev/null +++ b/core/src/ten_utils/log/new_level.c @@ -0,0 +1,29 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#include "ten_utils/ten_config.h" + +#include "include_internal/ten_utils/log/new_level.h" + +#include + +char ten_log_new_level_char(const TEN_LOG_NEW_LEVEL level) { + switch (level) { + case TEN_LOG_NEW_VERBOSE: + return 'V'; + case TEN_LOG_NEW_DEBUG: + return 'D'; + case TEN_LOG_NEW_INFO: + return 'I'; + case TEN_LOG_NEW_WARN: + return 'W'; + case TEN_LOG_NEW_ERROR: + return 'E'; + case TEN_LOG_NEW_FATAL: + return 'F'; + default: + return '?'; + } +} diff --git a/core/src/ten_utils/log/new_pid.c b/core/src/ten_utils/log/new_pid.c new file mode 100644 index 0000000000..e3c941d764 --- /dev/null +++ b/core/src/ten_utils/log/new_pid.c @@ -0,0 +1,60 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#include "ten_utils/ten_config.h" + +#include "include_internal/ten_utils/log/new_pid.h" + +#include +#include + +#if defined(__linux__) + +#include +#include + +#if !defined(__ANDROID__) +#include +#endif + +#endif + +#if defined(__MACH__) +#include +#endif + +#if defined(_WIN32) || defined(_WIN64) +#include +#else + +#include + +#if defined(__linux__) +#include +#elif defined(__MACH__) +#include +#endif + +#endif + +void ten_log_new_get_pid_tid(int64_t *pid, int64_t *tid) { + assert(pid && tid && "Invalid argument."); + +#if defined(OS_WINDOWS) + *pid = GetCurrentProcessId(); +#else + *pid = getpid(); +#endif + +#if defined(OS_WINDOWS) + *tid = GetCurrentThreadId(); +#elif defined(OS_LINUX) + *tid = syscall(SYS_gettid); +#elif defined(OS_MACOS) + *tid = (int)pthread_mach_thread_np(pthread_self()); +#else +#error Platform not supported +#endif +} diff --git a/core/src/ten_utils/log/new_time.c b/core/src/ten_utils/log/new_time.c new file mode 100644 index 0000000000..29570b8515 --- /dev/null +++ b/core/src/ten_utils/log/new_time.c @@ -0,0 +1,77 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#include "ten_utils/ten_config.h" + +#include "include_internal/ten_utils/log/new_time.h" + +#include +#include + +#include "include_internal/ten_utils/log/new_time_cache.h" +#include "ten_utils/lib/string.h" + +#if defined(OS_WINDOWS) +#include +#else + +#include +#include + +#if defined(OS_LINUX) +#include +#elif defined(OS_MACOS) +#include +#endif + +#endif + +// Maximum length of "MM-DD HH:MM:SS.XXX" +// 212 1 212 12 1 3 = 18 +#define TIME_LOG_SIZE (size_t)(18 * 2) + +void ten_log_new_get_time(struct tm *time_info, size_t *msec) { + assert(time_info && msec && "Invalid argument."); + +#if defined(OS_WINDOWS) + SYSTEMTIME st; + GetLocalTime(&st); + tm->tm_year = st.wYear; + tm->tm_mon = st.wMonth - 1; + tm->tm_mday = st.wDay; + tm->tm_wday = st.wDayOfWeek; + tm->tm_hour = st.wHour; + tm->tm_min = st.wMinute; + tm->tm_sec = st.wSecond; + *msec = st.wMilliseconds; +#else + struct timeval tv; + gettimeofday(&tv, 0); + + if (!ten_log_new_time_cache_get(&tv, time_info)) { + (void)localtime_r(&tv.tv_sec, time_info); + ten_log_new_time_cache_set(&tv, time_info); + } + + *msec = (unsigned)tv.tv_usec / 1000; +#endif +} + +void ten_log_new_add_time_string(ten_string_t *buf, struct tm *time_info, + size_t msec) { + assert(buf && "Invalid argument."); + + ten_string_reserve(buf, TIME_LOG_SIZE); + + // Format the date and time into the buffer, excluding milliseconds. + size_t written = strftime(&buf->buf[buf->first_unused_idx], + buf->buf_size - buf->first_unused_idx, + "%m-%d %H:%M:%S", time_info); + assert(written && "Should not happen."); + + buf->first_unused_idx = strlen(buf->buf); + + ten_string_append_formatted(buf, ".%03zu", msec); +} diff --git a/core/src/ten_utils/log/new_time_cache.c b/core/src/ten_utils/log/new_time_cache.c new file mode 100644 index 0000000000..2d4999e3d2 --- /dev/null +++ b/core/src/ten_utils/log/new_time_cache.c @@ -0,0 +1,91 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#include "ten_utils/ten_config.h" + +#include "include_internal/ten_utils/log/new_time_cache.h" + +#include +#include +#include + +#include "ten_utils/lib/atomic.h" + +// There is no 'struct timeval' in Windows. +#if !defined(OS_WINDOWS) + +// Indicates that the time cache is outdated. +#define TIME_CACHE_STALE (0x40000000) + +// Indicate the time is updating. +#define TIME_CACHE_UPDATING (0x40000000 | 0x80000000) + +// The initial value is `TIME_CACHE_STALE`, indicating that the cache is +// outdated. +static ten_atomic_t g_time_cache_mode = TIME_CACHE_STALE; + +// Store the values of the time cache. g_time_cache_tv stores seconds and +// microseconds. +static struct timeval g_time_cache_tv = {0, 0}; + +// Store the values of the time cache. g_time_cache_tm stores the decomposed +// time structure. +static struct tm g_time_cache_tm; + +bool ten_log_new_time_cache_get(const struct timeval *tv, struct tm *tm) { + assert(tv && tm && "Invalid argument."); + + int64_t mode = ten_atomic_load(&g_time_cache_mode); + if (0 == (mode & TIME_CACHE_UPDATING)) { + // The time cache is up-to-date, so the reader can use 'tm' directly. + // + // And add 1 to indicate that there is one more 'reader', and this operation + // will prevent the 'writer' to update the time. + mode = ten_atomic_fetch_add(&g_time_cache_mode, 1); + if (0 == (mode & TIME_CACHE_UPDATING)) { + // The time cache is up-to-date, so the reader can use 'tm' directly. + + if (g_time_cache_tv.tv_sec == tv->tv_sec) { + // Use the cached 'tm' directly. + *tm = g_time_cache_tm; + + // Indicate that one 'reader' is completed. + ten_atomic_sub_fetch(&g_time_cache_mode, 1); + return true; + } + + // Mark the time cache is outdated. + ten_atomic_or_fetch(&g_time_cache_mode, TIME_CACHE_STALE); + } + + // The time cache is _not_ up-to-date, so the reader can not use 'tm' + // directly. + ten_atomic_sub_fetch(&g_time_cache_mode, 1); + } + + // The time cache is _not_ up-to-date, so the reader can not use 'tm' + // directly. + return false; +} + +void ten_log_new_time_cache_set(const struct timeval *tv, struct tm *tm) { + assert(tv && tm && "Invalid argument."); + + // Only update the time when the time cache is outdated. + int64_t stale = TIME_CACHE_STALE; + + // Mark the time is updating, and create a critical section for the updating + // operation. + if (ten_atomic_bool_compare_swap(&g_time_cache_mode, stale, + TIME_CACHE_UPDATING)) { + g_time_cache_tv = *tv; + g_time_cache_tm = *tm; + + // Mark the time cache is up-to-date. + ten_atomic_and_fetch(&g_time_cache_mode, ~TIME_CACHE_UPDATING); + } +} + +#endif diff --git a/core/src/ten_utils/value/value.c b/core/src/ten_utils/value/value.c index 41875cb464..84c431e78e 100644 --- a/core/src/ten_utils/value/value.c +++ b/core/src/ten_utils/value/value.c @@ -370,7 +370,7 @@ static bool ten_value_init_vastring(ten_value_t *self, const char *fmt, ten_value_init_string(self); - ten_string_set_from_va_list(&self->content.string, fmt, ap); + ten_string_append_from_va_list(&self->content.string, fmt, ap); return true; } diff --git a/core/src/ten_utils/value/value_kv.c b/core/src/ten_utils/value/value_kv.c index c574b3da70..fd0f956fa7 100644 --- a/core/src/ten_utils/value/value_kv.c +++ b/core/src/ten_utils/value/value_kv.c @@ -40,7 +40,7 @@ ten_value_kv_t *ten_value_kv_create_vempty(const char *fmt, ...) { va_list ap; va_start(ap, fmt); - ten_string_set_from_va_list(&self->key, fmt, ap); + ten_string_append_from_va_list(&self->key, fmt, ap); va_end(ap); self->value = NULL; diff --git a/tests/common/client/tcp.c b/tests/common/client/tcp.c index 863bfa42c4..1d87b354fe 100644 --- a/tests/common/client/tcp.c +++ b/tests/common/client/tcp.c @@ -65,8 +65,8 @@ static void ten_test_tcp_client_dump_socket_info(ten_test_tcp_client_t *self, ten_string_t description; ten_string_init(&description); - ten_string_set_from_va_list(&description, ten_string_get_raw_str(&new_fmt), - ap); + ten_string_append_from_va_list(&description, ten_string_get_raw_str(&new_fmt), + ap); ten_string_deinit(&new_fmt); va_end(ap); diff --git a/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/default_extension.go b/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/default_extension.go index d27f633039..3e6c554eed 100644 --- a/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/default_extension.go +++ b/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/default_extension.go @@ -18,7 +18,7 @@ type baseExtension struct { } func (ext *baseExtension) OnStart(tenEnv ten.TenEnv) { - fmt.Println("baseExtension OnStart") + tenEnv.Log(ten.LogLevelDebug, "baseExtension OnStart") tenEnv.OnStartDone() } diff --git a/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/ten_packages/extension/default_extension_python/extension.py b/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/ten_packages/extension/default_extension_python/extension.py index 90f73bc2d5..f6a3186c69 100644 --- a/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/ten_packages/extension/default_extension_python/extension.py +++ b/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/ten_packages/extension/default_extension_python/extension.py @@ -3,13 +3,7 @@ # See https://github.com/TEN-framework/ten_framework/LICENSE for license # information. # -from ten import ( - Extension, - TenEnv, - Cmd, - StatusCode, - CmdResult, -) +from ten import Extension, TenEnv, Cmd, StatusCode, CmdResult, TenEnvLogLevel class DefaultExtension(Extension): @@ -18,7 +12,9 @@ def __init__(self, name: str) -> None: self.name = name def on_init(self, ten_env: TenEnv) -> None: - print("DefaultExtension on_init, name", self.name) + ten_env.log( + TenEnvLogLevel.DEBUG, "DefaultExtension on_init, name", self.name + ) assert self.name == "default_extension_python" ten_env.init_property_from_json('{"testKey": "testValue"}') From a276d2a2d45d9f3afc85d2511a0afae364888650 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Mon, 16 Sep 2024 18:18:15 +0800 Subject: [PATCH 02/13] feat: refine more --- .vscode/launch.json | 2 +- .../ten_runtime/binding/cpp/internal/app.h | 4 +- .../binding/cpp/internal/extension.h | 4 +- .../binding/cpp/internal/extension_group.h | 2 +- .../binding/cpp/internal/msg/cmd/cmd.h | 2 +- .../binding/cpp/internal/msg/msg.h | 2 +- .../binding/cpp/internal/ten_env.h | 3 +- core/include/ten_utils/io/runloop.h | 2 +- core/include/ten_utils/lang/cpp/lib/value.h | 2 +- core/include/ten_utils/lib/mutex.h | 2 +- core/include/ten_utils/lib/ref.h | 4 +- core/include/ten_utils/lib/string.h | 4 +- core/include/ten_utils/lib/typed_list_node.h | 3 +- core/include/ten_utils/log/log.h | 1055 ----------------- core/include/ten_utils/macro/check.h | 64 - .../ten_runtime/binding/go/internal/common.h | 18 +- .../binding/go/ten_env/ten_env_internal.h | 24 +- .../include_internal/ten_runtime/common/log.h | 2 +- .../extension_thread/extension_thread.h | 4 +- .../ten_runtime/global/global.h | 0 .../ten_runtime/msg/cmd_base/cmd_result/cmd.h | 1 + core/include_internal/ten_runtime/msg/msg.h | 2 +- .../protocol/asynced/protocol_asynced.h | 2 +- .../ten_runtime/ten_env/log.h | 14 +- .../ten_runtime/ten_env/ten_env.h | 6 +- .../ten_utils/backtrace/backtrace.h | 0 .../ten_utils/backtrace/common.h | 5 +- .../backtrace/platform/posix/config.h | 4 +- .../platform/posix/darwin/config_mac.h | 2 +- .../backtrace/platform/posix/internal.h | 11 +- .../platform/posix/linux/config_linux.h | 0 .../backtrace/platform/posix/linux/crc32.h | 2 +- .../platform/posix/linux/debugfile.h | 2 +- .../backtrace/platform/posix/linux/elf.h | 2 - .../platform/posix/linux/uncompress.h | 0 .../backtrace/platform/posix/linux/view.h | 2 +- .../backtrace/platform/posix/linux/zlib.h | 0 .../transport/backend/uv/stream/migrate.h | 0 .../transport/backend/uv/stream/pipe.h | 0 .../general/transport/backend/uv/stream/tcp.h | 0 core/include_internal/ten_utils/log/buffer.h | 44 - core/include_internal/ten_utils/log/dump.h | 21 - core/include_internal/ten_utils/log/eol.h | 28 - core/include_internal/ten_utils/log/format.h | 464 -------- .../include_internal/ten_utils/log/internal.h | 24 - core/include_internal/ten_utils/log/level.h | 22 +- core/include_internal/ten_utils/log/log.h | 184 +++ core/include_internal/ten_utils/log/log_fmt.h | 33 - core/include_internal/ten_utils/log/new.h | 67 -- .../ten_utils/log/new_level.h | 12 - core/include_internal/ten_utils/log/new_pid.h | 12 - .../include_internal/ten_utils/log/new_time.h | 19 - .../ten_utils/log/new_time_cache.h | 30 - core/include_internal/ten_utils/log/output.h | 26 + .../ten_utils/log/platform/general/log.h | 34 - .../ten_utils/log/platform/mac/log.h | 40 - .../ten_utils/log/platform/win/log.h | 38 - core/include_internal/ten_utils/log/spec.h | 12 - core/include_internal/ten_utils/log/tag.h | 25 - core/include_internal/ten_utils/log/time.h | 8 +- .../ten_utils/log/time_cache.h | 16 +- core/include_internal/ten_utils/macro/check.h | 65 + .../ten_utils/schema/keywords/keywords_info.h | 6 +- core/src/ten_runtime/addon/addon.c | 3 +- core/src/ten_runtime/addon/addon_autoload.c | 12 +- core/src/ten_runtime/addon/common/store.c | 2 +- .../ten_runtime/addon/extension/extension.c | 4 +- .../addon/extension_group/extension_group.c | 4 +- .../src/ten_runtime/addon/protocol/protocol.c | 5 +- core/src/ten_runtime/addon/ten_env/on_xxx.c | 5 +- core/src/ten_runtime/app/app.c | 9 +- core/src/ten_runtime/app/base_dir.c | 2 +- core/src/ten_runtime/app/close.c | 5 +- core/src/ten_runtime/app/endpoint.c | 4 +- core/src/ten_runtime/app/engine_interface.c | 5 +- core/src/ten_runtime/app/internal.c | 4 +- core/src/ten_runtime/app/metadata.c | 16 +- core/src/ten_runtime/app/migration.c | 3 +- .../ten_runtime/app/msg_interface/common.c | 3 +- .../app/msg_interface/start_graph.c | 2 +- core/src/ten_runtime/app/predefined_graph.c | 2 +- core/src/ten_runtime/app/ten_env/metadata.c | 2 +- core/src/ten_runtime/app/ten_env/on_xxx.c | 4 +- core/src/ten_runtime/binding/common.c | 2 +- .../binding/go/interface/ten/ten_env.go | 2 +- .../binding/go/native/addon/addon.c | 2 +- .../binding/go/native/extension/extension.c | 2 +- .../native/extension_group/extension_group.c | 2 +- .../binding/go/native/internal/common.c | 2 +- .../binding/go/native/internal/json.c | 2 +- .../go/native/msg/audio_frame/audio_frame.c | 2 +- .../binding/go/native/msg/cmd/cmd.c | 2 +- .../binding/go/native/msg/data/data.c | 2 +- .../ten_runtime/binding/go/native/msg/msg.c | 2 +- .../go/native/msg/video_frame/video_frame.c | 5 +- .../binding/go/native/ten_env/ten_env.c | 2 +- .../ten_env/ten_env_addon_create_extension.c | 3 +- .../ten_env/ten_env_addon_destroy_extension.c | 3 +- .../ten_env/ten_env_create_instance_done.c | 2 +- .../go/native/ten_env/ten_env_get_property.c | 2 +- .../ten_env/ten_env_get_property_async.c | 3 +- .../go/native/ten_env/ten_env_init_property.c | 2 +- .../go/native/ten_env/ten_env_internal.c | 2 +- .../native/ten_env/ten_env_is_cmd_connected.c | 2 +- .../binding/go/native/ten_env/ten_env_log.c | 2 +- .../ten_env_on_create_extension_done.c | 2 +- .../native/ten_env/ten_env_on_deinit_done.c | 2 +- .../ten_env_on_delete_extension_done.c | 3 +- .../go/native/ten_env/ten_env_on_init_done.c | 2 +- .../go/native/ten_env/ten_env_on_start_done.c | 3 +- .../go/native/ten_env/ten_env_on_stop_done.c | 3 +- .../go/native/ten_env/ten_env_return_result.c | 2 +- .../go/native/ten_env/ten_env_return_value.c | 2 +- .../native/ten_env/ten_env_send_audio_frame.c | 3 +- .../go/native/ten_env/ten_env_send_cmd.c | 3 +- .../go/native/ten_env/ten_env_send_data.c | 3 +- .../go/native/ten_env/ten_env_send_json.c | 3 +- .../native/ten_env/ten_env_send_video_frame.c | 3 +- .../go/native/ten_env/ten_env_set_property.c | 2 +- .../ten_env/ten_env_set_property_async.c | 3 +- .../binding/go/native/value/value.c | 2 +- .../interface/ten/libten_runtime_python.pyi | 16 +- .../binding/python/interface/ten/ten_env.py | 48 +- .../binding/python/native/app/app.c | 2 +- .../binding/python/native/common/common.c | 2 +- .../binding/python/native/common/error.c | 2 +- .../binding/python/native/msg/audio_frame.c | 2 +- .../binding/python/native/msg/data.c | 2 +- .../binding/python/native/msg/video_frame.c | 2 +- .../binding/python/native/ten_env/ten_env.c | 2 +- .../native/ten_env/ten_env_get_property.c | 2 +- .../python/native/ten_env/ten_env_log.c | 6 +- .../native/ten_env/ten_env_on_init_done.c | 2 +- .../python/native/ten_env/ten_env_send_cmd.c | 2 +- core/src/ten_runtime/common/binding.c | 2 +- core/src/ten_runtime/common/closeable.c | 3 +- core/src/ten_runtime/common/loc.c | 2 +- core/src/ten_runtime/connection/connection.c | 5 +- core/src/ten_runtime/connection/migration.c | 2 +- core/src/ten_runtime/engine/engine.c | 4 +- core/src/ten_runtime/engine/internal/close.c | 6 +- .../engine/internal/extension_interface.c | 4 +- .../ten_runtime/engine/internal/migration.c | 3 +- .../engine/internal/remote_interface.c | 5 +- core/src/ten_runtime/engine/internal/thread.c | 5 +- .../engine/msg_interface/close_app.c | 3 +- .../engine/msg_interface/close_engine.c | 3 +- .../engine/msg_interface/cmd_result.c | 4 +- .../ten_runtime/engine/msg_interface/common.c | 2 +- .../engine/msg_interface/start_graph.c | 4 +- .../ten_runtime/engine/msg_interface/timer.c | 4 +- core/src/ten_runtime/engine/on_xxx.c | 12 +- core/src/ten_runtime/extension/extension.c | 4 +- .../src/ten_runtime/extension/extension_hdr.c | 2 +- .../extension/extension_info/extension_info.c | 2 +- .../extension/extension_info/json.c | 2 +- .../extension/extension_info/value.c | 2 +- .../extension/internal/extension_cb_default.c | 2 +- .../ten_runtime/extension/internal/metadata.c | 2 +- .../msg_dest_info/all_msg_type_dest_info.c | 2 +- .../extension/msg_dest_info/json.c | 2 +- .../extension/msg_dest_info/msg_dest_info.c | 2 +- .../extension/msg_dest_info/value.c | 2 +- core/src/ten_runtime/extension/msg_handling.c | 4 +- .../ten_runtime/extension/ten_env/metadata.c | 2 +- .../ten_runtime/extension/ten_env/on_xxx.c | 4 +- ...n_extension_addon_and_instance_name_pair.c | 2 +- .../extension_context/extension_context.c | 4 +- .../internal/add_extension.c | 3 +- .../internal/del_extension.c | 4 +- .../internal/extension_group_is_inited.c | 12 +- .../internal/extension_group_is_stopped.c | 4 +- .../internal/extension_thread_is_closing.c | 4 +- .../extension_context/ten_env/on_xxx.c | 3 +- .../extension_group/extension_group.c | 4 +- .../extension_group_info.c | 2 +- .../extension_group_info/json.c | 2 +- .../extension_group_info/value.c | 2 +- .../extension_group/internal/metadata.c | 4 +- .../extension_group/ten_env/metadata.c | 2 +- .../extension_group/ten_env/on_xxx.c | 5 +- .../extension_store/extension_store.c | 5 +- .../extension_thread/extension_thread.c | 11 +- .../extension_thread/msg_interface/common.c | 5 +- .../src/ten_runtime/extension_thread/on_xxx.c | 8 +- core/src/ten_runtime/global/global.c | 2 +- core/src/ten_runtime/global/on_load.c | 11 +- core/src/ten_runtime/global/signal.c | 9 +- .../ten_runtime/metadata/default/default.c | 1 + core/src/ten_runtime/metadata/metadata.c | 2 +- core/src/ten_runtime/metadata/metadata_info.c | 4 +- .../msg/audio_frame/field/bytes_per_sample.c | 3 +- .../msg/audio_frame/field/channel_layout.c | 3 +- .../msg/audio_frame/field/data_fmt.c | 3 +- .../msg/audio_frame/field/line_size.c | 3 +- .../msg/audio_frame/field/number_of_channel.c | 3 +- .../msg/audio_frame/field/sample_rate.c | 3 +- .../audio_frame/field/samples_per_channel.c | 3 +- .../msg/audio_frame/field/timestamp.c | 3 +- .../ten_runtime/msg/audio_frame/pcm_frame.c | 2 +- .../msg/cmd_base/cmd/close_app/cmd.c | 2 +- core/src/ten_runtime/msg/cmd_base/cmd/cmd.c | 2 +- .../ten_runtime/msg/cmd_base/cmd/custom/cmd.c | 3 +- .../msg/cmd_base/cmd/start_graph/cmd.c | 3 +- .../cmd/start_graph/field/extension_info.c | 5 +- .../cmd/start_graph/field/long_running_mode.c | 6 +- .../start_graph/field/predefined_graph_name.c | 5 +- .../msg/cmd_base/cmd/stop_graph/cmd.c | 2 +- .../cmd/stop_graph/field/graph_name.c | 5 +- .../msg/cmd_base/cmd/timeout/cmd.c | 2 +- .../msg/cmd_base/cmd/timeout/field/timer_id.c | 5 +- .../ten_runtime/msg/cmd_base/cmd/timer/cmd.c | 2 +- .../cmd_base/cmd/timer/field/timeout_in_us.c | 5 +- .../msg/cmd_base/cmd/timer/field/timer_id.c | 6 +- .../msg/cmd_base/cmd/timer/field/times.c | 6 +- core/src/ten_runtime/msg/cmd_base/cmd_base.c | 2 +- .../ten_runtime/msg/cmd_base/cmd_result/cmd.c | 2 +- .../cmd_result/field/original_cmd_type.c | 5 +- .../cmd_base/cmd_result/field/status_code.c | 5 +- .../ten_runtime/msg/cmd_base/field/cmd_id.c | 5 +- .../msg/cmd_base/field/original_connection.c | 5 +- .../msg/cmd_base/field/response_handler.c | 6 +- .../cmd_base/field/response_handler_data.c | 6 +- .../ten_runtime/msg/cmd_base/field/seq_id.c | 5 +- core/src/ten_runtime/msg/data/data.c | 3 +- core/src/ten_runtime/msg/field/dest.c | 3 +- core/src/ten_runtime/msg/field/name.c | 5 +- core/src/ten_runtime/msg/field/properties.c | 3 +- core/src/ten_runtime/msg/field/src.c | 3 +- core/src/ten_runtime/msg/field/type.c | 3 +- core/src/ten_runtime/msg/locked_res.c | 2 +- core/src/ten_runtime/msg/msg.c | 4 +- .../msg/video_frame/field/height.c | 3 +- .../msg/video_frame/field/pixel_fmt.c | 3 +- .../msg/video_frame/field/timestamp.c | 3 +- .../ten_runtime/msg/video_frame/field/width.c | 3 +- .../ten_runtime/msg/video_frame/video_frame.c | 2 +- .../msg_and_result_conversion.c | 2 +- .../msg_and_result_conversion_operation.c | 2 +- .../msg_conversion/msg_conversion.c | 2 +- .../msg_conversion_operation/base.c | 2 +- .../per_property/fixed_value.c | 2 +- .../per_property/from_original.c | 2 +- .../per_property/per_property.c | 2 +- .../per_property/rule.c | 2 +- .../per_property/rules.c | 2 +- core/src/ten_runtime/path/path.c | 2 +- core/src/ten_runtime/path/path_group.c | 3 +- core/src/ten_runtime/path/path_in.c | 2 +- core/src/ten_runtime/path/path_out.c | 2 +- core/src/ten_runtime/path/path_table.c | 2 +- .../ten_runtime/protocol/asynced/external.c | 2 +- .../ten_runtime/protocol/asynced/internal.c | 2 +- .../protocol/asynced/protocol_asynced.c | 5 +- core/src/ten_runtime/protocol/close.c | 4 +- core/src/ten_runtime/protocol/context.c | 4 +- core/src/ten_runtime/protocol/context_store.c | 2 +- .../ten_runtime/protocol/integrated/close.c | 4 +- .../protocol/integrated/protocol_integrated.c | 4 +- core/src/ten_runtime/protocol/protocol.c | 5 +- core/src/ten_runtime/remote/remote.c | 5 +- core/src/ten_runtime/schema_store/interface.c | 2 +- .../ten_runtime/schema_store/interface_info.c | 4 +- core/src/ten_runtime/schema_store/property.c | 2 +- core/src/ten_runtime/schema_store/store.c | 4 +- .../ten_env/internal/get_property.c | 3 +- .../ten_env/internal/is_cmd_connected.c | 3 +- core/src/ten_runtime/ten_env/internal/log.c | 23 +- .../ten_runtime/ten_env/internal/metadata.c | 2 +- .../ten_env/internal/on_xxx_done.c | 3 +- .../src/ten_runtime/ten_env/internal/return.c | 2 +- core/src/ten_runtime/ten_env/internal/send.c | 4 +- .../ten_env/internal/set_property.c | 4 +- core/src/ten_runtime/ten_env/ten_env.c | 7 +- core/src/ten_runtime/ten_env/ten_proxy.c | 2 +- .../internal/acquire_lock_mode.c | 2 +- .../ten_env_proxy/internal/notify.c | 2 +- .../internal/release_lock_mode.c | 2 +- .../ten_runtime/ten_env_proxy/ten_env_proxy.c | 3 +- core/src/ten_runtime/timer/timer.c | 4 +- core/src/ten_rust/src/json_schema/mod.rs | 2 +- core/src/ten_utils/backtrace/common.c | 27 +- .../backtrace/platform/posix/backtrace.c | 7 +- .../platform/posix/darwin/backtrace.c | 6 +- .../backtrace/platform/posix/darwin/macho.c | 10 +- .../backtrace/platform/posix/dwarf.c | 5 +- .../backtrace/platform/posix/fileline.c | 15 +- .../platform/posix/linux/backtrace.c | 6 +- .../backtrace/platform/posix/linux/crc32.c | 2 +- .../platform/posix/linux/debugfile.c | 6 +- .../backtrace/platform/posix/linux/elf.c | 62 +- .../platform/posix/linux/uncompress.c | 2 +- .../backtrace/platform/posix/linux/view.c | 5 +- .../backtrace/platform/posix/linux/zlib.c | 10 +- .../ten_utils/backtrace/platform/posix/sort.c | 5 +- .../backtrace/platform/win/internal.c | 6 +- core/src/ten_utils/container/list.c | 2 +- core/src/ten_utils/container/list_int32.c | 2 +- core/src/ten_utils/container/list_node.c | 2 +- .../src/ten_utils/container/list_node_int32.c | 2 +- core/src/ten_utils/container/list_node_ptr.c | 2 +- .../ten_utils/container/list_node_smart_ptr.c | 2 +- core/src/ten_utils/container/list_node_str.c | 2 +- core/src/ten_utils/container/list_ptr.c | 2 +- core/src/ten_utils/container/list_smart_ptr.c | 2 +- core/src/ten_utils/container/list_str.c | 2 +- core/src/ten_utils/container/vector.c | 2 +- .../ten_utils/io/general/loops/bare/runloop.c | 10 +- core/src/ten_utils/io/general/loops/runloop.c | 4 +- .../ten_utils/io/general/loops/uv/runloop.c | 12 +- core/src/ten_utils/io/general/shmchannel.c | 5 +- core/src/ten_utils/io/general/socket.c | 12 +- .../transport/backend/general/transport/raw.c | 1 + .../transport/backend/uv/stream/migrate.c | 8 +- .../transport/backend/uv/stream/pipe.c | 6 +- .../general/transport/backend/uv/stream/tcp.c | 2 +- .../transport/backend/uv/transport/pipe.c | 2 +- .../transport/backend/uv/transport/tcp.c | 2 +- .../ten_utils/io/general/transport/stream.c | 2 +- .../io/general/transport/transport.c | 2 +- core/src/ten_utils/io/posix/mmap.c | 2 +- core/src/ten_utils/io/posix/socket.c | 4 +- core/src/ten_utils/lib/sys/general/alloc.c | 2 +- core/src/ten_utils/lib/sys/general/buf.c | 2 +- core/src/ten_utils/lib/sys/general/error.c | 2 +- core/src/ten_utils/lib/sys/general/file.c | 4 +- core/src/ten_utils/lib/sys/general/json.c | 2 +- core/src/ten_utils/lib/sys/general/path.c | 6 +- .../ten_utils/lib/sys/general/placeholder.c | 2 +- core/src/ten_utils/lib/sys/general/ref.c | 4 +- .../src/ten_utils/lib/sys/general/signature.c | 2 +- core/src/ten_utils/lib/sys/general/sm.c | 10 +- .../src/ten_utils/lib/sys/general/smart_ptr.c | 2 +- core/src/ten_utils/lib/sys/general/string.c | 2 +- core/src/ten_utils/lib/sys/general/thread.c | 22 +- core/src/ten_utils/lib/sys/general/uuid.c | 2 +- core/src/ten_utils/lib/sys/posix/cond.c | 2 +- .../ten_utils/lib/sys/posix/darwin/pc/path.c | 2 +- core/src/ten_utils/lib/sys/posix/event.c | 2 +- core/src/ten_utils/lib/sys/posix/file_lock.c | 2 +- .../ten_utils/lib/sys/posix/linux/pc/module.c | 2 +- core/src/ten_utils/lib/sys/posix/linux/uuid.c | 2 +- core/src/ten_utils/lib/sys/posix/path.c | 6 +- .../ten_utils/lib/sys/posix/process_mutex.c | 2 +- core/src/ten_utils/lib/sys/posix/thread.c | 2 +- .../ten_utils/lib/sys/posix/thread_local.c | 2 +- .../src/ten_utils/lib/sys/posix/thread_once.c | 4 +- core/src/ten_utils/lib/sys/win/atomic.c | 2 +- core/src/ten_utils/lib/sys/win/cond.c | 2 +- core/src/ten_utils/lib/sys/win/path.c | 2 +- core/src/ten_utils/lib/sys/win/thread.c | 2 +- core/src/ten_utils/lib/sys/win/uuid.c | 2 +- core/src/ten_utils/log/BUILD.gn | 1 - core/src/ten_utils/log/buffer.c | 19 - core/src/ten_utils/log/close.c | 40 - core/src/ten_utils/log/dump.c | 364 ------ core/src/ten_utils/log/global.c | 29 + core/src/ten_utils/log/global_var.c | 54 - core/src/ten_utils/log/level.c | 18 +- core/src/ten_utils/log/log.c | 200 +++- core/src/ten_utils/log/mem.c | 72 -- core/src/ten_utils/log/new.c | 182 --- core/src/ten_utils/log/new_level.c | 29 - core/src/ten_utils/log/new_pid.c | 60 - core/src/ten_utils/log/new_time.c | 77 -- core/src/ten_utils/log/new_time_cache.c | 91 -- core/src/ten_utils/log/normal.c | 67 -- core/src/ten_utils/log/output.c | 130 +- core/src/ten_utils/log/pid.c | 56 +- core/src/ten_utils/log/platform/BUILD.gn | 14 - .../ten_utils/log/platform/general/BUILD.gn | 9 - core/src/ten_utils/log/platform/general/log.c | 72 -- core/src/ten_utils/log/platform/log.c | 23 - core/src/ten_utils/log/platform/mac/BUILD.gn | 9 - core/src/ten_utils/log/platform/mac/log.c | 52 - core/src/ten_utils/log/platform/win/BUILD.gn | 9 - core/src/ten_utils/log/platform/win/log.c | 28 - core/src/ten_utils/log/spec.c | 12 - core/src/ten_utils/log/time.c | 62 +- core/src/ten_utils/log/time_cache.c | 44 +- core/src/ten_utils/sanitizer/memory_check.c | 22 +- core/src/ten_utils/sanitizer/thread_check.c | 4 +- .../ten_utils/schema/bindings/rust/schema.c | 2 +- core/src/ten_utils/schema/keywords/keyword.c | 2 +- .../ten_utils/schema/keywords/keyword_items.c | 2 +- .../schema/keywords/keyword_properties.c | 2 +- .../schema/keywords/keyword_required.c | 2 +- .../ten_utils/schema/keywords/keyword_type.c | 2 +- core/src/ten_utils/schema/schema.c | 2 +- .../src/ten_utils/schema/types/schema_array.c | 2 +- .../ten_utils/schema/types/schema_object.c | 2 +- .../ten_utils/schema/types/schema_primitive.c | 2 +- core/src/ten_utils/value/type.c | 2 +- core/src/ten_utils/value/value.c | 3 +- core/src/ten_utils/value/value_convert.c | 2 +- core/src/ten_utils/value/value_get.c | 2 +- core/src/ten_utils/value/value_is.c | 2 +- core/src/ten_utils/value/value_json.c | 2 +- core/src/ten_utils/value/value_kv.c | 2 +- core/src/ten_utils/value/value_path.c | 3 +- core/src/ten_utils/value/value_smart_ptr.c | 2 +- core/src/ten_utils/value/value_string.c | 2 +- .../src/default_extension_group.c | 5 +- .../py_init_extension_cpp/src/main.cc | 4 +- .../core_protocols/msgpack/common/parser.c | 3 +- .../core_protocols/msgpack/common/value.c | 2 +- .../msgpack/msg/cmd/custom/cmd.c | 2 +- .../msgpack/msg/cmd/field/cmd_id.c | 2 +- .../msgpack/msg/cmd/field/seq_id.c | 2 +- .../msgpack/msg/data/field/buf.c | 2 +- .../core_protocols/msgpack/msg/field/dest.c | 4 +- .../core_protocols/msgpack/msg/field/name.c | 2 +- .../msgpack/msg/field/properties.c | 2 +- .../core_protocols/msgpack/msg/field/src.c | 2 +- .../core_protocols/msgpack/msg/field/type.c | 2 +- packages/core_protocols/msgpack/msg/loc.c | 2 +- packages/core_protocols/msgpack/msg/msg.c | 2 +- packages/core_protocols/msgpack/protocol.c | 3 +- .../ffmpeg_demuxer/src/demuxer.cc | 6 +- .../ffmpeg_demuxer/src/demuxer_thread.cc | 4 +- .../ffmpeg_muxer/src/muxer.cc | 4 +- .../ffmpeg_muxer/src/muxer_thread.cc | 2 +- tests/common/client/cpp/msgpack_tcp.h | 1 + tests/common/client/curl_connect.c | 2 +- tests/common/client/http.c | 2 +- tests/common/client/msgpack_tcp.c | 2 +- tests/common/client/tcp.c | 2 +- .../ffmpeg_basic_app_source/property.json | 2 +- .../default_extension_cpp/src/main.cc | 2 +- .../ffmpeg_bypass_app_source/property.json | 2 +- .../default_extension_cpp/src/main.cc | 2 +- .../access_property_go_app/property.json | 2 +- .../default_extension_go/default_extension.go | 2 +- .../go/access_property_go/client/client.cc | 2 +- .../go/close_app_go/client/client.cc | 2 +- .../close_app_go_app/property.json | 2 +- .../go/expired_ten_go/client/client.cc | 2 +- .../expired_ten_go_app/property.json | 2 +- .../frequently_cgo_call_go/client/client.cc | 2 +- .../frequently_cgo_call_go_app/property.json | 2 +- .../go/handle_error_go/client/client.cc | 2 +- .../handle_error_go_app/property.json | 2 +- .../go/prepare_to_stop_go/client/client.cc | 2 +- .../prepare_to_stop_go_app/property.json | 2 +- .../go/return_result_go/client/client.cc | 2 +- .../return_result_go_app/property.json | 2 +- .../go/return_value_go/client/client.cc | 2 +- .../return_value_go_app/property.json | 2 +- .../go/send_json_go/client/client.cc | 2 +- .../send_json_go_app/property.json | 2 +- .../go/start_app_sync_go/client/client.cc | 2 +- .../start_app_sync_go_app/property.json | 2 +- .../three_extension_cmd_go/client/client.cc | 2 +- .../three_extension_cmd_go_app/property.json | 2 +- .../go/transfer_pointer_go/client/client.cc | 2 +- .../transfer_pointer_go_app/property.json | 2 +- .../client/client.cc | 2 +- .../property.json | 2 +- .../aio_http_server_python_app/property.json | 2 +- .../async_io_basic_python_app/property.json | 2 +- .../property.json | 2 +- .../cpp_app_python_app_source/property.json | 2 +- .../go_app_cythonize_app/property.json | 2 +- .../property.json | 2 +- .../go_app_python_app/property.json | 2 +- .../multi_process_python_app/property.json | 2 +- .../multiple_results_python_app/property.json | 2 +- .../property.json | 2 +- .../property.json | 2 +- .../send_cmd_python_app/property.json | 2 +- .../default_extension_python/extension.py | 4 +- .../send_data_python_app/property.json | 2 +- .../send_json_python_app/property.json | 2 +- .../send_recv_image_python_app/property.json | 2 +- .../send_recv_pcm_python_app/property.json | 2 +- .../unused_addon_python_app/property.json | 2 +- .../smoke/audio_frame_test/basic.cc | 2 +- .../audio_frame_test/create_from_json.cc | 2 +- .../smoke/audio_frame_test/from_json.cc | 2 +- .../audio_frame_test/multi_dest_pcm_frame.cc | 4 +- .../cmd_conversion_connect_cmd.cc | 2 +- .../cmd_conversion/cmd_conversion_data.cc | 2 +- .../cmd_conversion/cmd_conversion_graph.cc | 2 +- .../cmd_conversion_graph_default_uri.cc | 2 +- .../cmd_conversion/cmd_conversion_path.cc | 2 +- .../cmd_conversion_path_array_1.cc | 2 +- .../cmd_conversion_path_array_2.cc | 2 +- .../cmd_conversion_path_array_3.cc | 2 +- .../cmd_conversion_path_array_4.cc | 2 +- .../cmd_conversion_path_array_5.cc | 2 +- .../cmd_conversion_path_array_6.cc | 2 +- .../cmd_conversion_path_array_7.cc | 2 +- .../cmd_conversion_path_keep_original.cc | 2 +- .../cmd_conversion_path_nested_1.cc | 2 +- .../cmd_conversion_path_nested_2.cc | 2 +- .../cmd_conversion_path_nested_3.cc | 2 +- .../cmd_conversion_path_nested_4.cc | 2 +- .../cmd_conversion_path_nested_5.cc | 2 +- .../smoke/cmd_result_test/multiple_result.cc | 2 +- tests/ten_runtime/smoke/data_test/basic.cc | 2 +- tests/ten_runtime/smoke/data_test/basic_2.cc | 2 +- .../smoke/data_test/create_from_json.cc | 2 +- .../ten_runtime/smoke/data_test/from_json.cc | 2 +- .../smoke/data_test/multi_dest_data.cc | 4 +- .../basic/basic_extensions_init_dependency.cc | 2 +- .../basic/basic_hello_world_1.cc | 2 +- .../basic/basic_hello_world_2.cc | 2 +- .../smoke/extension_test/basic/basic_loop.cc | 2 +- .../extension_test/basic/basic_loop_cmd.cc | 2 +- .../basic/basic_loop_cmd_snap_shot.cc | 2 +- .../basic/basic_msg_property_to_prop_store.cc | 4 +- .../extension_test/basic/basic_multi_app.cc | 4 +- .../basic_multi_app_close_through_engine.cc | 4 +- .../basic/basic_multi_extension.cc | 2 +- .../basic/basic_multi_extension_group.cc | 2 +- .../basic/basic_no_init_extension_group.cc | 2 +- .../basic_throw_exception_in_extension.cc | 6 +- .../basic/basic_two_extensions.cc | 2 +- .../basic/basic_two_standalone_extension_1.cc | 2 +- .../basic/basic_two_standalone_extension_2.cc | 2 +- .../command/command_check_cmd_out.cc | 2 +- .../command/command_invalid_extension.cc | 2 +- .../command/command_invalid_extension_2.cc | 2 +- .../command_invalid_extension_group.cc | 2 +- .../command/command_send_enum.cc | 4 +- .../command/command_send_ptr.cc | 2 +- .../command/command_send_ptr_through_cmd.cc | 2 +- .../command/command_stop_graph_actively.cc | 6 +- ...command_stop_graph_actively_through_cmd.cc | 6 +- ...nd_stop_graph_actively_through_cmd_dest.cc | 6 +- .../concurrent/multi_app_concurrent.cc | 4 +- .../concurrent/multi_app_sequential.cc | 4 +- .../concurrent/one_engine_concurrent.cc | 4 +- .../smoke/extension_test/dest/specify_dest.cc | 2 +- .../engine/batch_send_msgs_in_migration.cc | 2 +- .../engine/engine_long_running_mode.cc | 4 +- .../engine/engine_one_loop_per_engine.cc | 2 +- .../extension_send_msg_to_incorrect_engine.cc | 2 +- .../wrong_engine_then_correct_in_migration.cc | 2 +- .../extension_test/error/failed_to_listen.cc | 2 +- .../error/invalid_extension_group.cc | 2 +- .../extension/extension_reg_extension.cc | 2 +- ...xtension_reg_extension_and_create_group.cc | 2 +- .../extension_reg_extension_group.cc | 2 +- .../extension/extension_with_same_name.cc | 2 +- .../extension_group_with_same_name.cc | 2 +- ...sion_group_with_same_name_and_topo_info.cc | 2 +- .../graph/graph_lack_something_1.cc | 2 +- .../graph/graph_lack_something_2.cc | 2 +- .../graph/graph_lack_something_3.cc | 2 +- .../graph/graph_loop_in_multi_app.cc | 6 +- .../graph/graph_loop_in_one_app.cc | 2 +- .../graph/graph_loop_multiple_circle.cc | 2 +- .../graph_loop_multiple_circle_through_cmd.cc | 2 +- ...ultiple_circle_through_cmd_with_default.cc | 2 +- .../graph/graph_multiple_polygon.cc | 6 +- .../graph/graph_multiple_polygon_one_app.cc | 2 +- .../graph/graph_out_of_order_1.cc | 2 +- .../graph/graph_out_of_order_2.cc | 2 +- .../graph_polygon_in_one_app_return_all.cc | 2 +- .../graph/graph_y_shape_in_multi_app.cc | 6 +- .../graph/graph_y_shape_in_one_app.cc | 2 +- .../graph_name/graph_name_basic.cc | 6 +- .../http_server_extension_close_app.cc | 2 +- .../http_server_extension_two_extensions.cc | 2 +- .../smoke/extension_test/lock/lock_data_1.cc | 4 +- .../msg_property_send_c_string.cc | 2 +- .../msg_property/msg_property_send_cpp_ptr.cc | 2 +- .../msg_property_send_cpp_string.cc | 2 +- .../msg_property_send_float_ptr.cc | 2 +- .../msg_property/msg_property_send_int.cc | 2 +- .../msg_property_send_int32_ptr.cc | 2 +- .../multi_dest/multi_dest_basic.cc | 2 +- .../multi_dest/multi_dest_in_one_app.cc | 2 +- .../multi_dest/multi_dest_resp_when_all.cc | 2 +- .../multi_dest_resp_when_all_in_multi_app.cc | 6 +- .../multi_dest_send_in_stop_period.cc | 2 +- .../multi_dest/multi_dest_y_topo.cc | 2 +- .../128_threads_attempt_to_suspend_1.cc | 16 +- .../16_threads_attempt_to_suspend_1.cc | 4 +- .../2_threads_attempt_to_suspend_1.cc | 4 +- .../2_threads_attempt_to_suspend_2.cc | 4 +- .../2_threads_attempt_to_suspend_3.cc | 4 +- .../2_threads_attempt_to_suspend_4.cc | 4 +- .../2_threads_attempt_to_suspend_5.cc | 4 +- .../2_threads_attempt_to_suspend_6.cc | 4 +- .../2_threads_attempt_to_suspend_7.cc | 4 +- .../32_threads_attempt_to_suspend_1.cc | 4 +- .../32_threads_attempt_to_suspend_2.cc | 4 +- .../32_threads_attempt_to_suspend_3.cc | 4 +- .../32_threads_attempt_to_suspend_4.cc | 4 +- .../32_threads_attempt_to_suspend_5.cc | 4 +- .../32_threads_attempt_to_suspend_6.cc | 4 +- .../outer_thread/auto_free_out_of_scope.cc | 4 +- .../outer_thread/outer_thread_send_data.cc | 4 +- .../outer_thread_send_data_resp_handler.cc | 4 +- .../extension_test/path/clean_when_stopped.cc | 2 +- .../smoke/extension_test/path/path_timeout.cc | 2 +- .../extension_test/path/path_timeout_2.cc | 2 +- .../predefined_graph_basic_1.cc | 2 +- .../predefined_graph_basic_2.cc | 2 +- .../predefined_graph_multi_app.cc | 2 +- .../predefined_graph_multi_extension_1.cc | 2 +- .../predefined_graph_multi_extension_2.cc | 2 +- .../predefined_graph_multi_extension_3.cc | 2 +- .../predefined_graph_multi_extension_4.cc | 2 +- .../predefined_graph_no_auto_start.cc | 2 +- ...fined_graph_two_standalone_extensions_1.cc | 2 +- ...fined_graph_two_standalone_extensions_2.cc | 2 +- .../prepare_to_stop/different_thread.cc | 2 +- .../prepare_to_stop/same_thread.cc | 2 +- .../property/property_access_app_store.cc | 4 +- .../property_access_app_store_async.cc | 2 +- .../property/property_in_graph_use_env_1.cc | 2 +- .../property/property_in_graph_use_env_2.cc | 2 +- .../property/property_not_exist.cc | 2 +- .../property/property_prebuilt_graph.cc | 2 +- .../resp_handler/resp_handler_async_basic.cc | 2 +- .../resp_handler/resp_handler_basic.cc | 2 +- .../resp_handler_basic_wait_in_on_start.cc | 2 +- .../smoke/extension_test/return/return_1.cc | 2 +- .../smoke/extension_test/return/return_2.cc | 2 +- .../smoke/extension_test/return/return_3.cc | 2 +- .../smoke/extension_test/return/return_4.cc | 2 +- .../same_thread_ext_on_data.cc | 2 +- .../same_thread_ext_on_xxx_basic.cc | 2 +- .../start_graph_and_communicate.cc | 2 +- .../start_graph/start_graph_from_extension.cc | 2 +- .../suspend_resume/suspend_resume_1.cc | 4 +- .../suspend_resume/suspend_resume_2.cc | 4 +- .../extension_test/ten_proxy/ten_proxy_1.cc | 2 +- .../extension_test/timer/timer_one_shot.cc | 2 +- .../extension_test/timer/timer_ten_shot.cc | 2 +- .../extension_test/timer/timer_two_shot.cc | 2 +- .../smoke/graph_test/group_node_missing.cc | 2 +- .../graph_test/group_node_missing_2_apps.cc | 4 +- .../interface_out_cmd_in_schema.cc | 2 +- .../interface_out_cmd_not_in_schema.cc | 2 +- .../interface_out_result_error.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_1.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_10.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_11.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_12.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_13.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_2.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_3.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_4.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_5.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_6.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_7.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_8.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_9.cc | 2 +- .../ten_runtime/smoke/msg_test/msg_fail_1.cc | 2 +- .../ten_runtime/smoke/msg_test/msg_fail_2.cc | 2 +- .../notify_test/member_func_in_lambda_1.cc | 2 +- .../notify_test/member_func_in_lambda_2.cc | 2 +- .../notify_test/member_func_in_lambda_3.cc | 2 +- .../smoke/notify_test/normal_func.cc | 2 +- .../notify_test/normal_func_in_lambda.cc | 2 +- .../notify_test/normal_func_with_user_data.cc | 2 +- .../result_conversion/result_conversion_1.cc | 2 +- .../schema_cmd_property_required.cc | 2 +- .../smoke/schema_test/schema_cmd_result.cc | 2 +- .../schema_test/schema_cmd_result_error.cc | 2 +- .../smoke/schema_test/schema_data_prop.cc | 2 +- .../smoke/schema_test/schema_on_cmd.cc | 2 +- .../smoke/schema_test/schema_send_cmd.cc | 2 +- .../schema_set_extension_property.cc | 2 +- .../schema_test/schema_set_property_buf.cc | 2 +- .../schema_test/schema_set_property_ptr.cc | 2 +- .../smoke/video_frame_test/basic.cc | 2 +- .../video_frame_test/create_from_json.cc | 2 +- .../smoke/video_frame_test/from_json.cc | 2 +- .../multi_dest_video_frame.cc | 4 +- tests/ten_utils/unit/ten_log_test.cc | 31 +- 675 files changed, 1712 insertions(+), 4559 deletions(-) delete mode 100644 core/include/ten_utils/log/log.h delete mode 100644 core/include/ten_utils/macro/check.h rename core/{src => include_internal}/ten_runtime/global/global.h (100%) rename core/{include => include_internal}/ten_utils/backtrace/backtrace.h (100%) rename core/{src => include_internal}/ten_utils/backtrace/common.h (90%) rename core/{src => include_internal}/ten_utils/backtrace/platform/posix/config.h (62%) rename core/{src => include_internal}/ten_utils/backtrace/platform/posix/darwin/config_mac.h (94%) rename core/{src => include_internal}/ten_utils/backtrace/platform/posix/internal.h (94%) rename core/{src => include_internal}/ten_utils/backtrace/platform/posix/linux/config_linux.h (100%) rename core/{src => include_internal}/ten_utils/backtrace/platform/posix/linux/crc32.h (90%) rename core/{src => include_internal}/ten_utils/backtrace/platform/posix/linux/debugfile.h (91%) rename core/{src => include_internal}/ten_utils/backtrace/platform/posix/linux/elf.h (91%) rename core/{src => include_internal}/ten_utils/backtrace/platform/posix/linux/uncompress.h (100%) rename core/{src => include_internal}/ten_utils/backtrace/platform/posix/linux/view.h (95%) rename core/{src => include_internal}/ten_utils/backtrace/platform/posix/linux/zlib.h (100%) rename core/{src => include_internal}/ten_utils/io/general/transport/backend/uv/stream/migrate.h (100%) rename core/{src => include_internal}/ten_utils/io/general/transport/backend/uv/stream/pipe.h (100%) rename core/{src => include_internal}/ten_utils/io/general/transport/backend/uv/stream/tcp.h (100%) delete mode 100644 core/include_internal/ten_utils/log/buffer.h delete mode 100644 core/include_internal/ten_utils/log/dump.h delete mode 100644 core/include_internal/ten_utils/log/eol.h delete mode 100644 core/include_internal/ten_utils/log/format.h delete mode 100644 core/include_internal/ten_utils/log/internal.h create mode 100644 core/include_internal/ten_utils/log/log.h delete mode 100644 core/include_internal/ten_utils/log/log_fmt.h delete mode 100644 core/include_internal/ten_utils/log/new.h delete mode 100644 core/include_internal/ten_utils/log/new_level.h delete mode 100644 core/include_internal/ten_utils/log/new_pid.h delete mode 100644 core/include_internal/ten_utils/log/new_time.h delete mode 100644 core/include_internal/ten_utils/log/new_time_cache.h create mode 100644 core/include_internal/ten_utils/log/output.h delete mode 100644 core/include_internal/ten_utils/log/platform/general/log.h delete mode 100644 core/include_internal/ten_utils/log/platform/mac/log.h delete mode 100644 core/include_internal/ten_utils/log/platform/win/log.h delete mode 100644 core/include_internal/ten_utils/log/spec.h delete mode 100644 core/include_internal/ten_utils/log/tag.h create mode 100644 core/include_internal/ten_utils/macro/check.h delete mode 100644 core/src/ten_utils/log/buffer.c delete mode 100644 core/src/ten_utils/log/close.c delete mode 100644 core/src/ten_utils/log/dump.c create mode 100644 core/src/ten_utils/log/global.c delete mode 100644 core/src/ten_utils/log/global_var.c delete mode 100644 core/src/ten_utils/log/mem.c delete mode 100644 core/src/ten_utils/log/new.c delete mode 100644 core/src/ten_utils/log/new_level.c delete mode 100644 core/src/ten_utils/log/new_pid.c delete mode 100644 core/src/ten_utils/log/new_time.c delete mode 100644 core/src/ten_utils/log/new_time_cache.c delete mode 100644 core/src/ten_utils/log/normal.c delete mode 100644 core/src/ten_utils/log/platform/BUILD.gn delete mode 100644 core/src/ten_utils/log/platform/general/BUILD.gn delete mode 100644 core/src/ten_utils/log/platform/general/log.c delete mode 100644 core/src/ten_utils/log/platform/log.c delete mode 100644 core/src/ten_utils/log/platform/mac/BUILD.gn delete mode 100644 core/src/ten_utils/log/platform/mac/log.c delete mode 100644 core/src/ten_utils/log/platform/win/BUILD.gn delete mode 100644 core/src/ten_utils/log/platform/win/log.c delete mode 100644 core/src/ten_utils/log/spec.c diff --git a/.vscode/launch.json b/.vscode/launch.json index 1887584037..064837f568 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,7 @@ "program": "${workspaceFolder}/out/linux/x64/tests/standalone/ten_utils_unit_test", "cwd": "${workspaceFolder}/out/linux/x64", "args": [ - "--gtest_filter=SchemaTest.ValidStringType" + "--gtest_filter=ThreadTest.negative" ], "env": { "LD_LIBRARY_PATH": "${workspaceFolder}/out/linux/x64/tests/standalone/", diff --git a/core/include/ten_runtime/binding/cpp/internal/app.h b/core/include/ten_runtime/binding/cpp/internal/app.h index 6d9ff1fc88..9803e887a9 100644 --- a/core/include/ten_runtime/binding/cpp/internal/app.h +++ b/core/include/ten_runtime/binding/cpp/internal/app.h @@ -8,13 +8,13 @@ #include #include +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/cpp/internal/common.h" #include "ten_runtime/binding/cpp/internal/extension_group.h" #include "ten_runtime/ten.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" using ten_app_t = struct ten_app_t; diff --git a/core/include/ten_runtime/binding/cpp/internal/extension.h b/core/include/ten_runtime/binding/cpp/internal/extension.h index 1f38662c8f..cbce3783c4 100644 --- a/core/include/ten_runtime/binding/cpp/internal/extension.h +++ b/core/include/ten_runtime/binding/cpp/internal/extension.h @@ -12,6 +12,8 @@ #include #include +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/cpp/internal/common.h" #include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" @@ -26,8 +28,6 @@ #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" using ten_json_t = ::ten_json_t; using ten_env_t = struct ten_env_t; diff --git a/core/include/ten_runtime/binding/cpp/internal/extension_group.h b/core/include/ten_runtime/binding/cpp/internal/extension_group.h index a3fe20d63c..33b27ac6dd 100644 --- a/core/include/ten_runtime/binding/cpp/internal/extension_group.h +++ b/core/include/ten_runtime/binding/cpp/internal/extension_group.h @@ -7,11 +7,11 @@ #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/cpp/internal/ten_env.h" #include "ten_runtime/extension_group/extension_group.h" #include "ten_utils/container/list.h" -#include "ten_utils/macro/check.h" // NOLINTNEXTLINE(bugprone-forward-declaration-namespace) using ten_extension_group_t = struct ten_extension_group_t; diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/cmd.h b/core/include/ten_runtime/binding/cpp/internal/msg/cmd/cmd.h index 9f6c8156b7..ee41f00e64 100644 --- a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/cmd.h +++ b/core/include/ten_runtime/binding/cpp/internal/msg/cmd/cmd.h @@ -9,11 +9,11 @@ #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/cpp/internal/msg/msg.h" #include "ten_runtime/msg/cmd/cmd.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" namespace ten { diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/msg.h b/core/include/ten_runtime/binding/cpp/internal/msg/msg.h index 716ff2f8c1..405f1ecbdc 100644 --- a/core/include/ten_runtime/binding/cpp/internal/msg/msg.h +++ b/core/include/ten_runtime/binding/cpp/internal/msg/msg.h @@ -9,6 +9,7 @@ #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lang/cpp/lib/error.h" @@ -16,7 +17,6 @@ #include "ten_utils/lib/buf.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" #include "ten_utils/value/value_json.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/ten_env.h b/core/include/ten_runtime/binding/cpp/internal/ten_env.h index cfc56cdfcd..267b79ce22 100644 --- a/core/include/ten_runtime/binding/cpp/internal/ten_env.h +++ b/core/include/ten_runtime/binding/cpp/internal/ten_env.h @@ -8,6 +8,7 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" #include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" @@ -24,7 +25,7 @@ #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/buf.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_json.h" diff --git a/core/include/ten_utils/io/runloop.h b/core/include/ten_utils/io/runloop.h index 16e3cefe9e..c63e760e54 100644 --- a/core/include/ten_utils/io/runloop.h +++ b/core/include/ten_utils/io/runloop.h @@ -154,7 +154,7 @@ TEN_UTILS_API void ten_runloop_async_destroy(ten_runloop_async_t *async); * @brief Notify the signal. * @param async The signal. * @return 0 if success, -1 otherwise. - * @note The signal callback will be called in the thread of |loop| that inited + * @note The signal callback will be called in the thread of |loop| that initted */ TEN_UTILS_API int ten_runloop_async_notify(ten_runloop_async_t *async); diff --git a/core/include/ten_utils/lang/cpp/lib/value.h b/core/include/ten_utils/lang/cpp/lib/value.h index 9586eafeaa..7668ab0c46 100644 --- a/core/include/ten_utils/lang/cpp/lib/value.h +++ b/core/include/ten_utils/lang/cpp/lib/value.h @@ -15,13 +15,13 @@ #include #include "buf.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/buf.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" #include "ten_utils/value/value_is.h" diff --git a/core/include/ten_utils/lib/mutex.h b/core/include/ten_utils/lib/mutex.h index 8e63f07e7c..3709004000 100644 --- a/core/include/ten_utils/lib/mutex.h +++ b/core/include/ten_utils/lib/mutex.h @@ -7,7 +7,7 @@ #include "ten_utils/ten_config.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" #define TEN_DO_WITH_MUTEX_LOCK(lock, blocks) \ do { \ diff --git a/core/include/ten_utils/lib/ref.h b/core/include/ten_utils/lib/ref.h index 7f8754c95f..369e11f835 100644 --- a/core/include/ten_utils/lib/ref.h +++ b/core/include/ten_utils/lib/ref.h @@ -24,13 +24,13 @@ typedef struct ten_ref_t { ten_atomic_t ref_cnt; // The object which is managed by this 'ten_ref_t'. This field should _not_ be - // modified after 'ten_ref_t' has been inited, therefore, we don't need to + // modified after 'ten_ref_t' has been initted, therefore, we don't need to // care about its thread safety. void *supervisee; // This function will be called when the end-of-life of 'supervisee' is // reached. This field should _not_ be modified after 'ten_ref_t' has been - // inited, therefore, we don't need to care about its thread safety. + // initted, therefore, we don't need to care about its thread safety. ten_ref_on_end_of_life_func_t on_end_of_life; } ten_ref_t; diff --git a/core/include/ten_utils/lib/string.h b/core/include/ten_utils/lib/string.h index 21983ebc22..ea4bb1137a 100644 --- a/core/include/ten_utils/lib/string.h +++ b/core/include/ten_utils/lib/string.h @@ -11,9 +11,9 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/buf.h" #include "ten_utils/lib/signature.h" -#include "ten_utils/macro/check.h" #define TEN_STRING_SIGNATURE 0x178445C0402E320DU #define TEN_STRING_PRE_BUF_SIZE 256 @@ -235,7 +235,7 @@ inline const char *ten_string_get_raw_str(const ten_string_t *self) { */ inline size_t ten_string_len(const ten_string_t *self) { TEN_ASSERT(self && ten_string_check_integrity(self), "Invalid argument."); - return self ? strlen(self->buf) : 0; + return self ? self->first_unused_idx : 0; } /** diff --git a/core/include/ten_utils/lib/typed_list_node.h b/core/include/ten_utils/lib/typed_list_node.h index 8b6dd01457..9ed0eb1a86 100644 --- a/core/include/ten_utils/lib/typed_list_node.h +++ b/core/include/ten_utils/lib/typed_list_node.h @@ -5,9 +5,10 @@ // #pragma once -#include "ten_utils/macro/check.h" #include "ten_utils/ten_config.h" +#include "include_internal/ten_utils/macro/check.h" + #define TEN_TYPED_LIST_NODE_SIGNATURE 0x3CE1EAC77F72D345U /** diff --git a/core/include/ten_utils/log/log.h b/core/include/ten_utils/log/log.h deleted file mode 100644 index f66e7f24d3..0000000000 --- a/core/include/ten_utils/log/log.h +++ /dev/null @@ -1,1055 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -#include -#include -#include -#include - -#include "ten_utils/lib/signature.h" -#include "ten_utils/macro/mark.h" - -#define TEN_LOG_SIGNATURE 0x242A93FBC29C297DU - -/** - * @brief "Current" log level is a compile time check and has no runtime - * overhead. Log level that is below current log level it said to be "disabled". - * Otherwise, it's "enabled". Log messages that are disabled has no runtime - * overhead - they are converted to no-op by preprocessor and then eliminated by - * compiler. Current log level is configured per compilation module (.c/.cpp/.m - * file) by defining TEN_LOG_DEF_LEVEL or TEN_LOG_LEVEL. TEN_LOG_LEVEL has - * higher priority and when defined overrides value provided by - * TEN_LOG_DEF_LEVEL. - * - * Common practice is to define default current log level with TEN_LOG_DEF_LEVEL - * in build script (e.g. Makefile, CMakeLists.txt, gyp, etc.) for the entire - * project or target: - * - * CC_ARGS := -DTEN_LOG_DEF_LEVEL=TEN_LOG_INFO - * - * And when necessary to override it with TEN_LOG_LEVEL in .c/.cpp/.m files - * before including log/log.h: - * - * #define TEN_LOG_LEVEL TEN_LOG_VERBOSE - * #include - * - * If both TEN_LOG_DEF_LEVEL and TEN_LOG_LEVEL are undefined, then TEN_LOG_INFO - * will be used for release builds (NDEBUG is defined) and TEN_LOG_DEBUG - * otherwise (NDEBUG is not defined). - */ -#if defined(TEN_LOG_LEVEL) - #define _TEN_LOG_LEVEL TEN_LOG_LEVEL -#elif defined(TEN_LOG_DEF_LEVEL) - #define _TEN_LOG_LEVEL TEN_LOG_DEF_LEVEL -#else - #ifdef NDEBUG - // Release mode - - // HACK(Wei): We enable DEBUG log in the release mode for now, and to revert - // it back to INFO in the future if we are confident that the bug in the - // release mode is clear. - // - // #define _TEN_LOG_LEVEL TEN_LOG_INFO - #define _TEN_LOG_LEVEL TEN_LOG_DEBUG - #else - // Debug mode - #define _TEN_LOG_LEVEL TEN_LOG_DEBUG - #endif -#endif - -/** - * @brief "Output" log level is a runtime check. When log level is below output - * log level it said to be "turned off" (or just "off" for short). Otherwise - * it's "turned on" (or just "on"). Log levels that were "disabled" (see - * TEN_LOG_LEVEL and TEN_LOG_DEF_LEVEL) can't be "turned on", but "enabled" log - * levels could be "turned off". Only messages with log level which is - * "turned on" will reach output facility. All other messages will be ignored - * (and their arguments will not be evaluated). Output log level is a global - * property and configured per process using ten_log_set_output_level() function - * which can be called at any time. - * - * Though in some cases it could be useful to configure output log level per - * compilation module or per library. There are two ways to achieve that: - * - Define TEN_LOG_OUTPUT_LEVEL to expresion that evaluates to desired output - * log level. - * - Copy log/log.h and src/log/ files into your library and build it with - * TEN_LOG_LIBRARY_PREFIX defined to library specific prefix. See - * TEN_LOG_LIBRARY_PREFIX for more details. - * - * When defined, TEN_LOG_OUTPUT_LEVEL must evaluate to integral value that - * corresponds to desired output log level. Use it only when compilation module - * is required to have output log level which is different from global output - * log level set by ten_log_set_output_level() function. For other cases, - * consider defining TEN_LOG_LEVEL or using ten_log_set_output_level() function. - * - * Example: - * - * #define TEN_LOG_OUTPUT_LEVEL g_module_log_level - * #include - * static int g_module_log_level = TEN_LOG_INFO; - * static void foo() { - * TEN_LOGI("Will check g_module_log_level for output log level"); - * } - * void debug_log(bool on) { - * g_module_log_level = on? TEN_LOG_DEBUG: TEN_LOG_INFO; - * } - * - * Note on performance. This expression will be evaluated each time message is - * logged (except when message log level is "disabled" - see TEN_LOG_LEVEL for - * details). Keep this expression as simple as possible, otherwise it will not - * only add runtime overhead, but also will increase size of call site (which - * will result in larger executable). The preferred way is to use integer - * variable (as in example above). If structure must be used, log_level field - * must be the first field in this structure: - * - * #define TEN_LOG_OUTPUT_LEVEL (g_config.log_level) - * #include - * struct config { - * int log_level; - * unsigned other_field; - * [...] - * }; - * static config g_config = {TEN_LOG_INFO, 0, ...}; - * - * This allows compiler to generate more compact load instruction (no need to - * specify offset since it's zero). Calling a function to get output log level - * is generally a bad idea, since it will increase call site size and runtime - * overhead even further. - */ -#if defined(TEN_LOG_OUTPUT_LEVEL) - #define _TEN_LOG_OUTPUT_LEVEL TEN_LOG_OUTPUT_LEVEL -#else - #define _TEN_LOG_OUTPUT_LEVEL ten_log_global_output_level -#endif - -/** - * @brief "Tag" is a compound string that could be associated with a log - * message. It consists of tag prefix and tag (both are optional). - * - * Tag prefix is a global property and configured per process using - * ten_log_set_tag_prefix() function. Tag prefix identifies context in which - * component or module is running (e.g. process name). For example, the same - * library could be used in both client and server processes that work on the - * same machine. Tag prefix could be used to easily distinguish between them. - * For more details about tag prefix see ten_log_set_tag_prefix() function. - * - * Tag identifies component or module. It is configured per compilation module - * (.c/.cpp/.m file) by defining TEN_LOG_TAG or TEN_LOG_DEF_TAG. TEN_LOG_TAG has - * higher priority and when defined overrides value provided by TEN_LOG_DEF_TAG. - * When defined, value must evaluate to (const char *), so for strings double - * quotes must be used. - * - * Default tag could be defined with TEN_LOG_DEF_TAG in build script (e.g. - * Makefile, CMakeLists.txt, gyp, etc.) for the entire project or target: - * - * CC_ARGS := -DTEN_LOG_DEF_TAG=\"MISC\" - * - * And when necessary could be overriden with TEN_LOG_TAG in .c/.cpp/.m files - * before including log/log.h: - * - * #define TEN_LOG_TAG "MAIN" - * #include - * - * If both TEN_LOG_DEF_TAG and TEN_LOG_TAG are undefined no tag will be added to - * the log message (tag prefix still could be added though). - * - * Output example: - * - * 04-29 22:43:20.244 40059 1299 I hello.MAIN Number of arguments: 1 - * | | - * | +- tag (e.g. module) - * +- tag prefix (e.g. process name) - */ -#if !defined(TEN_LOG_DEF_TAG) - #define TEN_LOG_DEF_TAG "TEN" -#endif - -#if defined(TEN_LOG_TAG) - #define _TEN_LOG_TAG TEN_LOG_TAG -#elif defined(TEN_LOG_DEF_TAG) - #define _TEN_LOG_TAG TEN_LOG_DEF_TAG -#else - #define _TEN_LOG_TAG NULL -#endif - -/** - * @brief Source location format is configured per compilation module - * (.c/.cpp/.m file) by defining TEN_LOG_DEF_SRC_LOC or TEN_LOG_SRC_LOC. - * TEN_LOG_SRC_LOC has higher priority and when defined overrides value provided - * by TEN_LOG_DEF_SRC_LOC. - * - * Common practice is to define default format with TEN_LOG_DEF_SRC_LOC in - * build script (e.g. Makefile, CMakeLists.txt, gyp, etc.) for the entire - * project or target: - * - * CC_ARGS := -DTEN_LOG_DEF_SRC_LOC=TEN_LOG_SRC_LOC_LONG - * - * And when necessary to override it with TEN_LOG_SRC_LOC in .c/.cpp/.m files - * before including log/log.h: - * - * #define TEN_LOG_SRC_LOC TEN_LOG_SRC_LOC_NONE - * #include - * - * If both TEN_LOG_DEF_SRC_LOC and TEN_LOG_SRC_LOC are undefined, then - * TEN_LOG_SRC_LOC_NONE will be used for release builds (NDEBUG is defined) and - * TEN_LOG_SRC_LOC_LONG otherwise (NDEBUG is not defined). - */ -#if defined(TEN_LOG_SRC_LOC) - #define _TEN_LOG_SRC_LOC TEN_LOG_SRC_LOC -#elif defined(TEN_LOG_DEF_SRC_LOC) - #define _TEN_LOG_SRC_LOC TEN_LOG_DEF_SRC_LOC -#else - #ifdef NDEBUG - // Release mode default. - - // HACK(Wei): We enable full location information in the release mode for - // now, and to revert it back to NONE in the future if we are confident that - // the bug in the release mode is clear. - // - // #define _TEN_LOG_SRC_LOC TEN_LOG_SRC_LOC_NONE - #define _TEN_LOG_SRC_LOC TEN_LOG_SRC_LOC_LONG - #else - // Debug mode default. - #define _TEN_LOG_SRC_LOC TEN_LOG_SRC_LOC_LONG - #endif -#endif - -#if TEN_LOG_SRC_LOC_LONG == _TEN_LOG_SRC_LOC - #define _TEN_LOG_SRC_LOC_FUNCTION _TEN_LOG_FUNCTION -#else - #define _TEN_LOG_SRC_LOC_FUNCTION NULL -#endif - -/** - * @brief Censoring is configured per compilation module (.c/.cpp/.m file) by - * defining TEN_LOG_DEF_CENSORING or TEN_LOG_CENSORING. TEN_LOG_CENSORING has - * higher priority and when defined overrides value provided by - * TEN_LOG_DEF_CENSORING. - * - * Common practice is to define default censoring with TEN_LOG_DEF_CENSORING in - * build script (e.g. Makefile, CMakeLists.txt, gyp, etc.) for the entire - * project or target: - * - * CC_ARGS := -DTEN_LOG_DEF_CENSORING=TEN_LOG_CENSORED - * - * And when necessary to override it with TEN_LOG_CENSORING in .c/.cpp/.m files - * before including log/log.h (consider doing it only for debug purposes and be - * very careful not to push such temporary changes to source control): - * - * #define TEN_LOG_CENSORING TEN_LOG_UNCENSORED - * #include - * - * If both TEN_LOG_DEF_CENSORING and TEN_LOG_CENSORING are undefined, then - * TEN_LOG_CENSORED will be used for release builds (NDEBUG is defined) and - * TEN_LOG_UNCENSORED otherwise (NDEBUG is not defined). - */ -#if defined(TEN_LOG_CENSORING) - #define _TEN_LOG_CENSORING TEN_LOG_CENSORING -#elif defined(TEN_LOG_DEF_CENSORING) - #define _TEN_LOG_CENSORING TEN_LOG_DEF_CENSORING -#else - #ifdef NDEBUG - // Release mode. - #define _TEN_LOG_CENSORING TEN_LOG_CENSORED - #else - // Debug mode. - #define _TEN_LOG_CENSORING TEN_LOG_UNCENSORED - #endif -#endif - -/** - * @brief Check censoring at compile time. Evaluates to true when censoring is - * disabled (i.e. when secrets will be logged). For example: - * - * #if TEN_LOG_SECRETS - * char ssn[16]; - * getSocialSecurityNumber(ssn); - * TEN_LOGI("Customer ssn: %s", ssn); - * #endif - * - * See TEN_LOG_SECRET() macro for a more convenient way of guarding single log - * statement. - */ -#define TEN_LOG_SECRETS (_TEN_LOG_CENSORING == TEN_LOG_UNCENSORED) - -/** - * @brief Static (compile-time) initialization support allows to configure - * logging before entering main() function. This mostly useful in C++ where - * functions and methods could be called during initialization of global - * objects. Those functions and methods could record log messages too and for - * that reason static initialization of logging configuration is customizable. - * - * Macros below allow to specify values to use for initial configuration: - * - TEN_LOG_EXTERN_TAG_PREFIX - tag prefix (default: none) - * - TEN_LOG_EXTERN_GLOBAL_FORMAT - global format options (default: see - * TEN_LOG_MEM_WIDTH) - * - TEN_LOG_EXTERN_GLOBAL_OUTPUT - global output facility (default: stderr or - * platform specific, see TEN_LOG_USE_XXX macros) - * - TEN_LOG_EXTERN_GLOBAL_OUTPUT_LEVEL - global output log level (default: 0 - - * all levels are "turned on") - * - * For example, in a file said 'log_config.c': - * - * #include - * TEN_LOG_DEFINE_TAG_PREFIX = "MyApp"; - * TEN_LOG_DEFINE_GLOBAL_FORMAT = {CUSTOM_MEM_WIDTH}; - * TEN_LOG_DEFINE_GLOBAL_OUTPUT = { - * TEN_LOG_PUT_STD, - * custom_output_callback, - * 0 - * }; - * TEN_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL = TEN_LOG_INFO; - * - * However, to use any of those macros ten_log library must be compiled with - * following macros defined: - * - to use TEN_LOG_DEFINE_TAG_PREFIX define TEN_LOG_EXTERN_TAG_PREFIX - * - to use TEN_LOG_DEFINE_GLOBAL_FORMAT define TEN_LOG_EXTERN_GLOBAL_FORMAT - * - to use TEN_LOG_DEFINE_GLOBAL_OUTPUT define TEN_LOG_EXTERN_GLOBAL_OUTPUT - * - to use TEN_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL define - * TEN_LOG_EXTERN_GLOBAL_OUTPUT_LEVEL - * - * When ten_log library compiled with one of TEN_LOG_EXTERN_XXX macros defined, - * corresponding TEN_LOG_DEFINE_XXX macro MUST be used exactly once somewhere. - * Otherwise build will fail with link error (undefined symbol). - */ -#define TEN_LOG_DEFINE_TAG_PREFIX const char *ten_log_tag_prefix -#define TEN_LOG_DEFINE_GLOBAL_FORMAT ten_log_format_t ten_log_global_format -#define TEN_LOG_DEFINE_GLOBAL_OUTPUT ten_log_output_t ten_log_global_output -#define TEN_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL \ - TEN_LOG_LEVEL ten_log_global_output_level - -/** - * @brief Pointer to global format options. Direct modification is _not_ - * allowed. Use ten_log_set_mem_width() instead. Could be used to initialize - * ten_log_t structure: - * - * const ten_log_output_t g_output = {TEN_LOG_PUT_STD, output_callback, 0}; - * const ten_log_t g_spec = {TEN_LOG_SIGNATURE, TEN_LOG_GLOBAL_FORMAT, - * &g_output}; - * TEN_LOGI_AUX(&g_spec, "Hello"); - */ -#define TEN_LOG_GLOBAL_FORMAT ((ten_log_format_t *)&ten_log_global_format) - -/** - * @brief Pointer to global output variable. Direct modification is _not_ - * allowed. Use ten_log_set_output_v() or ten_log_set_output_p() instead. Could - * be used to initialize ten_log_t structure: - * - * const ten_log_format_t g_format = {false, 40}; - * const ten_log_t g_spec = {TEN_LOG_SIGNATURE, g_format, - * TEN_LOG_GLOBAL_OUTPUT}; - * TEN_LOGI_AUX(&g_spec, "Hello"); - */ -#define TEN_LOG_GLOBAL_OUTPUT ((ten_log_output_t *)&ten_log_global_output) - -/** - * @brief When defined, all library symbols produced by linker will be prefixed - * with provided value. That allows to use ten_log library privately in another - * libraries without exposing ten_log symbols in their original form (to avoid - * possible conflicts with other libraries / components that also could use - * ten_log for logging). Value must be without quotes, for example: - * - * CC_ARGS := -DTEN_LOG_LIBRARY_PREFIX=my_lib_ - * - * Note, that in this mode TEN_LOG_LIBRARY_PREFIX must be defined when building - * ten_log library AND it also must be defined to the same value when building - * a library that uses it. For example, consider fictional KittyHttp library - * that wants to use ten_log for logging. First approach that could be taken is - * to add log/log.h and src/log/ files to the KittyHttp's source code tree - * directly. In that case it will be enough just to define - * TEN_LOG_LIBRARY_PREFIX in KittyHttp's build script: - * - * // KittyHttp/CMakeLists.txt - * target_compile_definitions(KittyHttp PRIVATE - * "TEN_LOG_LIBRARY_PREFIX=KittyHttp_") - * - * If KittyHttp doesn't want to include ten_log source code in its source tree - * and wants to build ten_log as a separate library than ten_log library must be - * built with TEN_LOG_LIBRARY_PREFIX defined to KittyHttp_ AND KittyHttp library - * itself also needs to define TEN_LOG_LIBRARY_PREFIX to KittyHttp_. It can do - * so either in its build script, as in example above, or by providing a - * wrapper header that KittyHttp library will need to use instead of log/log.h: - * - * // KittyHttpLogging.h - * #define TEN_LOG_LIBRARY_PREFIX KittyHttp_ - * #include - * - * Regardless of the method chosen, the end result is that ten_log symbols will - * be prefixed with "KittyHttp_", so if a user of KittyHttp (say DogeBrowser) - * also uses ten_log for logging, they will not interferer with each other. Both - * will have their own log level, output facility, format options etc. - */ -#ifdef TEN_LOG_LIBRARY_PREFIX - #define _TEN_LOG_DECOR__(prefix, name) prefix##name - #define _TEN_LOG_DECOR_(prefix, name) _TEN_LOG_DECOR__(prefix, name) - #define _TEN_LOG_DECOR(name) _TEN_LOG_DECOR_(TEN_LOG_LIBRARY_PREFIX, name) - - #define ten_log_set_tag_prefix _TEN_LOG_DECOR(ten_log_set_tag_prefix) - #define ten_log_set_mem_width _TEN_LOG_DECOR(ten_log_set_mem_width) - #define ten_log_set_output_level _TEN_LOG_DECOR(ten_log_set_output_level) - #define ten_log_set_output_v _TEN_LOG_DECOR(ten_log_set_output_v) - #define ten_log_set_output_p _TEN_LOG_DECOR(ten_log_set_output_p) - - #define ten_log_out_stderr_cb _TEN_LOG_DECOR(ten_log_out_stderr_cb) - - #define ten_log_tag_prefix _TEN_LOG_DECOR(ten_log_tag_prefix) - #define ten_log_global_format _TEN_LOG_DECOR(ten_log_global_format) - #define ten_log_global_output _TEN_LOG_DECOR(ten_log_global_output) - #define ten_log_global_output_level \ - _TEN_LOG_DECOR(ten_log_global_output_level) - - #define ten_log_write_d _TEN_LOG_DECOR(ten_log_write_d) - #define ten_log_write_aux_d _TEN_LOG_DECOR(ten_log_write_aux_d) - #define ten_log_write _TEN_LOG_DECOR(ten_log_write) - #define ten_log_write_aux _TEN_LOG_DECOR(ten_log_write_aux) - #define ten_log_write_mem_d _TEN_LOG_DECOR(ten_log_write_mem_d) - #define ten_log_write_mem_aux_d _TEN_LOG_DECOR(ten_log_write_mem_aux_d) - #define ten_log_write_mem _TEN_LOG_DECOR(ten_log_write_mem) - #define ten_log_write_mem_aux _TEN_LOG_DECOR(ten_log_write_mem_aux) - - #define ten_log_write_imp _TEN_LOG_DECOR(ten_log_write_imp) - #define ten_log_stderr_spec _TEN_LOG_DECOR(ten_log_stderr_spec) -#endif - -#if defined(__printflike) - #define _TEN_LOG_PRINTFLIKE(str_index, first_to_check) \ - __printflike(str_index, first_to_check) -#elif defined(__GNUC__) - #define _TEN_LOG_PRINTFLIKE(str_index, first_to_check) \ - __attribute__((format(__printf__, str_index, first_to_check))) -#else - #define _TEN_LOG_PRINTFLIKE(str_index, first_to_check) -#endif - -#if (defined(_WIN32) || defined(_WIN64)) && !defined(__GNUC__) - #define _TEN_LOG_FUNCTION __FUNCTION__ -#else - #define _TEN_LOG_FUNCTION __func__ -#endif - -#if defined(_MSC_VER) - #define _TEN_LOG_IF(cond) \ - __pragma(warning(push)) __pragma(warning(disable : 4127)) if (cond) \ - __pragma(warning(pop)) - #define _TEN_LOG_WHILE(cond) \ - __pragma(warning(push)) __pragma(warning(disable : 4127)) while (cond) \ - __pragma(warning(pop)) -#else - #define _TEN_LOG_IF(cond) if (cond) - #define _TEN_LOG_WHILE(cond) while (cond) -#endif - -#define _TEN_LOG_NEVER _TEN_LOG_IF(0) -#define _TEN_LOG_ONCE _TEN_LOG_WHILE(0) - -/** - * @brief Execute log statement if condition is true. Example: - * - * TEN_LOG_IF(1 < 2, TEN_LOGI("Log this")); - * TEN_LOG_IF(1 > 2, TEN_LOGI("Don't log this")); - * - * Keep in mind though, that if condition can't be evaluated at compile time, - * then it will be evaluated at run time. This will increase executable size - * and can have noticeable performance overhead. Try to limit conditions to - * expressions that can be evaluated at compile time. - */ -#define TEN_LOG_IF(cond, f) \ - do { \ - _TEN_LOG_IF((cond)) { f; } \ - } while (0) - -/** - * @brief Mark log statement as "secret". Log statements that are marked as - * secrets will NOT be executed when censoring is enabled (see - * TEN_LOG_CENSORED). Example: - * - * TEN_LOG_SECRET(TEN_LOGI("Credit card: %s", credit_card)); - * TEN_LOG_SECRET(TEN_LOGD_MEM(cipher, cipher_sz, "Cipher bytes:")); - */ -#define TEN_LOG_SECRET(f) TEN_LOG_IF(TEN_LOG_SECRETS, f) - -/** - * @brief Source location is part of a log line that describes location - * (function or method name, file name and line number, e.g. - * "runloop@main.cpp:68") of a log statement that produced it. - * - * @note Because these values would be used in '#if' statements, it can _not_ be - * declared as 'enum'. - */ -// Don't add source location to log line. -#define TEN_LOG_SRC_LOC_NONE 0 // NOLINT(modernize-macro-to-enum) -// Add source location in short form (file and line number, e.g. -// "@main.cpp:68"). -#define TEN_LOG_SRC_LOC_SHORT 1 // NOLINT(modernize-macro-to-enum) -// Add source location in long form (function or method name, file and line -// number, e.g. "runloop@main.cpp:68"). -#define TEN_LOG_SRC_LOC_LONG 2 // NOLINT(modernize-macro-to-enum) - -/** - * @brief Censoring provides conditional logging of secret information, also - * known as Personally Identifiable Information (PII) or Sensitive Personal - * Information (SPI). Censoring can be either enabled (TEN_LOG_CENSORED) or - * disabled (TEN_LOG_UNCENSORED). When censoring is enabled, log statements - * marked as "secrets" will be ignored and will have zero overhead (arguments - * also will not be evaluated). - * - * @note Because these values would be used in '#if' statements, it can _not_ be - * declared as 'enum'. - */ -// Censoring is enabled, log statements marked as "secrets" will be ignored -// and will have zero overhead(arguments also will not be evaluated). -#define TEN_LOG_CENSORED 0 // NOLINT(modernize-macro-to-enum) -// Censoring is disabled. -#define TEN_LOG_UNCENSORED 1 // NOLINT(modernize-macro-to-enum) - -/** - * @brief Check "current" log level at compile time (ignoring "output" log - * level). Evaluates to true when specified log level is enabled. For example: - * - * #if TEN_LOG_ENABLED_DEBUG - * const char *const g_enum_strings[] = { - * "enum_value_0", "enum_value_1", "enum_value_2" - * }; - * #endif - * // ... - * #if TEN_LOG_ENABLED_DEBUG - * TEN_LOGD("enum value: %s", g_enum_strings[v]); - * #endif - * - * See TEN_LOG_LEVEL for details. - */ -#define TEN_LOG_ENABLED(level) ((level) >= _TEN_LOG_LEVEL) -#define TEN_LOG_ENABLED_VERBOSE TEN_LOG_ENABLED(TEN_LOG_VERBOSE) -#define TEN_LOG_ENABLED_DEBUG TEN_LOG_ENABLED(TEN_LOG_DEBUG) -#define TEN_LOG_ENABLED_INFO TEN_LOG_ENABLED(TEN_LOG_INFO) -#define TEN_LOG_ENABLED_WARN TEN_LOG_ENABLED(TEN_LOG_WARN) -#define TEN_LOG_ENABLED_ERROR TEN_LOG_ENABLED(TEN_LOG_ERROR) -#define TEN_LOG_ENABLED_FATAL TEN_LOG_ENABLED(TEN_LOG_FATAL) - -/** - * @brief Check "output" log level at run time (taking into account "current" - * log level as well). Evaluates to true when specified log level is turned on - * AND enabled. For example: - * - * if (TEN_LOG_ON_DEBUG) - * { - * char hash[65]; - * sha256(data_ptr, data_sz, hash); - * TEN_LOGD("data: len=%u, sha256=%s", data_sz, hash); - * } - * - * See TEN_LOG_OUTPUT_LEVEL for details. - */ -#define TEN_LOG_ON(level) \ - (TEN_LOG_ENABLED((level)) && (level) >= _TEN_LOG_OUTPUT_LEVEL) -#define TEN_LOG_ON_VERBOSE TEN_LOG_ON(TEN_LOG_VERBOSE) -#define TEN_LOG_ON_DEBUG TEN_LOG_ON(TEN_LOG_DEBUG) -#define TEN_LOG_ON_INFO TEN_LOG_ON(TEN_LOG_INFO) -#define TEN_LOG_ON_WARN TEN_LOG_ON(TEN_LOG_WARN) -#define TEN_LOG_ON_ERROR TEN_LOG_ON(TEN_LOG_ERROR) -#define TEN_LOG_ON_FATAL TEN_LOG_ON(TEN_LOG_FATAL) - -/** - * @brief Message logging macros: - * - TEN_LOGV("format string", args, ...) - * - TEN_LOGD("format string", args, ...) - * - TEN_LOGI("format string", args, ...) - * - TEN_LOGW("format string", args, ...) - * - TEN_LOGE("format string", args, ...) - * - TEN_LOGF("format string", args, ...) - * - * Memory logging macros: - * - TEN_LOGV_MEM(data_ptr, data_sz, "format string", args, ...) - * - TEN_LOGD_MEM(data_ptr, data_sz, "format string", args, ...) - * - TEN_LOGI_MEM(data_ptr, data_sz, "format string", args, ...) - * - TEN_LOGW_MEM(data_ptr, data_sz, "format string", args, ...) - * - TEN_LOGE_MEM(data_ptr, data_sz, "format string", args, ...) - * - TEN_LOGF_MEM(data_ptr, data_sz, "format string", args, ...) - * - * Auxiliary logging macros: - * - TEN_LOGV_AUX(&log_instance, "format string", args, ...) - * - TEN_LOGD_AUX(&log_instance, "format string", args, ...) - * - TEN_LOGI_AUX(&log_instance, "format string", args, ...) - * - TEN_LOGW_AUX(&log_instance, "format string", args, ...) - * - TEN_LOGE_AUX(&log_instance, "format string", args, ...) - * - TEN_LOGF_AUX(&log_instance, "format string", args, ...) - * - * Auxiliary memory logging macros: - * - TEN_LOGV_MEM_AUX(&log_instance, data_ptr, data_sz, "format string", args, - * ...) - * - TEN_LOGD_MEM_AUX(&log_instance, data_ptr, data_sz, "format string", args, - * ...) - * - TEN_LOGI_MEM_AUX(&log_instance, data_ptr, data_sz, "format string", args, - * ...) - * - TEN_LOGW_MEM_AUX(&log_instance, data_ptr, data_sz, "format string", args, - * ...) - * - TEN_LOGE_MEM_AUX(&log_instance, data_ptr, data_sz, "format string", args, - * ...) - * - TEN_LOGF_MEM_AUX(&log_instance, data_ptr, data_sz, "format string", args, - * ...) - * - * Preformatted string logging macros: - * - TEN_LOGV_STR("preformatted string"); - * - TEN_LOGD_STR("preformatted string"); - * - TEN_LOGI_STR("preformatted string"); - * - TEN_LOGW_STR("preformatted string"); - * - TEN_LOGE_STR("preformatted string"); - * - TEN_LOGF_STR("preformatted string"); - * - * Explicit log level and tag macros: - * - TEN_LOG_WRITE(level, tag, "format string", args, ...) - * - TEN_LOG_WRITE_MEM(level, tag, data_ptr, data_sz, "format string", args, - * ...) - * - TEN_LOG_WRITE_AUX(&log_instance, level, tag, "format string", args, ...) - * - TEN_LOG_WRITE_MEM_AUX(&log_instance, level, tag, data_ptr, data_sz, - * "format string", args, ...) - * - * Format string follows printf() conventions. Both data_ptr and data_sz could - * be 0. Tag can be 0 as well. Most compilers will verify that type of arguments - * match format specifiers in format string. - * - * Library assuming UTF-8 encoding for all strings (char *), including format - * string itself. - */ -#if TEN_LOG_SRC_LOC_NONE == _TEN_LOG_SRC_LOC - - #define TEN_LOG_WRITE(level, tag, ...) \ - do { \ - if (TEN_LOG_ON(level)) { \ - ten_log_write(level, tag, __VA_ARGS__); \ - } \ - } while (0) - - #define TEN_LOG_WRITE_MEM(level, tag, mem, size, ...) \ - do { \ - if (TEN_LOG_ON(level)) { \ - ten_log_write_mem(level, tag, mem, size, __VA_ARGS__); \ - } \ - } while (0) - - #define TEN_LOG_WRITE_AUX(log, level, tag, ...) \ - do { \ - if (TEN_LOG_ON(level)) { \ - ten_log_write_aux(log, level, tag, __VA_ARGS__); \ - } \ - } while (0) - - #define TEN_LOG_WRITE_MEM_AUX(log, level, tag, mem, size, ...) \ - do { \ - if (TEN_LOG_ON(level)) { \ - ten_log_write_mem_aux(log, level, tag, mem, size, __VA_ARGS__); \ - } \ - } while (0) -#else - #define TEN_LOG_WRITE(level, tag, ...) \ - do { \ - if (TEN_LOG_ON(level)) { \ - ten_log_write_d(_TEN_LOG_SRC_LOC_FUNCTION, __FILE__, __LINE__, level, \ - tag, __VA_ARGS__); \ - } \ - } while (0) - - #define TEN_LOG_WRITE_MEM(level, tag, mem, size, ...) \ - do { \ - if (TEN_LOG_ON(level)) { \ - ten_log_write_mem_d(_TEN_LOG_SRC_LOC_FUNCTION, __FILE__, __LINE__, \ - level, tag, mem, size, __VA_ARGS__); \ - } \ - } while (0) - - #define TEN_LOG_WRITE_AUX(log, level, tag, ...) \ - do { \ - if (TEN_LOG_ON(level)) { \ - ten_log_write_aux_d(_TEN_LOG_SRC_LOC_FUNCTION, __FILE__, __LINE__, \ - log, level, tag, __VA_ARGS__); \ - } \ - } while (0) - - #define TEN_LOG_WRITE_MEM_AUX(log, level, tag, mem, size, ...) \ - do { \ - if (TEN_LOG_ON(level)) { \ - ten_log_write_mem_aux_d(_TEN_LOG_SRC_LOC_FUNCTION, __FILE__, __LINE__, \ - log, level, tag, mem, size, __VA_ARGS__); \ - } \ - } while (0) -#endif - -TEN_UNUSED static void ten_log_unused(const int dummy, ...) { (void)dummy; } - -#define TEN_LOG_UNUSED(...) \ - do { \ - _TEN_LOG_NEVER ten_log_unused(0, __VA_ARGS__); \ - } while (0) - -#if TEN_LOG_ENABLED_VERBOSE - #define TEN_LOGV(...) \ - TEN_LOG_WRITE(TEN_LOG_VERBOSE, _TEN_LOG_TAG, __VA_ARGS__) - #define TEN_LOGV_AUX(log, ...) \ - TEN_LOG_WRITE_AUX(log, TEN_LOG_VERBOSE, _TEN_LOG_TAG, __VA_ARGS__) - #define TEN_LOGV_MEM(mem, size, ...) \ - TEN_LOG_WRITE_MEM(TEN_LOG_VERBOSE, _TEN_LOG_TAG, mem, size, __VA_ARGS__) - #define TEN_LOGV_MEM_AUX(log, mem, size, ...) \ - TEN_LOG_WRITE_MEM(log, TEN_LOG_VERBOSE, _TEN_LOG_TAG, mem, size, \ - __VA_ARGS__) -#else - #define TEN_LOGV(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGV_AUX(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGV_MEM(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGV_MEM_AUX(...) TEN_LOG_UNUSED(__VA_ARGS__) -#endif - -#if TEN_LOG_ENABLED_DEBUG - #define TEN_LOGD(...) TEN_LOG_WRITE(TEN_LOG_DEBUG, _TEN_LOG_TAG, __VA_ARGS__) - #define TEN_LOGD_AUX(log, ...) \ - TEN_LOG_WRITE_AUX(log, TEN_LOG_DEBUG, _TEN_LOG_TAG, __VA_ARGS__) - #define TEN_LOGD_MEM(mem, size, ...) \ - TEN_LOG_WRITE_MEM(TEN_LOG_DEBUG, _TEN_LOG_TAG, mem, size, __VA_ARGS__) - #define TEN_LOGD_MEM_AUX(log, mem, size, ...) \ - TEN_LOG_WRITE_MEM_AUX(log, TEN_LOG_DEBUG, _TEN_LOG_TAG, mem, size, \ - __VA_ARGS__) -#else - #define TEN_LOGD(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGD_AUX(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGD_MEM(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGD_MEM_AUX(...) TEN_LOG_UNUSED(__VA_ARGS__) -#endif - -#if TEN_LOG_ENABLED_INFO - #define TEN_LOGI(...) TEN_LOG_WRITE(TEN_LOG_INFO, _TEN_LOG_TAG, __VA_ARGS__) - #define TEN_LOGI_AUX(log, ...) \ - TEN_LOG_WRITE_AUX(log, TEN_LOG_INFO, _TEN_LOG_TAG, __VA_ARGS__) - #define TEN_LOGI_MEM(mem, size, ...) \ - TEN_LOG_WRITE_MEM(TEN_LOG_INFO, _TEN_LOG_TAG, mem, size, __VA_ARGS__) - #define TEN_LOGI_MEM_AUX(log, mem, size, ...) \ - TEN_LOG_WRITE_MEM_AUX(log, TEN_LOG_INFO, _TEN_LOG_TAG, mem, size, \ - __VA_ARGS__) -#else - #define TEN_LOGI(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGI_AUX(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGI_MEM(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGI_MEM_AUX(...) TEN_LOG_UNUSED(__VA_ARGS__) -#endif - -#if TEN_LOG_ENABLED_WARN - #define TEN_LOGW(...) TEN_LOG_WRITE(TEN_LOG_WARN, _TEN_LOG_TAG, __VA_ARGS__) - #define TEN_LOGW_AUX(log, ...) \ - TEN_LOG_WRITE_AUX(log, TEN_LOG_WARN, _TEN_LOG_TAG, __VA_ARGS__) - #define TEN_LOGW_MEM(mem, size, ...) \ - TEN_LOG_WRITE_MEM(TEN_LOG_WARN, _TEN_LOG_TAG, mem, size, __VA_ARGS__) - #define TEN_LOGW_MEM_AUX(log, mem, size, ...) \ - TEN_LOG_WRITE_MEM_AUX(log, TEN_LOG_WARN, _TEN_LOG_TAG, mem, size, \ - __VA_ARGS__) -#else - #define TEN_LOGW(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGW_AUX(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGW_MEM(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGW_MEM_AUX(...) TEN_LOG_UNUSED(__VA_ARGS__) -#endif - -#if TEN_LOG_ENABLED_ERROR - #define TEN_LOGE(...) TEN_LOG_WRITE(TEN_LOG_ERROR, _TEN_LOG_TAG, __VA_ARGS__) - #define TEN_LOGE_AUX(log, ...) \ - TEN_LOG_WRITE_AUX(log, TEN_LOG_ERROR, _TEN_LOG_TAG, __VA_ARGS__) - #define TEN_LOGE_MEM(mem, size, ...) \ - TEN_LOG_WRITE_MEM(TEN_LOG_ERROR, _TEN_LOG_TAG, mem, size, __VA_ARGS__) - #define TEN_LOGE_MEM_AUX(log, mem, size, ...) \ - TEN_LOG_WRITE_MEM_AUX(log, TEN_LOG_ERROR, _TEN_LOG_TAG, mem, size, \ - __VA_ARGS__) -#else - #define TEN_LOGE(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGE_AUX(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGE_MEM(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGE_MEM_AUX(...) TEN_LOG_UNUSED(__VA_ARGS__) -#endif - -#if TEN_LOG_ENABLED_FATAL - #define TEN_LOGF(...) TEN_LOG_WRITE(TEN_LOG_FATAL, _TEN_LOG_TAG, __VA_ARGS__) - #define TEN_LOGF_AUX(log, ...) \ - TEN_LOG_WRITE_AUX(log, TEN_LOG_FATAL, _TEN_LOG_TAG, __VA_ARGS__) - #define TEN_LOGF_MEM(mem, size, ...) \ - TEN_LOG_WRITE_MEM(TEN_LOG_FATAL, _TEN_LOG_TAG, mem, size, __VA_ARGS__) - #define TEN_LOGF_MEM_AUX(log, mem, size, ...) \ - TEN_LOG_WRITE_MEM_AUX(log, TEN_LOG_FATAL, _TEN_LOG_TAG, mem, size, \ - __VA_ARGS__) -#else - #define TEN_LOGF(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGF_AUX(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGF_MEM(...) TEN_LOG_UNUSED(__VA_ARGS__) - #define TEN_LOGF_MEM_AUX(...) TEN_LOG_UNUSED(__VA_ARGS__) -#endif - -#define TEN_LOGV_STR(s) TEN_LOGV("%s", (s)) -#define TEN_LOGD_STR(s) TEN_LOGD("%s", (s)) -#define TEN_LOGI_STR(s) TEN_LOGI("%s", (s)) -#define TEN_LOGW_STR(s) TEN_LOGW("%s", (s)) -#define TEN_LOGE_STR(s) TEN_LOGE("%s", (s)) -#define TEN_LOGF_STR(s) TEN_LOGF("%s", (s)) - -/** - * @brief Predefined spec for stderr. Uses global format options - * (TEN_LOG_GLOBAL_FORMAT) and TEN_LOG_OUT_STDERR. Could be used to force output - * to stderr for a particular message. Example: - * - * f = fopen("foo.log", "w"); - * if (!f) { - * TEN_LOGE_AUX(TEN_LOG_STDERR, "Failed to open log file"); - * } - */ -#define TEN_LOG_STDERR (&ten_log_stderr_spec) - -typedef enum TEN_LOG_LEVEL { - TEN_LOG_NONE, - - TEN_LOG_VERBOSE, - TEN_LOG_DEBUG, - TEN_LOG_INFO, - TEN_LOG_WARN, - TEN_LOG_ERROR, - TEN_LOG_FATAL, -} TEN_LOG_LEVEL; - -/** - * @brief Put mask is a set of flags that define what fields will be added to - * each log message. Default value is TEN_LOG_PUT_STD and other flags could be - * used to alter its behavior. See ten_log_set_output_v() for more details. - * - * Note about TEN_LOG_PUT_SRC: it will be added only in debug builds (NDEBUG is - * not defined). - */ -typedef enum TEN_LOG_PUT { - TEN_LOG_PUT_CTX = 1 << 0, /* context (time, pid, tid, log level) */ - TEN_LOG_PUT_TAG = 1 << 1, /* tag (including tag prefix) */ - TEN_LOG_PUT_SRC = 1 << 2, /* source location (file, line, function) */ - TEN_LOG_PUT_MSG = 1 << 3, /* message text (formatted string) */ - TEN_LOG_PUT_STD = 0xffff, /* everything (default) */ -} TEN_LOG_PUT; - -typedef struct ten_log_message_t { - TEN_LOG_LEVEL level; /* Log level of the message */ - const char *tag; /* Associated tag (without tag prefix) */ - - char *buf_start; /* Buffer start */ - /* Buffer end (last position where EOL with 0 could be written) */ - char *buf_end; - char *buf_content_end; /* Buffer content end (append position) */ - - char *tag_start; /* Prefixed tag start */ - /* Prefixed tag end (if != tag_start, points to msg separator) */ - char *tag_end; - - char *msg_start; /* Message start (expanded format string) */ -} ten_log_message_t; - -/** - * @brief Format options. For more details see ten_log_set_mem_width(). - */ -typedef struct ten_log_format_t { - bool is_allocated; - - size_t mem_width; /* Bytes per line in memory (ASCII-HEX) dump */ -} ten_log_format_t; - -/** - * @brief Type of output callback function. It will be called for each log line - * allowed by both "current" and "output" log levels ("enabled" and "turned - * on"). Callback function is allowed to modify content of the buffers pointed - * by the msg, but it's not allowed to modify any of msg fields. Buffer pointed - * by msg is UTF-8 encoded (no BOM mark). - */ -typedef void (*ten_log_output_func_t)(const ten_log_message_t *msg, void *arg); - -typedef void (*ten_log_close_func_t)(void *arg); - -/** - * @brief Output facility. - */ -typedef struct ten_log_output_t { - bool is_allocated; - - uint64_t mask; // What to put into log line buffer (see TEN_LOG_PUT_XXX) - - ten_log_output_func_t output_cb; // Output callback function - ten_log_close_func_t close_cb; - void *arg; // User provided output callback argument -} ten_log_output_t; - -/** - * @brief Used with _AUX macros and allows to override global format and output - * facility. Use TEN_LOG_GLOBAL_FORMAT and TEN_LOG_GLOBAL_OUTPUT for values from - * global configuration. Example: - * - * static const ten_log_output_t module_output = { - * TEN_LOG_PUT_STD, 0, custom_output_callback - * }; - * static const ten_log_t module_spec = { - * TEN_LOG_SIGNATURE, - * TEN_LOG_GLOBAL_FORMAT, - * &module_output, - * }; - * TEN_LOGI_AUX(&module_spec, "Position: %ix%i", x, y); - * - * See TEN_LOGF_AUX and TEN_LOGF_MEM_AUX for details. - */ -typedef struct ten_log_t { - ten_signature_t signature; - - ten_log_format_t *format; - ten_log_output_t *output; -} ten_log_t; - -#ifdef __cplusplus -extern "C" { -#endif - -TEN_UTILS_API const char *ten_log_tag_prefix; -TEN_UTILS_API ten_log_format_t ten_log_global_format; -TEN_UTILS_API ten_log_output_t ten_log_global_output; -TEN_UTILS_API TEN_LOG_LEVEL ten_log_global_output_level; -TEN_UTILS_API const ten_log_t ten_log_stderr_spec; - -TEN_UTILS_PRIVATE_API bool ten_log_check_integrity(ten_log_t *self); - -TEN_UTILS_API void ten_log_init(ten_log_t *log); - -TEN_UTILS_API ten_log_t *ten_log_create(void); - -TEN_UTILS_API void ten_log_destroy(ten_log_t *log); - -TEN_UTILS_API void ten_log_format_init(ten_log_format_t *format, - size_t mem_width); - -TEN_UTILS_API ten_log_format_t *ten_log_format_create(size_t mem_width); - -TEN_UTILS_API void ten_log_format_destroy(ten_log_format_t *format); - -TEN_UTILS_API void ten_log_output_init(ten_log_output_t *output, uint64_t mask, - ten_log_output_func_t output_cb, - ten_log_close_func_t close_cb, - void *arg); - -TEN_UTILS_API ten_log_output_t *ten_log_output_create( - uint64_t mask, ten_log_output_func_t output_cb, - ten_log_close_func_t close_cb, void *arg); - -TEN_UTILS_API void ten_log_output_destroy(ten_log_output_t *output); - -/** - * @brief Set tag prefix. Prefix will be separated from the tag with dot - * ('.'). Use NULL or empty string to disable (default). Common use is to - * set it to the process (or build target) name (e.g. to separate client and - * server processes). Function will NOT copy provided prefix string, but - * will store the pointer. Hence specified prefix string must remain valid. - * See TEN_LOG_DEFINE_TAG_PREFIX for a way to set it before entering main() - * function. See TEN_LOG_TAG for more information about tag and tag prefix. - */ -TEN_UTILS_API void ten_log_set_tag_prefix(const char *prefix); - -/** - * @brief Set number of bytes per log line in memory (ASCII-HEX) output. - * Example: - * - * I hello.MAIN 4c6f72656d20697073756d20646f6c6f Lorem ipsum dolo - * |<- w bytes ->| |<- w chars ->| - * - * See TEN_LOGF_MEM and TEN_LOGF_MEM_AUX for more details. - */ -TEN_UTILS_API void ten_log_set_mem_width(size_t width); - -/** - * @brief Set "output" log level. See TEN_LOG_LEVEL and TEN_LOG_OUTPUT_LEVEL for - * more info about log levels. - */ -TEN_UTILS_API void ten_log_set_output_level(TEN_LOG_LEVEL level); - -/** - * @brief Set output callback function. - * - * Mask allows to control what information will be added to the log line buffer - * before callback function is invoked. Default mask value is TEN_LOG_PUT_STD. - */ -TEN_UTILS_API void ten_log_set_output_v(uint64_t mask, - ten_log_output_func_t output_cb, - ten_log_close_func_t close_cb, - void *arg); -TEN_UNUSED static void ten_log_set_output_p(const ten_log_output_t *output) { - ten_log_set_output_v(output->mask, output->output_cb, output->close_cb, - output->arg); -} - -TEN_UTILS_API void ten_log_set_output_to_file(const char *log_path); - -TEN_UTILS_API void ten_log_set_output_to_file_aux(ten_log_t *log, - const char *log_path); - -TEN_UTILS_API void ten_log_set_output_to_stderr(void); - -TEN_UTILS_API void ten_log_set_output_to_stderr_aux(ten_log_t *log); - -TEN_UTILS_API void ten_log_save_output_spec(ten_log_output_t *output); - -TEN_UTILS_API void ten_log_restore_output_spec(ten_log_output_t *output); - -TEN_UTILS_API void ten_log_close(void); - -TEN_UTILS_API void ten_log_close_aux(ten_log_t *self); - -TEN_UTILS_API void ten_log_vwrite_d(const char *func, const char *file, - size_t line, TEN_LOG_LEVEL level, - const char *tag, const char *fmt, - va_list va); - -TEN_UTILS_API void ten_log_write_d(const char *func, const char *file, - size_t line, TEN_LOG_LEVEL level, - const char *tag, const char *fmt, ...) - _TEN_LOG_PRINTFLIKE(6, 7); - -TEN_UTILS_API void ten_log_write_aux_d(const char *func_name, - const char *file_name, size_t line, - const ten_log_t *log, - TEN_LOG_LEVEL level, const char *tag, - const char *fmt, ...) - _TEN_LOG_PRINTFLIKE(7, 8); - -TEN_UTILS_API void ten_log_write(TEN_LOG_LEVEL level, const char *tag, - const char *fmt, ...) - _TEN_LOG_PRINTFLIKE(3, 4); - -TEN_UTILS_API void ten_log_write_aux(const ten_log_t *log, TEN_LOG_LEVEL level, - const char *tag, const char *fmt, ...) - _TEN_LOG_PRINTFLIKE(4, 5); - -TEN_UTILS_API void ten_log_write_mem_d(const char *func_name, - const char *file_name, size_t line, - TEN_LOG_LEVEL level, const char *tag, - void *buf, size_t buf_size, - const char *fmt, ...) - _TEN_LOG_PRINTFLIKE(8, 9); - -TEN_UTILS_API void ten_log_write_mem_aux_d(const char *func_name, - const char *file_name, size_t line, - ten_log_t *log, TEN_LOG_LEVEL level, - const char *tag, void *buf, - size_t buf_size, const char *fmt, - ...) _TEN_LOG_PRINTFLIKE(9, 10); - -TEN_UTILS_API void ten_log_write_mem(TEN_LOG_LEVEL level, const char *tag, - void *buf, size_t buf_size, - const char *fmt, ...) - _TEN_LOG_PRINTFLIKE(5, 6); - -TEN_UTILS_API void ten_log_write_mem_aux(ten_log_t *log, TEN_LOG_LEVEL level, - const char *tag, void *buf, - size_t buf_size, const char *fmt, ...) - _TEN_LOG_PRINTFLIKE(6, 7); - -TEN_UTILS_API const ten_log_t *ten_log_get_global_spec(void); - -#ifdef __cplusplus -} -#endif diff --git a/core/include/ten_utils/macro/check.h b/core/include/ten_utils/macro/check.h deleted file mode 100644 index 512c89359f..0000000000 --- a/core/include/ten_utils/macro/check.h +++ /dev/null @@ -1,64 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include -#include // IWYU pragma: keep -#include // IWYU pragma: keep - -#include "ten_utils/backtrace/backtrace.h" // IWYU pragma: keep -#include "ten_utils/log/log.h" -#include "ten_utils/ten_config.h" - -#if defined(__has_feature) - #if __has_feature(address_sanitizer) - #define TEN_USE_ASAN - #endif -#endif - -#if defined(__SANITIZE_ADDRESS__) - #define TEN_USE_ASAN -#endif - -#if defined(TEN_PRODUCTION) - -// Remove all protections in the final production release. - - #define TEN_ASSERT(expr, fmt, ...) \ - do { \ - } while (0) - -#else // TEN_PRODUCTION - - #ifndef NDEBUG - - #define TEN_ASSERT(expr, fmt, ...) \ - do { \ - /* NOLINTNEXTLINE(readability-simplify-boolean-expr)*/ \ - if (!(expr)) { \ - TEN_LOGE(fmt, ##__VA_ARGS__); \ - ten_backtrace_dump_global(0); \ - /* NOLINTNEXTLINE */ \ - assert(0); \ - } \ - } while (0) - - #else // NDEBUG - - // Enable minimal protection if the optimization is enabled. - - #define TEN_ASSERT(expr, fmt, ...) \ - do { \ - if (!(expr)) { \ - TEN_LOGE(fmt, ##__VA_ARGS__); \ - ten_backtrace_dump_global(0); \ - abort(); \ - } \ - } while (0) - - #endif // NDEBUG - -#endif // TEN_PRODUCTION diff --git a/core/include_internal/ten_runtime/binding/go/internal/common.h b/core/include_internal/ten_runtime/binding/go/internal/common.h index fc6ac5881d..7129984b13 100644 --- a/core/include_internal/ten_runtime/binding/go/internal/common.h +++ b/core/include_internal/ten_runtime/binding/go/internal/common.h @@ -22,19 +22,21 @@ TEN_RUNTIME_PRIVATE_API void ten_go_handle_array_destroy( TEN_RUNTIME_PRIVATE_API char *ten_go_str_dup(const char *str); -TEN_RUNTIME_PRIVATE_API void ten_go_bridge_destroy_c_part(ten_go_bridge_t *self); +TEN_RUNTIME_PRIVATE_API void ten_go_bridge_destroy_c_part( + ten_go_bridge_t *self); -TEN_RUNTIME_PRIVATE_API void ten_go_bridge_destroy_go_part(ten_go_bridge_t *self); +TEN_RUNTIME_PRIVATE_API void ten_go_bridge_destroy_go_part( + ten_go_bridge_t *self); -TEN_RUNTIME_PRIVATE_API void ten_go_status_init_with_errno(ten_go_status_t *self, - ten_errno_t errno); +TEN_RUNTIME_PRIVATE_API void ten_go_status_init_with_errno( + ten_go_status_t *self, ten_errno_t errno); TEN_RUNTIME_PRIVATE_API void ten_go_status_from_error(ten_go_status_t *self, - ten_error_t *err); + ten_error_t *err); TEN_RUNTIME_PRIVATE_API void ten_go_status_set_errno(ten_go_status_t *self, - ten_errno_t errno); + ten_errno_t errno); TEN_RUNTIME_PRIVATE_API void ten_go_status_set(ten_go_status_t *self, - ten_errno_t errno, - const char *msg); + ten_errno_t errno, + const char *msg); diff --git a/core/include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h b/core/include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h index a1e42ea944..c35ac2f50c 100644 --- a/core/include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h +++ b/core/include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h @@ -18,18 +18,18 @@ #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/rwlock.h" -#define TEN_GO_TEN_IS_ALIVE_REGION_BEGIN(ten_bridge, err_stmt) \ - do { \ - ten_rwlock_lock((ten_bridge)->lock, 1); \ - if (((ten_bridge)->c_ten == NULL) || \ - (((ten_bridge)->c_ten->attach_to != TEN_ENV_ATTACH_TO_ADDON) && \ - ((ten_bridge)->c_ten_proxy == NULL))) { \ - ten_rwlock_unlock((ten_bridge)->lock, 1); \ - { \ - err_stmt \ - } \ - goto ten_is_close; \ - } \ +#define TEN_GO_TEN_IS_ALIVE_REGION_BEGIN(ten_bridge, err_stmt) \ + do { \ + ten_rwlock_lock((ten_bridge)->lock, 1); \ + if (((ten_bridge)->c_ten_env == NULL) || \ + (((ten_bridge)->c_ten_env->attach_to != TEN_ENV_ATTACH_TO_ADDON) && \ + ((ten_bridge)->c_ten_env_proxy == NULL))) { \ + ten_rwlock_unlock((ten_bridge)->lock, 1); \ + { \ + err_stmt \ + } \ + goto ten_is_close; \ + } \ } while (0) #define TEN_GO_TEN_IS_ALIVE_REGION_END(ten_bridge) \ diff --git a/core/include_internal/ten_runtime/common/log.h b/core/include_internal/ten_runtime/common/log.h index b8f846eff5..04a13aaf9f 100644 --- a/core/include_internal/ten_runtime/common/log.h +++ b/core/include_internal/ten_runtime/common/log.h @@ -7,4 +7,4 @@ #include "ten_runtime/ten_config.h" -#define DEFAULT_LOG_LEVEL TEN_LOG_WARN +#define DEFAULT_LOG_OUTPUT_LEVEL TEN_LOG_LEVEL_WARN diff --git a/core/include_internal/ten_runtime/extension_thread/extension_thread.h b/core/include_internal/ten_runtime/extension_thread/extension_thread.h index 9bcc7525e7..966219b454 100644 --- a/core/include_internal/ten_runtime/extension_thread/extension_thread.h +++ b/core/include_internal/ten_runtime/extension_thread/extension_thread.h @@ -7,7 +7,7 @@ #include "ten_runtime/ten_config.h" -#include "include_internal/ten_utils/log/new.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/container/list.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/error.h" @@ -81,8 +81,6 @@ typedef struct ten_extension_thread_t { ten_extension_context_t *extension_context; ten_runloop_t *runloop; - - ten_log_new_t log; } ten_extension_thread_t; TEN_RUNTIME_API bool ten_extension_thread_not_call_by_me( diff --git a/core/src/ten_runtime/global/global.h b/core/include_internal/ten_runtime/global/global.h similarity index 100% rename from core/src/ten_runtime/global/global.h rename to core/include_internal/ten_runtime/global/global.h diff --git a/core/include_internal/ten_runtime/msg/cmd_base/cmd_result/cmd.h b/core/include_internal/ten_runtime/msg/cmd_base/cmd_result/cmd.h index be58e544fe..29bd1da35a 100644 --- a/core/include_internal/ten_runtime/msg/cmd_base/cmd_result/cmd.h +++ b/core/include_internal/ten_runtime/msg/cmd_base/cmd_result/cmd.h @@ -13,6 +13,7 @@ #include "ten_runtime/common/status_code.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/smart_ptr.h" +#include "ten_utils/macro/mark.h" #define TEN_CMD_STATUS_SIGNATURE 0x9EAF798217CDEC8DU diff --git a/core/include_internal/ten_runtime/msg/msg.h b/core/include_internal/ten_runtime/msg/msg.h index bef39bde79..5f1c6b4809 100644 --- a/core/include_internal/ten_runtime/msg/msg.h +++ b/core/include_internal/ten_runtime/msg/msg.h @@ -8,9 +8,9 @@ #include "ten_runtime/ten_config.h" #include "include_internal/ten_runtime/common/loc.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/container/list.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" #define TEN_MSG_SIGNATURE 0xA9FA53F77185F856U diff --git a/core/include_internal/ten_runtime/protocol/asynced/protocol_asynced.h b/core/include_internal/ten_runtime/protocol/asynced/protocol_asynced.h index 7620faf73e..519c8f7615 100644 --- a/core/include_internal/ten_runtime/protocol/asynced/protocol_asynced.h +++ b/core/include_internal/ten_runtime/protocol/asynced/protocol_asynced.h @@ -98,7 +98,7 @@ typedef struct ten_protocol_asynced_t { /** * The ten_protocol_asynced_t is an underlying resource of the base protocol. * - * @note All protocol instances are created and inited in the ten world, + * @note All protocol instances are created and initted in the ten world, * including this 'ten_protocol_asynced_t'. So this 'closeable' belongs to the * ten world, and the underlying resource (ex: this closeable) and its owner * (ex: the base protocol) must be in the same thread. diff --git a/core/include_internal/ten_runtime/ten_env/log.h b/core/include_internal/ten_runtime/ten_env/log.h index 14ed9a020b..5f8021510e 100644 --- a/core/include_internal/ten_runtime/ten_env/log.h +++ b/core/include_internal/ten_runtime/ten_env/log.h @@ -7,19 +7,21 @@ #include "ten_runtime/ten_config.h" -#include "include_internal/ten_utils/log/new.h" +#include "include_internal/ten_utils/log/log.h" typedef struct ten_env_t ten_env_t; -TEN_RUNTIME_API void ten_env_log(ten_env_t *self, TEN_LOG_NEW_LEVEL level, +TEN_RUNTIME_API void ten_env_log(ten_env_t *self, TEN_LOG_LEVEL level, const char *func_name, const char *file_name, size_t line_no, const char *msg); -TEN_RUNTIME_API void ten_env_log_formatted( - ten_env_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, - const char *file_name, size_t line_no, const char *fmt, ...); +TEN_RUNTIME_API void ten_env_log_formatted(ten_env_t *self, TEN_LOG_LEVEL level, + const char *func_name, + const char *file_name, + size_t line_no, const char *fmt, + ...); TEN_RUNTIME_API void ten_env_log_with_size_formatted( - ten_env_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, + ten_env_t *self, TEN_LOG_LEVEL level, const char *func_name, size_t func_name_len, const char *file_name, size_t file_name_len, size_t line_no, const char *fmt, ...); diff --git a/core/include_internal/ten_runtime/ten_env/ten_env.h b/core/include_internal/ten_runtime/ten_env/ten_env.h index 5a95c0cdb9..e9fe101c1f 100644 --- a/core/include_internal/ten_runtime/ten_env/ten_env.h +++ b/core/include_internal/ten_runtime/ten_env/ten_env.h @@ -9,10 +9,10 @@ #include "include_internal/ten_runtime/addon/addon.h" #include "include_internal/ten_runtime/binding/common.h" -#include "include_internal/ten_utils/log/new.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/io/runloop.h" -#include "ten_utils/macro/check.h" #define TEN_SIGNATURE 0x1336D348DA779EA6U @@ -72,8 +72,6 @@ typedef struct ten_env_t { ten_destroy_handler_in_target_lang_func_t destroy_handler; ten_list_t ten_proxy_list; - - ten_log_new_t log; } ten_env_t; TEN_RUNTIME_PRIVATE_API ten_runloop_t *ten_env_get_attached_runloop( diff --git a/core/include/ten_utils/backtrace/backtrace.h b/core/include_internal/ten_utils/backtrace/backtrace.h similarity index 100% rename from core/include/ten_utils/backtrace/backtrace.h rename to core/include_internal/ten_utils/backtrace/backtrace.h diff --git a/core/src/ten_utils/backtrace/common.h b/core/include_internal/ten_utils/backtrace/common.h similarity index 90% rename from core/src/ten_utils/backtrace/common.h rename to core/include_internal/ten_utils/backtrace/common.h index 976a998f82..6114ece288 100644 --- a/core/src/ten_utils/backtrace/common.h +++ b/core/include_internal/ten_utils/backtrace/common.h @@ -7,12 +7,9 @@ #include "ten_utils/ten_config.h" -#include "ten_utils/backtrace/backtrace.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" typedef struct ten_backtrace_common_t { - ten_log_t *log; // The log used to dump the backtrace. - ten_backtrace_dump_file_line_func_t dump_cb; ten_backtrace_error_func_t error_cb; void *cb_data; // The user-defined argument to the above callback functions. diff --git a/core/src/ten_utils/backtrace/platform/posix/config.h b/core/include_internal/ten_utils/backtrace/platform/posix/config.h similarity index 62% rename from core/src/ten_utils/backtrace/platform/posix/config.h rename to core/include_internal/ten_utils/backtrace/platform/posix/config.h index d994ca89f8..88d29f2061 100644 --- a/core/src/ten_utils/backtrace/platform/posix/config.h +++ b/core/include_internal/ten_utils/backtrace/platform/posix/config.h @@ -9,10 +9,10 @@ #if defined(OS_LINUX) || defined(OS_ANDROID) - #include "linux/config_linux.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/config_linux.h" #elif defined(OS_MACOS) - #include "darwin/config_mac.h" +#include "include_internal/ten_utils/backtrace/platform/posix/darwin/config_mac.h" #endif diff --git a/core/src/ten_utils/backtrace/platform/posix/darwin/config_mac.h b/core/include_internal/ten_utils/backtrace/platform/posix/darwin/config_mac.h similarity index 94% rename from core/src/ten_utils/backtrace/platform/posix/darwin/config_mac.h rename to core/include_internal/ten_utils/backtrace/platform/posix/darwin/config_mac.h index a1bd2aabe6..f3a31535d3 100644 --- a/core/src/ten_utils/backtrace/platform/posix/darwin/config_mac.h +++ b/core/include_internal/ten_utils/backtrace/platform/posix/darwin/config_mac.h @@ -24,5 +24,5 @@ /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE - #define _DARWIN_USE_64_BIT_INODE 1 +#define _DARWIN_USE_64_BIT_INODE 1 #endif diff --git a/core/src/ten_utils/backtrace/platform/posix/internal.h b/core/include_internal/ten_utils/backtrace/platform/posix/internal.h similarity index 94% rename from core/src/ten_utils/backtrace/platform/posix/internal.h rename to core/include_internal/ten_utils/backtrace/platform/posix/internal.h index 42297cfbdd..e6620bb365 100644 --- a/core/src/ten_utils/backtrace/platform/posix/internal.h +++ b/core/include_internal/ten_utils/backtrace/platform/posix/internal.h @@ -10,15 +10,16 @@ #include "ten_utils/ten_config.h" -#include "ten_utils/backtrace/backtrace.h" -#include "ten_utils/backtrace/common.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/backtrace/common.h" #include "ten_utils/lib/atomic.h" +#include "ten_utils/macro/mark.h" #ifndef __GNUC__ - #define __builtin_prefetch(p, r, l) - #define unlikely(x) (x) +#define __builtin_prefetch(p, r, l) +#define unlikely(x) (x) #else - #define unlikely(x) __builtin_expect(!!(x), 0) +#define unlikely(x) __builtin_expect(!!(x), 0) #endif /** diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/config_linux.h b/core/include_internal/ten_utils/backtrace/platform/posix/linux/config_linux.h similarity index 100% rename from core/src/ten_utils/backtrace/platform/posix/linux/config_linux.h rename to core/include_internal/ten_utils/backtrace/platform/posix/linux/config_linux.h diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/crc32.h b/core/include_internal/ten_utils/backtrace/platform/posix/linux/crc32.h similarity index 90% rename from core/src/ten_utils/backtrace/platform/posix/linux/crc32.h rename to core/include_internal/ten_utils/backtrace/platform/posix/linux/crc32.h index 813ecf7747..0683d947e4 100644 --- a/core/src/ten_utils/backtrace/platform/posix/linux/crc32.h +++ b/core/include_internal/ten_utils/backtrace/platform/posix/linux/crc32.h @@ -8,7 +8,7 @@ // #include "ten_utils/ten_config.h" -#include "ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" TEN_UTILS_PRIVATE_API uint32_t elf_crc32(uint32_t crc, const unsigned char *buf, size_t len); diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/debugfile.h b/core/include_internal/ten_utils/backtrace/platform/posix/linux/debugfile.h similarity index 91% rename from core/src/ten_utils/backtrace/platform/posix/linux/debugfile.h rename to core/include_internal/ten_utils/backtrace/platform/posix/linux/debugfile.h index 55daa0cf69..2488cd7657 100644 --- a/core/src/ten_utils/backtrace/platform/posix/linux/debugfile.h +++ b/core/include_internal/ten_utils/backtrace/platform/posix/linux/debugfile.h @@ -8,7 +8,7 @@ // #include "ten_utils/ten_config.h" -#include "ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" TEN_UTILS_PRIVATE_API int elf_open_debug_file_by_build_id( ten_backtrace_t *self, const char *build_id_data, size_t build_id_size); diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/elf.h b/core/include_internal/ten_utils/backtrace/platform/posix/linux/elf.h similarity index 91% rename from core/src/ten_utils/backtrace/platform/posix/linux/elf.h rename to core/include_internal/ten_utils/backtrace/platform/posix/linux/elf.h index c89f1b54b0..efbf8d8321 100644 --- a/core/src/ten_utils/backtrace/platform/posix/linux/elf.h +++ b/core/include_internal/ten_utils/backtrace/platform/posix/linux/elf.h @@ -8,8 +8,6 @@ // #include "ten_utils/ten_config.h" -#include "ten_utils/backtrace/backtrace.h" - TEN_UTILS_PRIVATE_API int elf_fetch_bits(const unsigned char **ppin, const unsigned char *pinend, uint64_t *pval, unsigned int *pbits); diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/uncompress.h b/core/include_internal/ten_utils/backtrace/platform/posix/linux/uncompress.h similarity index 100% rename from core/src/ten_utils/backtrace/platform/posix/linux/uncompress.h rename to core/include_internal/ten_utils/backtrace/platform/posix/linux/uncompress.h diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/view.h b/core/include_internal/ten_utils/backtrace/platform/posix/linux/view.h similarity index 95% rename from core/src/ten_utils/backtrace/platform/posix/linux/view.h rename to core/include_internal/ten_utils/backtrace/platform/posix/linux/view.h index bcacf14ccc..7a9f0e958e 100644 --- a/core/src/ten_utils/backtrace/platform/posix/linux/view.h +++ b/core/include_internal/ten_utils/backtrace/platform/posix/linux/view.h @@ -10,7 +10,7 @@ #include -#include "ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" #include "ten_utils/io/mmap.h" /** diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/zlib.h b/core/include_internal/ten_utils/backtrace/platform/posix/linux/zlib.h similarity index 100% rename from core/src/ten_utils/backtrace/platform/posix/linux/zlib.h rename to core/include_internal/ten_utils/backtrace/platform/posix/linux/zlib.h diff --git a/core/src/ten_utils/io/general/transport/backend/uv/stream/migrate.h b/core/include_internal/ten_utils/io/general/transport/backend/uv/stream/migrate.h similarity index 100% rename from core/src/ten_utils/io/general/transport/backend/uv/stream/migrate.h rename to core/include_internal/ten_utils/io/general/transport/backend/uv/stream/migrate.h diff --git a/core/src/ten_utils/io/general/transport/backend/uv/stream/pipe.h b/core/include_internal/ten_utils/io/general/transport/backend/uv/stream/pipe.h similarity index 100% rename from core/src/ten_utils/io/general/transport/backend/uv/stream/pipe.h rename to core/include_internal/ten_utils/io/general/transport/backend/uv/stream/pipe.h diff --git a/core/src/ten_utils/io/general/transport/backend/uv/stream/tcp.h b/core/include_internal/ten_utils/io/general/transport/backend/uv/stream/tcp.h similarity index 100% rename from core/src/ten_utils/io/general/transport/backend/uv/stream/tcp.h rename to core/include_internal/ten_utils/io/general/transport/backend/uv/stream/tcp.h diff --git a/core/include_internal/ten_utils/log/buffer.h b/core/include_internal/ten_utils/log/buffer.h deleted file mode 100644 index 6327d5be3f..0000000000 --- a/core/include_internal/ten_utils/log/buffer.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -#include - -#if defined(__linux__) - #include -#elif defined(__MACH__) - #include -#endif - -#include "include_internal/ten_utils/log/eol.h" -#include "ten_utils/log/log.h" - -/** - * @brief Size of the log line buffer. The buffer is allocated on stack. It - * limits maximum length of a log line. - */ -#ifndef TEN_LOG_BUF_SZ - #if defined(OS_MACOS) - #define TEN_LOG_BUF_SZ 512 - #else - // OPTIMIZE(Wei): Use a smaller value. - #define TEN_LOG_BUF_SZ 4096 - #endif -#endif - -static_assert(TEN_LOG_EOL_SZ < TEN_LOG_BUF_SZ, "eol_sz_less_than_buf_sz"); - -#if !defined(_WIN32) && !defined(_WIN64) -static_assert(TEN_LOG_BUF_SZ <= PIPE_BUF, "buf_sz_less_than_pipe_buf"); -#endif - -typedef void (*buffer_cb)(ten_log_message_t *msg, char *buf); - -TEN_UTILS_PRIVATE_API buffer_cb g_buffer_cb; - -TEN_UTILS_PRIVATE_API void buffer_callback(ten_log_message_t *msg, char *buf); diff --git a/core/include_internal/ten_utils/log/dump.h b/core/include_internal/ten_utils/log/dump.h deleted file mode 100644 index 543cb528a0..0000000000 --- a/core/include_internal/ten_utils/log/dump.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -#include - -#include "internal.h" -#include "ten_utils/lib/buf.h" -#include "ten_utils/log/log.h" - -TEN_UTILS_PRIVATE_API void ten_log_write_imp(const ten_log_t *log, - const ten_log_src_location_t *src, - const ten_buf_t *mem, - TEN_LOG_LEVEL level, - const char *tag, const char *fmt, - va_list va); diff --git a/core/include_internal/ten_utils/log/eol.h b/core/include_internal/ten_utils/log/eol.h deleted file mode 100644 index 57c875c79d..0000000000 --- a/core/include_internal/ten_utils/log/eol.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -#include - -/** - * @brief String to put in the end of each log line (can be empty). Its value - * used by stderr output callback. Its size used as a default value for - * TEN_LOG_EOL_SZ. - */ -#ifndef TEN_LOG_EOL - #define TEN_LOG_EOL "\n" -#endif - -/** - * @brief Number of bytes to reserve for EOL in the log line buffer (must be - * >0). Must be larger than or equal to length of TEN_LOG_EOL with terminating - * null. - */ -#ifndef TEN_LOG_EOL_SZ - #define TEN_LOG_EOL_SZ sizeof(TEN_LOG_EOL) -#endif diff --git a/core/include_internal/ten_utils/log/format.h b/core/include_internal/ten_utils/log/format.h deleted file mode 100644 index fdfe00cd48..0000000000 --- a/core/include_internal/ten_utils/log/format.h +++ /dev/null @@ -1,464 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -/** - * @brief Fields that can be used in log message format specifications. - * Mentioning them here explicitly, so we know that nobody else defined them - * before us. See TEN_LOG_MESSAGE_CTX_FORMAT for details. - */ -#define YEAR YEAR -#define MONTH MONTH -#define DAY DAY -#define MINUTE MINUTE -#define SECOND SECOND -#define MILLISECOND MILLISECOND -#define PID PID -#define TID TID -#define LEVEL LEVEL -#define TAG(prefix_delim, tag_delim) TAG(prefix_delim, tag_delim) -#define FUNCTION FUNCTION -#define FILENAME FILENAME -#define FILELINE FILELINE -#define S(str) S(str) -#define F_INIT(statements) F_INIT(statements) -#define F_UINT(width, value) F_UINT(width, value) - -#define _PP_PASTE_2(a, b) a##b -#define _PP_CONCAT_2(a, b) _PP_PASTE_2(a, b) - -#define _PP_PASTE_3(a, b, c) a##b##c -#define _PP_CONCAT_3(a, b, c) _PP_PASTE_3(a, b, c) - -#define _PP_ID(x) x - -/** - * @brief Get the number of the arguments. - * - * @note Microsoft C preprocessor is a piece of shit. This moron treats - * __VA_ARGS__ as a single token and requires additional expansion to realize - * that it's actually a list. If not for it, there would be no need in this - * extra expansion. - */ -#define _PP_NARGS_N(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, \ - _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, \ - _24, ...) \ - _24 -#define _PP_NARGS(...) \ - _PP_ID(_PP_NARGS_N(__VA_ARGS__, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, \ - 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)) - -/** - * @brief Get the 1st argument. - * - * @a xs must be enclosed into additional "()". - * - * @note There is a more efficient way to implement this, but it requires - * working C preprocessor. Unfortunately, Microsoft Visual Studio doesn't have - * one. - */ -#define _PP_HEAD__(x, ...) x -#define _PP_HEAD_(...) _PP_ID(_PP_HEAD__(__VA_ARGS__, ~)) -#define _PP_HEAD(xs) _PP_HEAD_ xs - -/** - * @brief Remove the 1st argument. - * - * @a xs must be enclosed into additional "()". - */ -#define _PP_TAIL_(x, ...) (__VA_ARGS__) -#define _PP_TAIL(xs) _PP_TAIL_ xs - -/** - * @brief Remove the enclosing "()". - * - * @a xs must be enclosed into additional "()". - */ -#define _PP_UNTUPLE_(...) __VA_ARGS__ -#define _PP_UNTUPLE(xs) _PP_UNTUPLE_ xs - -/** - * @brief F_INIT field support. All possible fields must be mentioned here. - * - * Ex: - * - '#define _TEN_LOG_MESSAGE_FORMAT_INIT__YEAR' means no special handling is - * needed for 'YEAR' - * - * - '#define _TEN_LOG_MESSAGE_FORMAT_INIT__F_INIT(expr) _PP_UNTUPLE(expr);' - * means if there is any 'F_init(expr)' in the format specifications, then the - * 'expr' will be flattened. - */ -#define _TEN_LOG_MESSAGE_FORMAT_INIT__ -#define _TEN_LOG_MESSAGE_FORMAT_INIT__YEAR -#define _TEN_LOG_MESSAGE_FORMAT_INIT__MONTH -#define _TEN_LOG_MESSAGE_FORMAT_INIT__DAY -#define _TEN_LOG_MESSAGE_FORMAT_INIT__HOUR -#define _TEN_LOG_MESSAGE_FORMAT_INIT__MINUTE -#define _TEN_LOG_MESSAGE_FORMAT_INIT__SECOND -#define _TEN_LOG_MESSAGE_FORMAT_INIT__MILLISECOND -#define _TEN_LOG_MESSAGE_FORMAT_INIT__PID -#define _TEN_LOG_MESSAGE_FORMAT_INIT__TID -#define _TEN_LOG_MESSAGE_FORMAT_INIT__LEVEL -#define _TEN_LOG_MESSAGE_FORMAT_INIT__TAG(ps, ts) -#define _TEN_LOG_MESSAGE_FORMAT_INIT__FUNCTION -#define _TEN_LOG_MESSAGE_FORMAT_INIT__FILENAME -#define _TEN_LOG_MESSAGE_FORMAT_INIT__FILELINE -#define _TEN_LOG_MESSAGE_FORMAT_INIT__S(s) -#define _TEN_LOG_MESSAGE_FORMAT_INIT__F_INIT(expr) _PP_UNTUPLE(expr); -#define _TEN_LOG_MESSAGE_FORMAT_INIT__F_UINT(w, v) -#define _TEN_LOG_MESSAGE_FORMAT_INIT(field) \ - _PP_CONCAT_3(_TEN_LOG_MESSAGE_FORMAT_INIT_, _, field) - -/** - * @brief Used to implement _TEN_LOG_MESSAGE_FORMAT_CONTAINS() macro. All - * possible fields must be mentioned here. Not counting F_INIT() here because - * it's somewhat special and is handled separately (at least for now). - */ -#define _TEN_LOG_MESSAGE_FORMAT_MASK__ (0 << 0) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__YEAR (1 << 1) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__MONTH (1 << 2) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__DAY (1 << 3) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__HOUR (1 << 4) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__MINUTE (1 << 5) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__SECOND (1 << 6) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__MILLISECOND (1 << 7) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__PID (1 << 8) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__TID (1 << 9) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__LEVEL (1 << 10) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__TAG(ps, ts) (1 << 11) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__FUNCTION (1 << 12) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__FILENAME (1 << 13) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__FILELINE (1 << 14) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__S(s) (1 << 15) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__F_INIT(expr) (0 << 16) -#define _TEN_LOG_MESSAGE_FORMAT_MASK__F_UINT(w, v) (1 << 17) -#define _TEN_LOG_MESSAGE_FORMAT_MASK(field) \ - _PP_CONCAT_3(_TEN_LOG_MESSAGE_FORMAT_MASK_, _, field) - -/** - * @brief Logical "or" of masks of fields used in specified format - * specification. - */ -#define _TEN_LOG_MESSAGE_FORMAT_FIELDS(format) \ - (0 _PP_MAP(| _TEN_LOG_MESSAGE_FORMAT_MASK, format)) - -/** - * @brief Apply function macro to each element in tuple. Output is not - * enforced to be a tuple. - * - * @a f function macro - * @a xs must be enclosed into additional "()". - * - * @note the X of _PP_MAP_X means the amount of the arguments. - */ -#define _PP_MAP_1(f, xs) f(_PP_HEAD(xs)) -#define _PP_MAP_2(f, xs) f(_PP_HEAD(xs)) _PP_MAP_1(f, _PP_TAIL(xs)) -#define _PP_MAP_3(f, xs) f(_PP_HEAD(xs)) _PP_MAP_2(f, _PP_TAIL(xs)) -#define _PP_MAP_4(f, xs) f(_PP_HEAD(xs)) _PP_MAP_3(f, _PP_TAIL(xs)) -#define _PP_MAP_5(f, xs) f(_PP_HEAD(xs)) _PP_MAP_4(f, _PP_TAIL(xs)) -#define _PP_MAP_6(f, xs) f(_PP_HEAD(xs)) _PP_MAP_5(f, _PP_TAIL(xs)) -#define _PP_MAP_7(f, xs) f(_PP_HEAD(xs)) _PP_MAP_6(f, _PP_TAIL(xs)) -#define _PP_MAP_8(f, xs) f(_PP_HEAD(xs)) _PP_MAP_7(f, _PP_TAIL(xs)) -#define _PP_MAP_9(f, xs) f(_PP_HEAD(xs)) _PP_MAP_8(f, _PP_TAIL(xs)) -#define _PP_MAP_10(f, xs) f(_PP_HEAD(xs)) _PP_MAP_9(f, _PP_TAIL(xs)) -#define _PP_MAP_11(f, xs) f(_PP_HEAD(xs)) _PP_MAP_10(f, _PP_TAIL(xs)) -#define _PP_MAP_12(f, xs) f(_PP_HEAD(xs)) _PP_MAP_11(f, _PP_TAIL(xs)) -#define _PP_MAP_13(f, xs) f(_PP_HEAD(xs)) _PP_MAP_12(f, _PP_TAIL(xs)) -#define _PP_MAP_14(f, xs) f(_PP_HEAD(xs)) _PP_MAP_13(f, _PP_TAIL(xs)) -#define _PP_MAP_15(f, xs) f(_PP_HEAD(xs)) _PP_MAP_14(f, _PP_TAIL(xs)) -#define _PP_MAP_16(f, xs) f(_PP_HEAD(xs)) _PP_MAP_15(f, _PP_TAIL(xs)) -#define _PP_MAP_17(f, xs) f(_PP_HEAD(xs)) _PP_MAP_16(f, _PP_TAIL(xs)) -#define _PP_MAP_18(f, xs) f(_PP_HEAD(xs)) _PP_MAP_17(f, _PP_TAIL(xs)) -#define _PP_MAP_19(f, xs) f(_PP_HEAD(xs)) _PP_MAP_18(f, _PP_TAIL(xs)) -#define _PP_MAP_20(f, xs) f(_PP_HEAD(xs)) _PP_MAP_19(f, _PP_TAIL(xs)) -#define _PP_MAP_21(f, xs) f(_PP_HEAD(xs)) _PP_MAP_20(f, _PP_TAIL(xs)) -#define _PP_MAP_22(f, xs) f(_PP_HEAD(xs)) _PP_MAP_21(f, _PP_TAIL(xs)) -#define _PP_MAP_23(f, xs) f(_PP_HEAD(xs)) _PP_MAP_22(f, _PP_TAIL(xs)) -#define _PP_MAP_24(f, xs) f(_PP_HEAD(xs)) _PP_MAP_23(f, _PP_TAIL(xs)) -#define _PP_MAP(f, xs) _PP_CONCAT_2(_PP_MAP_, _PP_NARGS xs)(f, xs) - -/** - * @brief Apply function macro to each element in tuple in reverse order. - * Output is not enforced to be a tuple. - * - * @a f function macro - * @a xs must be enclosed into additional "()". - * - * @note the X of _PP_RMAP_X means the amount of the arguments. - */ -#define _PP_RMAP_1(f, xs) f(_PP_HEAD(xs)) -#define _PP_RMAP_2(f, xs) _PP_RMAP_1(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_3(f, xs) _PP_RMAP_2(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_4(f, xs) _PP_RMAP_3(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_5(f, xs) _PP_RMAP_4(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_6(f, xs) _PP_RMAP_5(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_7(f, xs) _PP_RMAP_6(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_8(f, xs) _PP_RMAP_7(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_9(f, xs) _PP_RMAP_8(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_10(f, xs) _PP_RMAP_9(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_11(f, xs) _PP_RMAP_10(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_12(f, xs) _PP_RMAP_11(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_13(f, xs) _PP_RMAP_12(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_14(f, xs) _PP_RMAP_13(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_15(f, xs) _PP_RMAP_14(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_16(f, xs) _PP_RMAP_15(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_17(f, xs) _PP_RMAP_16(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_18(f, xs) _PP_RMAP_17(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_19(f, xs) _PP_RMAP_18(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_20(f, xs) _PP_RMAP_19(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_21(f, xs) _PP_RMAP_20(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_22(f, xs) _PP_RMAP_21(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_23(f, xs) _PP_RMAP_22(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP_24(f, xs) _PP_RMAP_23(f, _PP_TAIL(xs)) f(_PP_HEAD(xs)) -#define _PP_RMAP(f, xs) _PP_CONCAT_2(_PP_RMAP_, _PP_NARGS xs)(f, xs) - -#define PUT_CSTR_R(ptr, STR) \ - do { \ - for (size_t i = sizeof(STR) - 1; 0 < i--;) { \ - *--(ptr) = (STR)[i]; \ - } \ - } while (0) - -/** - * @brief Implements generation of put_xxx_r statements for log message - * specification. - */ -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__ -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__YEAR \ - ptr = put_uint_r(tm.tm_year + 1900, 4, '0', ptr); -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__MONTH \ - ptr = put_uint_r((uint64_t)tm.tm_mon + 1, 2, '0', ptr); -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__DAY \ - ptr = put_uint_r((uint64_t)tm.tm_mday, 2, '0', ptr); -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__HOUR \ - ptr = put_uint_r((uint64_t)tm.tm_hour, 2, '0', ptr); -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__MINUTE \ - ptr = put_uint_r((uint64_t)tm.tm_min, 2, '0', ptr); -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__SECOND \ - ptr = put_uint_r((uint64_t)tm.tm_sec, 2, '0', ptr); -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__MILLISECOND \ - ptr = put_uint_r(msec, 3, '0', ptr); -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__PID ptr = put_int_r(pid, 5, ' ', ptr); -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__TID ptr = put_int_r(tid, 5, ' ', ptr); -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__LEVEL \ - *--ptr = ten_log_level_char(log_msg->level); -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__TAG UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__FUNCTION UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__FILENAME UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__FILELINE UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__S(s) PUT_CSTR_R(ptr, s); -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__F_INIT(expr) -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R__F_UINT(width, value) \ - ptr = put_uint_r(value, width, ' ', ptr); -#define _TEN_LOG_MESSAGE_FORMAT_PUT_R(field) \ - _PP_CONCAT_3(_TEN_LOG_MESSAGE_FORMAT_PUT_R_, _, field) - -#define PUT_CSTR_CHECKED(ptr, end, STR) \ - do { \ - for (size_t i = 0; (end) > (ptr) && (sizeof(STR) - 1) > i; ++i) { \ - *(ptr)++ = (STR)[i]; \ - } \ - } while (0) - -#define PUT_TAG(log_msg, tag, prefix_delim, tag_delim) \ - do { \ - const char *ch; \ - log_msg->tag_start = log_msg->buf_content_end; \ - \ - /* Dump tag prefix if specified. */ \ - ch = ten_log_tag_prefix; \ - if (0 != ch) { \ - for (; log_msg->buf_end != log_msg->buf_content_end && \ - 0 != (*log_msg->buf_content_end = *ch); \ - ++log_msg->buf_content_end, ++ch) { \ - } \ - } \ - \ - ch = tag; \ - if (0 != ch && 0 != tag[0]) { \ - if (log_msg->tag_start != log_msg->buf_content_end) { \ - /* Dump tag prefix delimeter if specified. */ \ - PUT_CSTR_CHECKED(log_msg->buf_content_end, log_msg->buf_end, \ - prefix_delim); \ - } \ - /* Dump tag itself if specified. */ \ - for (; log_msg->buf_end != log_msg->buf_content_end && \ - 0 != (*log_msg->buf_content_end = *ch); \ - ++log_msg->buf_content_end, ++ch) { \ - } \ - } \ - \ - /* Dump tag delimeter if specified. */ \ - log_msg->tag_end = log_msg->buf_content_end; \ - if (log_msg->tag_start != log_msg->buf_content_end) { \ - PUT_CSTR_CHECKED(log_msg->buf_content_end, log_msg->buf_end, tag_delim); \ - } \ - } while (0) - -/** - * @brief Implements simple put statements for log message specification. - */ -#define _TEN_LOG_MESSAGE_FORMAT_PUT__ -#define _TEN_LOG_MESSAGE_FORMAT_PUT__YEAR UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT__MONTH UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT__DAY UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT__HOUR UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT__MINUTE UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT__SECOND UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT__MILLISECOND UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT__PID UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT__TID UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT__LEVEL UNDEFINED -#define _TEN_LOG_MESSAGE_FORMAT_PUT__TAG(prefix_delim, tag_delim) \ - PUT_TAG(log_msg, tag, prefix_delim, tag_delim); -#define _TEN_LOG_MESSAGE_FORMAT_PUT__FUNCTION \ - log_msg->buf_content_end = \ - put_string(funcname(src_loc->func_name), log_msg->buf_content_end, \ - log_msg->buf_end); -#define _TEN_LOG_MESSAGE_FORMAT_PUT__FILENAME \ - log_msg->buf_content_end = \ - put_string(filename(src_loc->file_name), log_msg->buf_content_end, \ - log_msg->buf_end); -#define _TEN_LOG_MESSAGE_FORMAT_PUT__FILELINE \ - log_msg->buf_content_end = put_uint( \ - src_loc->line, 0, '\0', log_msg->buf_content_end, log_msg->buf_end); -#define _TEN_LOG_MESSAGE_FORMAT_PUT__S(str) \ - PUT_CSTR_CHECKED(log_msg->buf_content_end, log_msg->buf_end, str); -#define _TEN_LOG_MESSAGE_FORMAT_PUT__F_INIT(expr) -#define _TEN_LOG_MESSAGE_FORMAT_PUT__F_UINT(width, value) \ - log_msg->buf_content_end = \ - put_uint(value, width, ' ', log_msg->buf_content_end, log_msg->buf_end); -#define _TEN_LOG_MESSAGE_FORMAT_PUT(field) \ - _PP_CONCAT_3(_TEN_LOG_MESSAGE_FORMAT_PUT_, _, field) - -/** - * @brief Expands to expressions that evaluates to true if field is used in - * specified format specification. Example: - * - * #if _TEN_LOG_MESSAGE_FORMAT_CONTAINS(F_UINT, TEN_LOG_MESSAGE_CTX_FORMAT) - * ... - * #endif - */ -#define _TEN_LOG_MESSAGE_FORMAT_CONTAINS(field, format) \ - (_TEN_LOG_MESSAGE_FORMAT_MASK(field) & _TEN_LOG_MESSAGE_FORMAT_FIELDS(format)) - -#define _TEN_LOG_MESSAGE_FORMAT_DATETIME_USED \ - (_TEN_LOG_MESSAGE_FORMAT_CONTAINS(YEAR, TEN_LOG_MESSAGE_CTX_FORMAT) || \ - _TEN_LOG_MESSAGE_FORMAT_CONTAINS(MONTH, TEN_LOG_MESSAGE_CTX_FORMAT) || \ - _TEN_LOG_MESSAGE_FORMAT_CONTAINS(DAY, TEN_LOG_MESSAGE_CTX_FORMAT) || \ - _TEN_LOG_MESSAGE_FORMAT_CONTAINS(HOUR, TEN_LOG_MESSAGE_CTX_FORMAT) || \ - _TEN_LOG_MESSAGE_FORMAT_CONTAINS(MINUTE, TEN_LOG_MESSAGE_CTX_FORMAT) || \ - _TEN_LOG_MESSAGE_FORMAT_CONTAINS(SECOND, TEN_LOG_MESSAGE_CTX_FORMAT) || \ - _TEN_LOG_MESSAGE_FORMAT_CONTAINS(MILLISECOND, TEN_LOG_MESSAGE_CTX_FORMAT)) - -/** - * @brief Default delimiter that separates parts of log message. Can NOT contain - * '%' or '\0'. - * - * Log message format specifications can override (or ignore) this value. For - * more details see TEN_LOG_MESSAGE_CTX_FORMAT, TEN_LOG_MESSAGE_SRC_FORMAT and - * TEN_LOG_MESSAGE_TAG_FORMAT. - */ -#ifndef TEN_LOG_DEF_DELIMITER - #define TEN_LOG_DEF_DELIMITER " " -#endif - -/** - * @brief Specifies log message context format. Log message context includes - * date, time, process id, thread id and message's log level. Custom information - * can be added as well. Supported fields: YEAR, MONTH, DAY, HOUR, MINUTE, - * SECOND, MILLISECOND, PID, TID, LEVEL, S(str), F_INIT(statements), - * F_UINT(width, value). - * - * Must be defined as a tuple, for example: - * - * #define TEN_LOG_MESSAGE_CTX_FORMAT (YEAR, S("."), MONTH, S("."), DAY, S(" > - * ")) - * - * In that case, resulting log message will be: - * - * 2016.12.22 > TAG function@filename.c:line Message text - * - * Note, that tag, source location and message text are not impacted by - * this setting. See TEN_LOG_MESSAGE_TAG_FORMAT and TEN_LOG_MESSAGE_SRC_FORMAT. - * - * If message context must be visually separated from the rest of the message, - * it must be reflected in context format (notice trailing S(" > ") in the - * example above). - * - * S(str) adds constant string str. String can NOT contain '%' or '\0'. - * - * F_INIT(statements) adds initialization statement(s) that will be evaluated - * once for each log message. All statements are evaluated in specified order. - * Several F_INIT() fields can be used in every log message format - * specification. Fields, like F_UINT(width, value), are allowed to use results - * of initialization statements. If statement introduces variables (or other - * names, like structures) they must be prefixed with "f_". Statements must be - * enclosed into additional "()". Example: - * - * #define TEN_LOG_MESSAGE_CTX_FORMAT \ - * (F_INIT(( struct rusage f_ru; getrusage(RUSAGE_SELF, &f_ru); )), \ - * YEAR, S("."), MONTH, S("."), DAY, S(" "), \ - * F_UINT(5, f_ru.ru_nsignals), \ - * S(" ")) - * - * F_UINT(width, value) adds unsigned integer value extended with up to width - * spaces (for alignment purposes). Value can be any expression that evaluates - * to unsigned integer. If expression contains non-standard functions, they - * must be declared with F_INIT(). Example: - * - * #define TEN_LOG_MESSAGE_CTX_FORMAT \ - * (YEAR, S("."), MONTH, S("."), DAY, S(" "), \ - * F_INIT(( unsigned tickcount(); )), \ - * F_UINT(5, tickcount()), \ - * S(" ")) - * - * Other log message format specifications follow same rules, but have a - * different set of supported fields. - */ -#ifndef TEN_LOG_MESSAGE_CTX_FORMAT - #define TEN_LOG_MESSAGE_CTX_FORMAT \ - (MONTH, S("-"), DAY, S(TEN_LOG_DEF_DELIMITER), HOUR, S(":"), MINUTE, \ - S(":"), SECOND, S("."), MILLISECOND, S(TEN_LOG_DEF_DELIMITER), PID, \ - S(TEN_LOG_DEF_DELIMITER), TID, S(TEN_LOG_DEF_DELIMITER), LEVEL, \ - S(TEN_LOG_DEF_DELIMITER)) -#endif - -/** - * @brief Specifies log message tag format. It includes tag prefix and tag. - * Custom information can be added as well. Supported fields: - * TAG(prefix_delimiter, tag_delimiter), S(str), F_INIT(statements), - * F_UINT(width, value). - * - * TAG(prefix_delimiter, tag_delimiter) adds following string to log message: - * - * PREFIXTAG - * - * Prefix delimiter will be used only when prefix is not empty. Tag delimiter - * will be used only when prefixed tag is not empty. Example: - * - * #define TEN_LOG_MESSAGE_TAG_FORMAT (S("["), TAG(".", ""), S("] ")) - * - * See TEN_LOG_MESSAGE_CTX_FORMAT for details. - */ -#ifndef TEN_LOG_MESSAGE_TAG_FORMAT - #define TEN_LOG_MESSAGE_TAG_FORMAT (TAG(".", TEN_LOG_DEF_DELIMITER)) -#endif - -/** - * @brief Specifies log message source location format. It includes function - * name, file name and file line. Custom information can be added as well. - * Supported fields: FUNCTION, FILENAME, FILELINE, S(str), F_INIT(statements), - * F_UINT(width, value). - * - * See TEN_LOG_MESSAGE_CTX_FORMAT for details. - */ -#ifndef TEN_LOG_MESSAGE_SRC_FORMAT - #define TEN_LOG_MESSAGE_SRC_FORMAT \ - (FUNCTION, S("@"), FILENAME, S(":"), FILELINE, S(TEN_LOG_DEF_DELIMITER)) -#endif diff --git a/core/include_internal/ten_utils/log/internal.h b/core/include_internal/ten_utils/log/internal.h deleted file mode 100644 index 560e7a2d31..0000000000 --- a/core/include_internal/ten_utils/log/internal.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include -#include -#include - -#include "ten_utils/ten_config.h" - -typedef struct ten_log_src_location_t { - const char *func_name; - const char *file_name; - const size_t line; -} ten_log_src_location_t; - -typedef enum TEN_SIGN { - TEN_SIGN_NEGATIVE = -1, - TEN_SIGN_ZERO = 0, - TEN_SIGN_POSITIVE = 1 -} TEN_SIGN; diff --git a/core/include_internal/ten_utils/log/level.h b/core/include_internal/ten_utils/log/level.h index 0db8d7b220..96244a01ec 100644 --- a/core/include_internal/ten_utils/log/level.h +++ b/core/include_internal/ten_utils/log/level.h @@ -7,23 +7,9 @@ #include "ten_utils/ten_config.h" -#include "ten_utils/log/log.h" - -/** - * @brief When defined, ten_log library will not contain definition of global - * output level variable. In that case it must be defined elsewhere using - * TEN_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL macro, for example: - * - * TEN_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL = TEN_LOG_WARN; - * - * This allows to specify custom value for static initialization and avoid - * overhead of setting this value in runtime. - */ -#ifdef TEN_LOG_EXTERN_GLOBAL_OUTPUT_LEVEL - #undef TEN_LOG_EXTERN_GLOBAL_OUTPUT_LEVEL - #define TEN_LOG_EXTERN_GLOBAL_OUTPUT_LEVEL 1 -#else - #define TEN_LOG_EXTERN_GLOBAL_OUTPUT_LEVEL 0 -#endif +#include "include_internal/ten_utils/log/log.h" TEN_UTILS_PRIVATE_API char ten_log_level_char(TEN_LOG_LEVEL level); + +TEN_UTILS_PRIVATE_API void ten_log_set_output_level(ten_log_t *self, + TEN_LOG_LEVEL level); diff --git a/core/include_internal/ten_utils/log/log.h b/core/include_internal/ten_utils/log/log.h new file mode 100644 index 0000000000..05d6bbf64b --- /dev/null +++ b/core/include_internal/ten_utils/log/log.h @@ -0,0 +1,184 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#pragma once + +#include "ten_utils/ten_config.h" + +#include +#include +#include + +#include "ten_utils/lib/signature.h" + +#define TEN_LOG_SIGNATURE 0xC0EE0CE92149D61AU + +#define TEN_LOGV(...) \ + do { \ + if (ten_global_log.output_level <= TEN_LOG_LEVEL_VERBOSE) { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_VERBOSE, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGD(...) \ + do { \ + if (ten_global_log.output_level <= TEN_LOG_LEVEL_DEBUG) { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_DEBUG, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGI(...) \ + do { \ + if (ten_global_log.output_level <= TEN_LOG_LEVEL_INFO) { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_INFO, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGW(...) \ + do { \ + if (ten_global_log.output_level <= TEN_LOG_LEVEL_WARN) { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_WARN, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGE(...) \ + do { \ + if (ten_global_log.output_level <= TEN_LOG_LEVEL_ERROR) { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_ERROR, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGF(...) \ + do { \ + if (ten_global_log.output_level <= TEN_LOG_LEVEL_FATAL) { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_FATAL, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGV_AUX(log, ...) \ + do { \ + if ((log)->output_level <= TEN_LOG_LEVEL_VERBOSE) { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_VERBOSE, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGD_AUX(log, ...) \ + do { \ + if ((log)->output_level <= TEN_LOG_LEVEL_DEBUG) { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_DEBUG, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGI_AUX(log, ...) \ + do { \ + if ((log)->output_level <= TEN_LOG_LEVEL_INFO) { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_INFO, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGW_AUX(log, ...) \ + do { \ + if ((log)->output_level <= TEN_LOG_LEVEL_WARN) { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_WARN, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGE_AUX(log, ...) \ + do { \ + if ((log)->output_level <= TEN_LOG_LEVEL_ERROR) { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_ERROR, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGF_AUX(log, ...) \ + do { \ + if ((log)->output_level <= TEN_LOG_LEVEL_FATAL) { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_FATAL, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +typedef enum TEN_LOG_LEVEL { + TEN_LOG_LEVEL_INVALID, + + TEN_LOG_LEVEL_VERBOSE, + TEN_LOG_LEVEL_DEBUG, + TEN_LOG_LEVEL_INFO, + TEN_LOG_LEVEL_WARN, + TEN_LOG_LEVEL_ERROR, + TEN_LOG_LEVEL_FATAL, +} TEN_LOG_LEVEL; + +typedef struct ten_string_t ten_string_t; + +typedef void (*ten_log_output_func_t)(ten_string_t *msg, void *user_data); +typedef void (*ten_log_close_func_t)(void *user_data); + +typedef struct ten_log_output_t { + ten_log_output_func_t output_cb; + ten_log_close_func_t close_cb; + void *user_data; +} ten_log_output_t; + +typedef struct ten_log_t { + ten_signature_t signature; + + TEN_LOG_LEVEL output_level; + ten_log_output_t output; +} ten_log_t; + +TEN_UTILS_API ten_log_t ten_global_log; + +TEN_UTILS_PRIVATE_API bool ten_log_check_integrity(ten_log_t *self); + +TEN_UTILS_API void ten_log_init(ten_log_t *self); + +TEN_UTILS_PRIVATE_API ten_log_t *ten_log_create(void); + +TEN_UTILS_API void ten_log_deinit(ten_log_t *self); + +TEN_UTILS_PRIVATE_API void ten_log_destroy(ten_log_t *self); + +TEN_UTILS_API void ten_log_log_formatted(ten_log_t *self, TEN_LOG_LEVEL level, + const char *func_name, + const char *file_name, size_t line_no, + const char *fmt, ...); + +TEN_UTILS_API void ten_log_log_with_size_from_va_list( + ten_log_t *self, TEN_LOG_LEVEL level, const char *func_name, + size_t func_name_len, const char *file_name, size_t file_name_len, + size_t line_no, const char *fmt, va_list ap); + +TEN_UTILS_API void ten_log_log_from_va_list( + ten_log_t *self, TEN_LOG_LEVEL level, const char *func_name, + const char *file_name, size_t line_no, const char *fmt, va_list ap); + +TEN_UTILS_API void ten_log_log(ten_log_t *self, TEN_LOG_LEVEL level, + const char *func_name, const char *file_name, + size_t line_no, const char *msg); + +TEN_UTILS_PRIVATE_API void ten_log_log_with_size( + ten_log_t *self, TEN_LOG_LEVEL level, const char *func_name, + size_t func_name_len, const char *file_name, size_t file_name_len, + size_t line_no, const char *msg, size_t msg_len); + +TEN_UTILS_API void ten_log_global_init(void); + +TEN_UTILS_API void ten_log_global_deinit(void); + +TEN_UTILS_API void ten_log_global_set_output_level(TEN_LOG_LEVEL level); + +TEN_UTILS_API void ten_log_global_set_output_to_file(const char *log_path); diff --git a/core/include_internal/ten_utils/log/log_fmt.h b/core/include_internal/ten_utils/log/log_fmt.h deleted file mode 100644 index 69f60a1c7a..0000000000 --- a/core/include_internal/ten_utils/log/log_fmt.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -/** - * @brief When defined, ten_log library will not contain definition of global - * format variable. In that case it must be defined elsewhere using - * TEN_LOG_DEFINE_GLOBAL_FORMAT macro, for example: - * - * TEN_LOG_DEFINE_GLOBAL_FORMAT = {MEM_WIDTH}; - * - * This allows to specify custom value for static initialization and avoid - * overhead of setting this value in runtime. - */ -#ifdef TEN_LOG_EXTERN_GLOBAL_FORMAT - #undef TEN_LOG_EXTERN_GLOBAL_FORMAT - #define TEN_LOG_EXTERN_GLOBAL_FORMAT 1 -#else - #define TEN_LOG_EXTERN_GLOBAL_FORMAT 0 -#endif - -/** - * @brief Default number of bytes in one line of memory output. For large values - * TEN_LOG_BUF_SZ also must be increased. - */ -#ifndef TEN_LOG_MEM_WIDTH - #define TEN_LOG_MEM_WIDTH 32 -#endif diff --git a/core/include_internal/ten_utils/log/new.h b/core/include_internal/ten_utils/log/new.h deleted file mode 100644 index 16b2dfaa8d..0000000000 --- a/core/include_internal/ten_utils/log/new.h +++ /dev/null @@ -1,67 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -#include -#include -#include - -#include "ten_utils/lib/signature.h" - -#define TEN_LOG_NEW_SIGNATURE 0xC0EE0CE92149D61AU - -typedef enum TEN_LOG_NEW_LEVEL { - TEN_LOG_NEW_INVALID, - - TEN_LOG_NEW_VERBOSE, - TEN_LOG_NEW_DEBUG, - TEN_LOG_NEW_INFO, - TEN_LOG_NEW_WARN, - TEN_LOG_NEW_ERROR, - TEN_LOG_NEW_FATAL, -} TEN_LOG_NEW_LEVEL; - -typedef struct ten_log_new_t { - ten_signature_t signature; -} ten_log_new_t; - -#define TEN_LOG_NEW(log, level, fmt, ...) \ - ten_log_new_log_formatted(log, level, __func__, __FILE__, __LINE__, fmt, \ - ##__VA_ARGS__) - -TEN_UTILS_PRIVATE_API bool ten_log_new_check_integrity(ten_log_new_t *self); - -TEN_UTILS_API void ten_log_new_init(ten_log_new_t *self); - -TEN_UTILS_PRIVATE_API ten_log_new_t *ten_log_new_create(void); - -TEN_UTILS_API void ten_log_new_deinit(ten_log_new_t *self); - -TEN_UTILS_PRIVATE_API void ten_log_new_destroy(ten_log_new_t *self); - -TEN_UTILS_API void ten_log_new_log_formatted( - ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, - const char *file_name, size_t line_no, const char *fmt, ...); - -TEN_UTILS_API void ten_log_new_log_with_size_from_va_list( - ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, - size_t func_name_len, const char *file_name, size_t file_name_len, - size_t line_no, const char *fmt, va_list ap); - -TEN_UTILS_API void ten_log_new_log_from_va_list( - ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, - const char *file_name, size_t line_no, const char *fmt, va_list ap); - -TEN_UTILS_API void ten_log_new_log(ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, - const char *func_name, const char *file_name, - size_t line_no, const char *msg); - -TEN_UTILS_PRIVATE_API void ten_log_new_log_with_size( - ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, - size_t func_name_len, const char *file_name, size_t file_name_len, - size_t line_no, const char *msg, size_t msg_len); diff --git a/core/include_internal/ten_utils/log/new_level.h b/core/include_internal/ten_utils/log/new_level.h deleted file mode 100644 index efe0514d75..0000000000 --- a/core/include_internal/ten_utils/log/new_level.h +++ /dev/null @@ -1,12 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -#include "include_internal/ten_utils/log/new.h" - -TEN_UTILS_PRIVATE_API char ten_log_new_level_char(TEN_LOG_NEW_LEVEL level); diff --git a/core/include_internal/ten_utils/log/new_pid.h b/core/include_internal/ten_utils/log/new_pid.h deleted file mode 100644 index 62a44811c0..0000000000 --- a/core/include_internal/ten_utils/log/new_pid.h +++ /dev/null @@ -1,12 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -#include - -TEN_UTILS_PRIVATE_API void ten_log_new_get_pid_tid(int64_t *pid, int64_t *tid); diff --git a/core/include_internal/ten_utils/log/new_time.h b/core/include_internal/ten_utils/log/new_time.h deleted file mode 100644 index 7a34469098..0000000000 --- a/core/include_internal/ten_utils/log/new_time.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -#include - -#include "ten_utils/lib/string.h" - -TEN_UTILS_PRIVATE_API void ten_log_new_get_time(struct tm *time_info, - size_t *msec); - -TEN_UTILS_PRIVATE_API void ten_log_new_add_time_string(ten_string_t *buf, - struct tm *time_info, - size_t msec); diff --git a/core/include_internal/ten_utils/log/new_time_cache.h b/core/include_internal/ten_utils/log/new_time_cache.h deleted file mode 100644 index 7d32623dbf..0000000000 --- a/core/include_internal/ten_utils/log/new_time_cache.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -#include -#include - -#if !defined(_WIN32) && !defined(_WIN64) - - #include - #include - - #if defined(__linux__) - #include - #elif defined(__MACH__) - #include - #endif - -TEN_UTILS_PRIVATE_API bool ten_log_new_time_cache_get(const struct timeval *tv, - struct tm *tm); - -TEN_UTILS_PRIVATE_API void ten_log_new_time_cache_set(const struct timeval *tv, - struct tm *tm); - -#endif diff --git a/core/include_internal/ten_utils/log/output.h b/core/include_internal/ten_utils/log/output.h new file mode 100644 index 0000000000..be5cc101df --- /dev/null +++ b/core/include_internal/ten_utils/log/output.h @@ -0,0 +1,26 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#pragma once + +#include "ten_utils/ten_config.h" + +/** + * @brief String to put in the end of each log line (can be empty). + */ +#ifndef TEN_LOG_EOL +#define TEN_LOG_EOL "\n" +#endif + +typedef struct ten_log_t ten_log_t; +typedef struct ten_string_t ten_string_t; + +TEN_UTILS_API void ten_log_set_output_to_stderr(ten_log_t *self); + +TEN_UTILS_PRIVATE_API void ten_log_out_stderr_cb(ten_string_t *msg, + void *user_data); + +TEN_UTILS_PRIVATE_API void ten_log_set_output_to_file(ten_log_t *self, + const char *log_path); diff --git a/core/include_internal/ten_utils/log/platform/general/log.h b/core/include_internal/ten_utils/log/platform/general/log.h deleted file mode 100644 index d5b256f5be..0000000000 --- a/core/include_internal/ten_utils/log/platform/general/log.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -#include "ten_utils/log/log.h" - -#define TEN_LOG_OUT_STDERR \ - false, TEN_LOG_OUT_STDERR_MASK, ten_log_out_stderr_cb, NULL, NULL - -/** - * @brief Output to standard error stream. Library uses it by default, though in - * few cases it could be necessary to specify it explicitly. For example, when - * ten_log library is compiled with TEN_LOG_EXTERN_GLOBAL_OUTPUT, application - * must define and initialize global output variable: - * - * TEN_LOG_DEFINE_GLOBAL_OUTPUT = {TEN_LOG_OUT_STDERR}; - * - * Another example is when using custom output, stderr could be used as a - * fallback when custom output facility failed to initialize: - * - * ten_log_set_output_v(TEN_LOG_OUT_STDERR); - */ -enum { TEN_LOG_OUT_STDERR_MASK = TEN_LOG_PUT_STD }; - -TEN_UTILS_PRIVATE_API void ten_log_out_stderr_cb(const ten_log_message_t *msg, - void *arg); - -TEN_UTILS_PRIVATE_API void ten_log_out_file_cb(const ten_log_message_t *msg, - void *arg); diff --git a/core/include_internal/ten_utils/log/platform/mac/log.h b/core/include_internal/ten_utils/log/platform/mac/log.h deleted file mode 100644 index 0a3d3d2b50..0000000000 --- a/core/include_internal/ten_utils/log/platform/mac/log.h +++ /dev/null @@ -1,40 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -/** - * @brief When defined, NSLog (uses Apple System Log) will be used instead of - * stderr (ignored on non-Apple platforms). Date, time, pid and tid (context) - * will be provided by NSLog. Curiously, doesn't use NSLog() directly, but - * piggybacks on non-public CFLog() function. Both use Apple System Log - * internally, but it's easier to call CFLog() from C than NSLog(). Current - * implementation doesn't support "%@" format specifier. - */ -#ifdef TEN_LOG_USE_NSLOG - #undef TEN_LOG_USE_NSLOG - - #if defined(__APPLE__) && defined(__MACH__) - #define TEN_LOG_USE_NSLOG 1 - #else - #define TEN_LOG_USE_NSLOG 0 - #endif - -#else - #define TEN_LOG_USE_NSLOG 0 -#endif - -#if TEN_LOG_USE_NSLOG - -enum { OUT_NSLOG_MASK = TEN_LOG_PUT_STD & ~TEN_LOG_PUT_CTX }; - -TEN_UTILS_PRIVATE_API void out_nslog_cb(const ten_log_message_t *msg, - void *arg); - - #define OUT_NSLOG false, OUT_NSLOG_MASK, out_nslog_cb, NULL, NULL - -#endif diff --git a/core/include_internal/ten_utils/log/platform/win/log.h b/core/include_internal/ten_utils/log/platform/win/log.h deleted file mode 100644 index 497e933bfd..0000000000 --- a/core/include_internal/ten_utils/log/platform/win/log.h +++ /dev/null @@ -1,38 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -/** - * @brief When defined, OutputDebugString() will be used instead of stderr - * (ignored on non-Windows platforms). Uses OutputDebugStringA() variant and - * feeds it with UTF-8 data. - */ -#ifdef TEN_LOG_USE_DEBUGSTRING - #undef TEN_LOG_USE_DEBUGSTRING - - #if defined(_WIN32) || defined(_WIN64) - #define TEN_LOG_USE_DEBUGSTRING 1 - #else - #define TEN_LOG_USE_DEBUGSTRING 0 - #endif - -#else - #define TEN_LOG_USE_DEBUGSTRING 0 -#endif - -#if TEN_LOG_USE_DEBUGSTRING - -enum { OUT_DEBUGSTRING_MASK = TEN_LOG_PUT_STD }; - -TEN_UTILS_PRIVATE_API void out_debugstring_cb(const ten_log_message_t *msg, - void *arg); - - #define OUT_DEBUGSTRING \ - false, OUT_DEBUGSTRING_MASK, out_debugstring_cb, NULL, NULL - -#endif diff --git a/core/include_internal/ten_utils/log/spec.h b/core/include_internal/ten_utils/log/spec.h deleted file mode 100644 index 216f7cc9b3..0000000000 --- a/core/include_internal/ten_utils/log/spec.h +++ /dev/null @@ -1,12 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -#include "ten_utils/log/log.h" - -TEN_UTILS_PRIVATE_API const ten_log_t global_spec; diff --git a/core/include_internal/ten_utils/log/tag.h b/core/include_internal/ten_utils/log/tag.h deleted file mode 100644 index 2c023a69b5..0000000000 --- a/core/include_internal/ten_utils/log/tag.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#pragma once - -#include "ten_utils/ten_config.h" - -/** - * @brief When defined, ten_log library will not contain definition of tag - * prefix variable. In that case it must be defined elsewhere using - * TEN_LOG_DEFINE_TAG_PREFIX macro, for example: - * - * TEN_LOG_DEFINE_TAG_PREFIX = "ProcessName"; - * - * This allows to specify custom value for static initialization and avoid - * overhead of setting this value in runtime. - */ -#ifdef TEN_LOG_EXTERN_TAG_PREFIX - #undef TEN_LOG_EXTERN_TAG_PREFIX - #define TEN_LOG_EXTERN_TAG_PREFIX 1 -#else - #define TEN_LOG_EXTERN_TAG_PREFIX 0 -#endif diff --git a/core/include_internal/ten_utils/log/time.h b/core/include_internal/ten_utils/log/time.h index f1e2631d11..9cf166918d 100644 --- a/core/include_internal/ten_utils/log/time.h +++ b/core/include_internal/ten_utils/log/time.h @@ -9,8 +9,10 @@ #include -typedef void (*ten_log_get_time_func_t)(struct tm *tm, size_t *usec); +#include "ten_utils/lib/string.h" -TEN_UTILS_PRIVATE_API ten_log_get_time_func_t g_ten_log_get_time; +TEN_UTILS_PRIVATE_API void ten_log_get_time(struct tm *time_info, size_t *msec); -TEN_UTILS_PRIVATE_API void ten_log_get_time(struct tm *tm, size_t *msec); +TEN_UTILS_PRIVATE_API void ten_log_add_time_string(ten_string_t *buf, + struct tm *time_info, + size_t msec); diff --git a/core/include_internal/ten_utils/log/time_cache.h b/core/include_internal/ten_utils/log/time_cache.h index 90f4e50a24..50680f74b2 100644 --- a/core/include_internal/ten_utils/log/time_cache.h +++ b/core/include_internal/ten_utils/log/time_cache.h @@ -12,14 +12,14 @@ #if !defined(_WIN32) && !defined(_WIN64) - #include - #include - - #if defined(__linux__) - #include - #elif defined(__MACH__) - #include - #endif +#include +#include + +#if defined(__linux__) +#include +#elif defined(__MACH__) +#include +#endif TEN_UTILS_PRIVATE_API bool ten_log_time_cache_get(const struct timeval *tv, struct tm *tm); diff --git a/core/include_internal/ten_utils/macro/check.h b/core/include_internal/ten_utils/macro/check.h new file mode 100644 index 0000000000..032d978680 --- /dev/null +++ b/core/include_internal/ten_utils/macro/check.h @@ -0,0 +1,65 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#pragma once + +#include "ten_utils/ten_config.h" + +#include +#include // IWYU pragma: keep +#include // IWYU pragma: keep + +#include "include_internal/ten_utils/backtrace/backtrace.h" // IWYU pragma: keep +#include "include_internal/ten_utils/log/log.h" + +#if defined(__has_feature) +#if __has_feature(address_sanitizer) +#define TEN_USE_ASAN +#endif +#endif + +#if defined(__SANITIZE_ADDRESS__) +#define TEN_USE_ASAN +#endif + +#if defined(TEN_PRODUCTION) + +// Remove all protections in the final production release. + +#define TEN_ASSERT(expr, fmt, ...) \ + do { \ + } while (0) + +#else // TEN_PRODUCTION + +#ifndef NDEBUG + +#define TEN_ASSERT(expr, fmt, ...) \ + do { \ + /* NOLINTNEXTLINE(readability-simplify-boolean-expr)*/ \ + if (!(expr)) { \ + TEN_LOGE(fmt, ##__VA_ARGS__); \ + ten_backtrace_dump_global(0); \ + /* NOLINTNEXTLINE */ \ + assert(0); \ + } \ + } while (0) + +#else // NDEBUG + +// Enable minimal protection if the optimization is enabled. + +#define TEN_ASSERT(expr, fmt, ...) \ + do { \ + if (!(expr)) { \ + TEN_LOGE(fmt, ##__VA_ARGS__); \ + ten_backtrace_dump_global(0); \ + abort(); \ + } \ + } while (0) + +#endif // NDEBUG + +#endif // TEN_PRODUCTION diff --git a/core/include_internal/ten_utils/schema/keywords/keywords_info.h b/core/include_internal/ten_utils/schema/keywords/keywords_info.h index d540549b26..0bc72014ed 100644 --- a/core/include_internal/ten_utils/schema/keywords/keywords_info.h +++ b/core/include_internal/ten_utils/schema/keywords/keywords_info.h @@ -5,6 +5,7 @@ // #pragma once +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/constant_str.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/keywords/keyword_items.h" @@ -12,11 +13,10 @@ #include "include_internal/ten_utils/schema/keywords/keyword_required.h" #include "include_internal/ten_utils/schema/keywords/keyword_type.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #ifdef __cplusplus - #error \ - "This file contains C99 array designated initializer, and Visual Studio C++ compiler can only support up to C89 by default, so we enable this checking to prevent any wrong inclusion of this file." +#error \ + "This file contains C99 array designated initializer, and Visual Studio C++ compiler can only support up to C89 by default, so we enable this checking to prevent any wrong inclusion of this file." #endif typedef ten_schema_keyword_t *(*ten_schema_keyword_create_from_value_func_t)( diff --git a/core/src/ten_runtime/addon/addon.c b/core/src/ten_runtime/addon/addon.c index 9ff0aaaaad..2a850a8e64 100644 --- a/core/src/ten_runtime/addon/addon.c +++ b/core/src/ten_runtime/addon/addon.c @@ -18,6 +18,7 @@ #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/ten_env/ten_env.h" @@ -25,7 +26,7 @@ #include "ten_utils/lib/path.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_addon_host_check_integrity(ten_addon_host_t *self) { TEN_ASSERT(self, "Should not happen."); diff --git a/core/src/ten_runtime/addon/addon_autoload.c b/core/src/ten_runtime/addon/addon_autoload.c index fd23f14781..33b8cc0aa3 100644 --- a/core/src/ten_runtime/addon/addon_autoload.c +++ b/core/src/ten_runtime/addon/addon_autoload.c @@ -8,23 +8,23 @@ #include "ten_utils/lib/error.h" #if defined(OS_LINUX) - #define _GNU_SOURCE +#define _GNU_SOURCE #endif #include #include #if defined(_WIN32) || defined(_WIN64) - #include +#include #endif #include "include_internal/ten_runtime/app/base_dir.h" +#include "include_internal/ten_runtime/global/global.h" #include "include_internal/ten_runtime/global/signal.h" -#include "ten_runtime/global/global.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/module.h" #include "ten_utils/lib/path.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" /** * @brief @@ -267,9 +267,9 @@ bool ten_addon_load_all(ten_error_t *err) { goto done; } - #if defined(_WIN32) +#if defined(_WIN32) AddDllDirectory(ten_string_get_raw_str(app_lib_path)); - #endif +#endif for (int i = 0; i < sizeof(folders) / sizeof(folders[0]); i++) { ten_string_copy(&module_path, app_path); diff --git a/core/src/ten_runtime/addon/common/store.c b/core/src/ten_runtime/addon/common/store.c index 86e9b668ed..e9920f5347 100644 --- a/core/src/ten_runtime/addon/common/store.c +++ b/core/src/ten_runtime/addon/common/store.c @@ -9,12 +9,12 @@ #include #include "include_internal/ten_runtime/addon/addon.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/ref.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" void ten_addon_store_init(ten_addon_store_t *store) { TEN_ASSERT(store, "Can not init empty addon store."); diff --git a/core/src/ten_runtime/addon/extension/extension.c b/core/src/ten_runtime/addon/extension/extension.c index bbac6a3931..ef6a3a9479 100644 --- a/core/src/ten_runtime/addon/extension/extension.c +++ b/core/src/ten_runtime/addon/extension/extension.c @@ -12,10 +12,10 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/addon/addon.h" #include "ten_runtime/ten_env/ten_env.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static ten_addon_store_t g_extension_store = { diff --git a/core/src/ten_runtime/addon/extension_group/extension_group.c b/core/src/ten_runtime/addon/extension_group/extension_group.c index 9f172b4add..8c43a217f1 100644 --- a/core/src/ten_runtime/addon/extension_group/extension_group.c +++ b/core/src/ten_runtime/addon/extension_group/extension_group.c @@ -10,9 +10,9 @@ #include "include_internal/ten_runtime/engine/engine.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/addon/extension_group/extension_group.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" static ten_addon_store_t g_extension_group_store = { false, diff --git a/core/src/ten_runtime/addon/protocol/protocol.c b/core/src/ten_runtime/addon/protocol/protocol.c index 43b6daea4b..2a72d152ae 100644 --- a/core/src/ten_runtime/addon/protocol/protocol.c +++ b/core/src/ten_runtime/addon/protocol/protocol.c @@ -8,13 +8,14 @@ #include "include_internal/ten_runtime/addon/addon.h" #include "include_internal/ten_runtime/addon/common/store.h" #include "include_internal/ten_runtime/common/constant_str.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" #include "ten_utils/lib/uri.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" #include "ten_utils/value/value_object.h" diff --git a/core/src/ten_runtime/addon/ten_env/on_xxx.c b/core/src/ten_runtime/addon/ten_env/on_xxx.c index 9deaa16137..838b255fc6 100644 --- a/core/src/ten_runtime/addon/ten_env/on_xxx.c +++ b/core/src/ten_runtime/addon/ten_env/on_xxx.c @@ -17,10 +17,11 @@ #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" void ten_addon_on_init_done(ten_env_t *self) { TEN_ASSERT(self, "Invalid argument."); diff --git a/core/src/ten_runtime/app/app.c b/core/src/ten_runtime/app/app.c index c993f825a6..1bb63ed27f 100644 --- a/core/src/ten_runtime/app/app.c +++ b/core/src/ten_runtime/app/app.c @@ -11,13 +11,15 @@ #include "include_internal/ten_runtime/app/migration.h" #include "include_internal/ten_runtime/connection/connection.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" +#include "include_internal/ten_runtime/global/global.h" #include "include_internal/ten_runtime/global/signal.h" #include "include_internal/ten_runtime/protocol/context_store.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/schema_store/store.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" -#include "ten_runtime/global/global.h" #include "ten_runtime/protocol/context_store.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/container/list.h" @@ -27,8 +29,7 @@ #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/ref.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" #include "ten_utils/value/value.h" @@ -185,8 +186,6 @@ void ten_app_destroy(ten_app_t *self) { ten_sanitizer_thread_check_deinit(&self->thread_check); ten_event_destroy(self->belonging_thread_is_set); - ten_log_close(); - ten_string_deinit(&self->base_dir); TEN_FREE(self); diff --git a/core/src/ten_runtime/app/base_dir.c b/core/src/ten_runtime/app/base_dir.c index 87217439b2..db06262f21 100644 --- a/core/src/ten_runtime/app/base_dir.c +++ b/core/src/ten_runtime/app/base_dir.c @@ -6,11 +6,11 @@ #include "ten_runtime/ten_config.h" #include "include_internal/ten_runtime/common/constant_str.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/file.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/path.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" // Find the parent folder containing "manifest.json" with "type": "app" diff --git a/core/src/ten_runtime/app/close.c b/core/src/ten_runtime/app/close.c index 89a103c43e..a3f84f635f 100644 --- a/core/src/ten_runtime/app/close.c +++ b/core/src/ten_runtime/app/close.c @@ -15,14 +15,15 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/context_store.h" #include "include_internal/ten_runtime/protocol/protocol.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/protocol/context_store.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" static void ten_app_close_sync(ten_app_t *self) { diff --git a/core/src/ten_runtime/app/endpoint.c b/core/src/ten_runtime/app/endpoint.c index 7f1f057031..0665459e23 100644 --- a/core/src/ten_runtime/app/endpoint.c +++ b/core/src/ten_runtime/app/endpoint.c @@ -11,8 +11,8 @@ #include "include_internal/ten_runtime/protocol/close.h" #include "include_internal/ten_runtime/protocol/context_store.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" static ten_connection_t *create_connection_when_client_accepted( ten_protocol_t *protocol) { diff --git a/core/src/ten_runtime/app/engine_interface.c b/core/src/ten_runtime/app/engine_interface.c index ea4fde0265..1aad261bf1 100644 --- a/core/src/ten_runtime/app/engine_interface.c +++ b/core/src/ten_runtime/app/engine_interface.c @@ -12,10 +12,11 @@ #include "include_internal/ten_runtime/engine/engine.h" #include "include_internal/ten_runtime/engine/internal/thread.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" static void ten_app_check_termination_when_engine_closed_(void *app_, void *engine_) { diff --git a/core/src/ten_runtime/app/internal.c b/core/src/ten_runtime/app/internal.c index 95636448b5..e64f3703c2 100644 --- a/core/src/ten_runtime/app/internal.c +++ b/core/src/ten_runtime/app/internal.c @@ -17,12 +17,12 @@ #include "include_internal/ten_runtime/common/home.h" #include "include_internal/ten_runtime/connection/connection.h" #include "include_internal/ten_runtime/engine/engine.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" bool ten_app_check_integrity(ten_app_t *self, bool check_thread) { diff --git a/core/src/ten_runtime/app/metadata.c b/core/src/ten_runtime/app/metadata.c index fe8d1ff3a9..3e24b51775 100644 --- a/core/src/ten_runtime/app/metadata.c +++ b/core/src/ten_runtime/app/metadata.c @@ -12,20 +12,21 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/common/log.h" #include "include_internal/ten_runtime/extension/extension_info/extension_info.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/log/output.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" #include "ten_utils/value/value_is.h" #include "ten_utils/value/value_kv.h" -// Retrieve those property fields that are reserved for the TEN runtime under -// the 'ten' namespace. +// Retrieve those property fields that are reserved for the TEN runtime +// under the 'ten' namespace. ten_value_t *ten_app_get_ten_namespace_properties(ten_app_t *self) { TEN_ASSERT(self && ten_app_check_integrity(self, true), "Should not happen."); @@ -102,7 +103,7 @@ bool ten_app_init_log_level(ten_app_t *self, ten_value_t *value) { ten_error_t err; ten_error_init(&err); - ten_log_set_output_level(ten_value_get_int64(value, &err)); + ten_log_global_set_output_level(ten_value_get_int64(value, &err)); ten_error_deinit(&err); @@ -120,7 +121,7 @@ bool ten_app_init_log_file(ten_app_t *self, ten_value_t *value) { strlen(ten_value_peek_string(value))); if (!ten_string_is_empty(&log_file)) { - ten_log_set_output_to_file(ten_string_get_raw_str(&log_file)); + ten_log_global_set_output_to_file(ten_string_get_raw_str(&log_file)); } ten_string_deinit(&log_file); @@ -177,7 +178,8 @@ bool ten_app_handle_ten_namespace_properties(ten_app_t *self) { // Set default value for app properties and global log level. self->one_event_loop_per_engine = false; self->long_running_mode = false; - ten_log_set_output_level(DEFAULT_LOG_LEVEL); + + ten_log_global_set_output_level(DEFAULT_LOG_OUTPUT_LEVEL); if (!ten_app_determine_ten_namespace_properties(self, ten_namespace_properties)) { diff --git a/core/src/ten_runtime/app/migration.c b/core/src/ten_runtime/app/migration.c index d27483c209..25f256cdc3 100644 --- a/core/src/ten_runtime/app/migration.c +++ b/core/src/ten_runtime/app/migration.c @@ -9,8 +9,9 @@ #include "include_internal/ten_runtime/app/close.h" #include "include_internal/ten_runtime/connection/connection.h" #include "include_internal/ten_runtime/engine/engine.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/io/runloop.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" void ten_app_clean_connection(ten_app_t *self, ten_connection_t *connection) { TEN_ASSERT(self && ten_app_check_integrity(self, true), diff --git a/core/src/ten_runtime/app/msg_interface/common.c b/core/src/ten_runtime/app/msg_interface/common.c index e5742f56e8..79ce304ead 100644 --- a/core/src/ten_runtime/app/msg_interface/common.c +++ b/core/src/ten_runtime/app/msg_interface/common.c @@ -21,6 +21,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/msg/msg.h" @@ -30,7 +31,7 @@ #include "ten_utils/lib/error.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/value/value.h" void ten_app_do_connection_migration_or_push_to_engine_queue( diff --git a/core/src/ten_runtime/app/msg_interface/start_graph.c b/core/src/ten_runtime/app/msg_interface/start_graph.c index b4696c89e4..597e4d6dc1 100644 --- a/core/src/ten_runtime/app/msg_interface/start_graph.c +++ b/core/src/ten_runtime/app/msg_interface/start_graph.c @@ -22,9 +22,9 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" static bool ten_app_fill_start_graph_cmd_extensions_info_from_predefined_graph( ten_app_t *self, ten_shared_ptr_t *cmd, ten_error_t *err) { diff --git a/core/src/ten_runtime/app/predefined_graph.c b/core/src/ten_runtime/app/predefined_graph.c index e75b91fe18..9e39f7e27f 100644 --- a/core/src/ten_runtime/app/predefined_graph.c +++ b/core/src/ten_runtime/app/predefined_graph.c @@ -18,13 +18,13 @@ #include "include_internal/ten_runtime/extension_group/extension_group_info/json.h" #include "include_internal/ten_runtime/extension_group/extension_group_info/value.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value_get.h" ten_predefined_graph_info_t *ten_predefined_graph_info_create(void) { diff --git a/core/src/ten_runtime/app/ten_env/metadata.c b/core/src/ten_runtime/app/ten_env/metadata.c index 5011500ea4..c321331eeb 100644 --- a/core/src/ten_runtime/app/ten_env/metadata.c +++ b/core/src/ten_runtime/app/ten_env/metadata.c @@ -7,10 +7,10 @@ #include "include_internal/ten_runtime/app/app.h" #include "include_internal/ten_runtime/schema_store/store.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value_object.h" bool ten_app_set_property(ten_app_t *app, const char *name, ten_value_t *value, diff --git a/core/src/ten_runtime/app/ten_env/on_xxx.c b/core/src/ten_runtime/app/ten_env/on_xxx.c index cfd109d337..98a9ffe02b 100644 --- a/core/src/ten_runtime/app/ten_env/on_xxx.c +++ b/core/src/ten_runtime/app/ten_env/on_xxx.c @@ -17,12 +17,12 @@ #include "include_internal/ten_runtime/schema_store/store.h" #include "include_internal/ten_runtime/ten_env/metadata_cb.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/error.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" void ten_app_on_init(ten_env_t *ten_env) { TEN_ASSERT(ten_env && ten_env_check_integrity(ten_env, true), diff --git a/core/src/ten_runtime/binding/common.c b/core/src/ten_runtime/binding/common.c index 641f209e8b..4c04e1e28c 100644 --- a/core/src/ten_runtime/binding/common.c +++ b/core/src/ten_runtime/binding/common.c @@ -6,7 +6,7 @@ #include "ten_runtime/binding/common.h" #include "include_internal/ten_runtime/binding/common.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" void ten_binding_handle_set_me_in_target_lang(ten_binding_handle_t *self, void *me_in_target_lang) { diff --git a/core/src/ten_runtime/binding/go/interface/ten/ten_env.go b/core/src/ten_runtime/binding/go/interface/ten/ten_env.go index 0990005470..ab5aaa621f 100644 --- a/core/src/ten_runtime/binding/go/interface/ten/ten_env.go +++ b/core/src/ten_runtime/binding/go/interface/ten/ten_env.go @@ -90,7 +90,7 @@ type TenEnv interface { InitPropertyFromJSONBytes(value []byte) error - Log(level LogLevel, msg string, args ...interface{}) error + // Log(level LogLevel, msg string, args ...interface{}) error } // Making a compile-time assertion which indicates that if 'ten' type doesn't diff --git a/core/src/ten_runtime/binding/go/native/addon/addon.c b/core/src/ten_runtime/binding/go/native/addon/addon.c index d4bc09031e..7a966145a9 100644 --- a/core/src/ten_runtime/binding/go/native/addon/addon.c +++ b/core/src/ten_runtime/binding/go/native/addon/addon.c @@ -16,6 +16,7 @@ #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/addon/addon.h" #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/addon/extension_group/extension_group.h" @@ -27,7 +28,6 @@ #include "ten_utils/lib/error.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" void tenGoAddonOnInit(ten_go_handle_t go_addon, ten_go_handle_t go_ten); diff --git a/core/src/ten_runtime/binding/go/native/extension/extension.c b/core/src/ten_runtime/binding/go/native/extension/extension.c index eb2bb1dc0e..4081f9d478 100644 --- a/core/src/ten_runtime/binding/go/native/extension/extension.c +++ b/core/src/ten_runtime/binding/go/native/extension/extension.c @@ -14,6 +14,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" @@ -24,7 +25,6 @@ #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" extern void tenGoExtensionOnInit(ten_go_handle_t go_extension, ten_go_handle_t go_ten); diff --git a/core/src/ten_runtime/binding/go/native/extension_group/extension_group.c b/core/src/ten_runtime/binding/go/native/extension_group/extension_group.c index 4717e6be8a..bf9789e31f 100644 --- a/core/src/ten_runtime/binding/go/native/extension_group/extension_group.c +++ b/core/src/ten_runtime/binding/go/native/extension_group/extension_group.c @@ -14,6 +14,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" @@ -23,7 +24,6 @@ #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" void tenGoExtensionGroupOnInit(ten_go_handle_t go_extension_group, ten_go_handle_t go_ten); diff --git a/core/src/ten_runtime/binding/go/native/internal/common.c b/core/src/ten_runtime/binding/go/native/internal/common.c index eda8074ba5..3062e05a0f 100644 --- a/core/src/ten_runtime/binding/go/native/internal/common.c +++ b/core/src/ten_runtime/binding/go/native/internal/common.c @@ -9,10 +9,10 @@ #include #include "include_internal/ten_runtime/binding/go/internal/common.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" ten_go_handle_array_t *ten_go_handle_array_create(size_t size) { diff --git a/core/src/ten_runtime/binding/go/native/internal/json.c b/core/src/ten_runtime/binding/go/native/internal/json.c index 40c80237de..74071e31b4 100644 --- a/core/src/ten_runtime/binding/go/native/internal/json.c +++ b/core/src/ten_runtime/binding/go/native/internal/json.c @@ -6,9 +6,9 @@ #include "include_internal/ten_runtime/binding/go/internal/json.h" #include "include_internal/ten_runtime/binding/go/internal/common.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" ten_json_t *ten_go_json_loads(const void *json_bytes, int json_bytes_len, ten_go_status_t *status) { diff --git a/core/src/ten_runtime/binding/go/native/msg/audio_frame/audio_frame.c b/core/src/ten_runtime/binding/go/native/msg/audio_frame/audio_frame.c index 6c02a1e08e..486412cee5 100644 --- a/core/src/ten_runtime/binding/go/native/msg/audio_frame/audio_frame.c +++ b/core/src/ten_runtime/binding/go/native/msg/audio_frame/audio_frame.c @@ -10,12 +10,12 @@ #include "include_internal/ten_runtime/binding/go/internal/common.h" #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" ten_go_status_t ten_go_audio_frame_create(const void *msg_name, int msg_name_len, diff --git a/core/src/ten_runtime/binding/go/native/msg/cmd/cmd.c b/core/src/ten_runtime/binding/go/native/msg/cmd/cmd.c index 58c9c7d9ed..8d01827e2a 100644 --- a/core/src/ten_runtime/binding/go/native/msg/cmd/cmd.c +++ b/core/src/ten_runtime/binding/go/native/msg/cmd/cmd.c @@ -13,6 +13,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/custom/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/common/status_code.h" @@ -20,7 +21,6 @@ #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" ten_go_handle_t tenGoCreateCmdResult(uintptr_t); diff --git a/core/src/ten_runtime/binding/go/native/msg/data/data.c b/core/src/ten_runtime/binding/go/native/msg/data/data.c index 4fa402c853..cbf472ef50 100644 --- a/core/src/ten_runtime/binding/go/native/msg/data/data.c +++ b/core/src/ten_runtime/binding/go/native/msg/data/data.c @@ -8,11 +8,11 @@ #include "include_internal/ten_runtime/binding/go/internal/common.h" #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/data/data.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" ten_go_status_t ten_go_data_create(const void *msg_name, int msg_name_len, uintptr_t *bridge) { diff --git a/core/src/ten_runtime/binding/go/native/msg/msg.c b/core/src/ten_runtime/binding/go/native/msg/msg.c index 9a79ceb66f..81201991b7 100644 --- a/core/src/ten_runtime/binding/go/native/msg/msg.c +++ b/core/src/ten_runtime/binding/go/native/msg/msg.c @@ -14,6 +14,7 @@ #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/binding/go/value/value.h" #include "include_internal/ten_runtime/msg/field/properties.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/value.h" #include "ten_runtime/common/errno.h" @@ -24,7 +25,6 @@ #include "ten_utils/lib/signature.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" diff --git a/core/src/ten_runtime/binding/go/native/msg/video_frame/video_frame.c b/core/src/ten_runtime/binding/go/native/msg/video_frame/video_frame.c index a985676e03..7d4dd279b8 100644 --- a/core/src/ten_runtime/binding/go/native/msg/video_frame/video_frame.c +++ b/core/src/ten_runtime/binding/go/native/msg/video_frame/video_frame.c @@ -3,17 +3,18 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // +#include "ten_runtime/binding/go/interface/ten/video_frame.h" + #include #include "include_internal/ten_runtime/binding/go/internal/common.h" #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/msg.h" -#include "ten_runtime/binding/go/interface/ten/video_frame.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/msg.h" #include "ten_runtime/msg/video_frame/video_frame.h" -#include "ten_utils/macro/check.h" ten_go_status_t ten_go_video_frame_create(const void *msg_name, int msg_name_len, diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env.c index e1c076aa78..95e455967d 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env.c @@ -12,6 +12,7 @@ #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" @@ -20,7 +21,6 @@ #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" bool ten_go_ten_env_check_integrity(ten_go_ten_env_t *self) { TEN_ASSERT(self, "Should not happen."); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_create_extension.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_create_extension.c index 9301781b49..d990a6933e 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_create_extension.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_create_extension.c @@ -12,6 +12,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" @@ -20,7 +21,7 @@ #include "ten_runtime/ten_env/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" typedef struct addon_create_extension_done_call_info_t { ten_extension_t *extension; diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_destroy_extension.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_destroy_extension.c index 65576b41f9..6d45f9c9ac 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_destroy_extension.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_destroy_extension.c @@ -10,6 +10,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" @@ -17,7 +18,7 @@ #include "ten_runtime/ten_env/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" typedef struct ten_env_notify_addon_destroy_extension_info_t { ten_extension_t *c_extension; diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_create_instance_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_create_instance_done.c index 1a1e176536..2979fb28a3 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_create_instance_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_create_instance_done.c @@ -9,9 +9,9 @@ #include "include_internal/ten_runtime/binding/go/extension_group/extension_group.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten.h" -#include "ten_utils/macro/check.h" void ten_go_ten_env_on_create_instance_done(uintptr_t bridge_addr, bool is_extension, diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property.c index cb5e86336f..34a9e10acd 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property.c @@ -11,6 +11,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/value/value.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/binding/go/interface/ten/value.h" @@ -20,7 +21,6 @@ #include "ten_utils/lib/error.h" #include "ten_utils/lib/event.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property_async.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property_async.c index c212a42a5a..aa35ba6d09 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property_async.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property_async.c @@ -8,11 +8,12 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/value/value.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/binding/go/interface/ten/value.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" typedef struct ten_env_notify_get_property_info_t { ten_string_t path; diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_init_property.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_init_property.c index c9cbdf1290..0d51c26a1d 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_init_property.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_init_property.c @@ -6,6 +6,7 @@ #include "include_internal/ten_runtime/binding/go/internal/common.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/common/errno.h" @@ -15,7 +16,6 @@ #include "ten_utils/lib/error.h" #include "ten_utils/lib/event.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" typedef struct ten_notify_set_init_property_info_t { ten_string_t value; diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_internal.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_internal.c index ef463b1030..199ba4ef64 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_internal.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_internal.c @@ -10,10 +10,10 @@ #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" extern void tenGoOnCmdResult(ten_go_handle_t ten_bridge, ten_go_handle_t cmd_bridge, diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_is_cmd_connected.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_is_cmd_connected.c index a548ed664f..73b26a363b 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_is_cmd_connected.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_is_cmd_connected.c @@ -5,10 +5,10 @@ // #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" typedef struct ten_env_notify_is_cmd_connected_info_t { bool result; diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c index 337f1212b5..6b00f793de 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c @@ -11,10 +11,10 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" typedef struct ten_env_notify_log_info_t { diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_create_extension_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_create_extension_done.c index 38a772f811..288ab9f8e9 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_create_extension_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_create_extension_done.c @@ -10,10 +10,10 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" typedef struct ten_env_notify_on_create_extensions_done_info_t { ten_list_t result; diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_deinit_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_deinit_done.c index 63adbe7329..73b7a0ca9b 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_deinit_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_deinit_done.c @@ -7,10 +7,10 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/rwlock.h" -#include "ten_utils/macro/check.h" static void ten_env_notify_on_deinit_done(ten_env_t *ten_env, void *user_data) { TEN_ASSERT( diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_delete_extension_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_delete_extension_done.c index 42ea092194..cecf09f15b 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_delete_extension_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_delete_extension_done.c @@ -7,9 +7,10 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" static void ten_env_notify_on_destroy_extensions_done( ten_env_t *ten_env, TEN_UNUSED void *user_data) { diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_init_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_init_done.c index 42e1afdf72..e67291f99b 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_init_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_init_done.c @@ -8,9 +8,9 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static void ten_env_notify_on_init_done(ten_env_t *ten_env, diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_start_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_start_done.c index 9e669ebed0..8e3e4007ba 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_start_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_start_done.c @@ -8,9 +8,10 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" static void ten_env_notify_on_start_done(ten_env_t *ten_env, TEN_UNUSED void *user_data) { diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_stop_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_stop_done.c index d6a69a31ab..8ceb0ecc79 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_stop_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_stop_done.c @@ -7,9 +7,10 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" static void ten_env_notify_on_stop_done(ten_env_t *ten_env, TEN_UNUSED void *user_data) { diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_result.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_result.c index aeb135de04..0c3218b570 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_result.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_result.c @@ -12,6 +12,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" @@ -22,7 +23,6 @@ #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" typedef struct ten_env_notify_return_result_info_t { diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_value.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_value.c index 53e4af6a6e..5f13482c23 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_value.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_value.c @@ -10,10 +10,10 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_return_result.h" #include "include_internal/ten_runtime/binding/go/value/value.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" ten_go_status_t ten_go_ten_env_return_string(uintptr_t bridge_addr, diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_audio_frame.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_audio_frame.c index 0be4ecd304..22248aa7cc 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_audio_frame.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_audio_frame.c @@ -8,12 +8,13 @@ #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" typedef struct ten_env_notify_send_audio_frame_info_t { ten_shared_ptr_t *c_audio_frame; diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_cmd.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_cmd.c index 433523b3cf..ceeb73acc8 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_cmd.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_cmd.c @@ -9,13 +9,14 @@ #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" typedef struct ten_env_notify_send_cmd_info_t { ten_shared_ptr_t *c_cmd; diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_data.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_data.c index af9a5cc7a6..f6424f4622 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_data.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_data.c @@ -10,6 +10,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" @@ -17,7 +18,7 @@ #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" typedef struct ten_env_notify_send_data_info_t { ten_shared_ptr_t *c_data; diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_json.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_json.c index bc5988236b..ef46bc7b18 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_json.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_json.c @@ -9,6 +9,7 @@ #include "include_internal/ten_runtime/binding/go/internal/json.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/common/errno.h" @@ -16,7 +17,7 @@ #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" typedef struct ten_env_notify_send_json_info_t { ten_json_t *c_json; diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_video_frame.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_video_frame.c index c2f170ed3d..716876ff37 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_video_frame.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_video_frame.c @@ -10,13 +10,14 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" typedef struct ten_env_notify_send_video_frame_info_t { ten_shared_ptr_t *c_video_frame; diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property.c index 168cb3ee7a..79fe20ec09 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property.c @@ -10,6 +10,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/value/value.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/binding/go/interface/ten/value.h" @@ -20,7 +21,6 @@ #include "ten_utils/lib/event.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" typedef struct ten_env_notify_set_property_info_t { diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property_async.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property_async.c index 916ca289e3..531e385fdb 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property_async.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property_async.c @@ -8,11 +8,12 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/value/value.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/binding/go/interface/ten/value.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" typedef struct ten_env_notify_set_property_info_t { bool result; diff --git a/core/src/ten_runtime/binding/go/native/value/value.c b/core/src/ten_runtime/binding/go/native/value/value.c index f918c420b5..ba776cb801 100644 --- a/core/src/ten_runtime/binding/go/native/value/value.c +++ b/core/src/ten_runtime/binding/go/native/value/value.c @@ -10,6 +10,7 @@ #include "include_internal/ten_runtime/binding/go/internal/common.h" #include "include_internal/ten_runtime/binding/go/value/value.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_smart_ptr.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/common/errno.h" @@ -19,7 +20,6 @@ #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/type.h" #include "ten_utils/value/type_operation.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi b/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi index e5c839a219..290a979e32 100644 --- a/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi +++ b/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi @@ -109,14 +109,14 @@ class _TenEnv: def is_property_exist(self, path: str) -> bool: ... def is_cmd_connected(self, msg_name: str) -> bool: ... def init_property_from_json(self, json_str: str) -> None: ... - def log( - self, - level: TenEnvLogLevel, - func_name: str | None, - file_name: str | None, - line_no: int, - msg: str, - ) -> None: ... + # def log( + # self, + # level: TenEnvLogLevel, + # func_name: str | None, + # file_name: str | None, + # line_no: int, + # msg: str, + # ) -> None: ... class _App: def run(self, run_in_background_flag: int) -> None: ... diff --git a/core/src/ten_runtime/binding/python/interface/ten/ten_env.py b/core/src/ten_runtime/binding/python/interface/ten/ten_env.py index a304f8aaff..ddc30b0509 100644 --- a/core/src/ten_runtime/binding/python/interface/ten/ten_env.py +++ b/core/src/ten_runtime/binding/python/interface/ten/ten_env.py @@ -112,27 +112,27 @@ def set_property_float(self, path: str, value: float) -> None: def init_property_from_json(self, json_str: str) -> None: return self._internal.init_property_from_json(json_str) - def log( - self, - level: TenEnvLogLevel, - *args, - ) -> None: - msg = " ".join(map(str, args)) - - # Get the current frame and the caller's frame. - frame = inspect.currentframe() - if frame is not None: - caller_frame = frame.f_back - if caller_frame is not None: - # Extract information from the caller's frame - file_name = caller_frame.f_code.co_filename - func_name = caller_frame.f_code.co_name - line_no = caller_frame.f_lineno - - return self._internal.log( - level, func_name, file_name, line_no, msg - ) - else: - return self._internal.log(level, None, None, 0, msg) - else: - return self._internal.log(level, None, None, 0, msg) + # def log( + # self, + # level: TenEnvLogLevel, + # *args, + # ) -> None: + # msg = " ".join(map(str, args)) + + # # Get the current frame and the caller's frame. + # frame = inspect.currentframe() + # if frame is not None: + # caller_frame = frame.f_back + # if caller_frame is not None: + # # Extract information from the caller's frame + # file_name = caller_frame.f_code.co_filename + # func_name = caller_frame.f_code.co_name + # line_no = caller_frame.f_lineno + + # return self._internal.log( + # level, func_name, file_name, line_no, msg + # ) + # else: + # return self._internal.log(level, None, None, 0, msg) + # else: + # return self._internal.log(level, None, None, 0, msg) diff --git a/core/src/ten_runtime/binding/python/native/app/app.c b/core/src/ten_runtime/binding/python/native/app/app.c index 46e6f15364..8c2f6bc0bc 100644 --- a/core/src/ten_runtime/binding/python/native/app/app.c +++ b/core/src/ten_runtime/binding/python/native/app/app.c @@ -11,12 +11,12 @@ #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/metadata/metadata_info.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/python/common.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/signature.h" -#include "ten_utils/log/log.h" static bool ten_py_app_check_integrity(ten_py_app_t *self, bool check_thread) { TEN_ASSERT(self, "Should not happen."); diff --git a/core/src/ten_runtime/binding/python/native/common/common.c b/core/src/ten_runtime/binding/python/native/common/common.c index 24ce093a65..891c4858cc 100644 --- a/core/src/ten_runtime/binding/python/native/common/common.c +++ b/core/src/ten_runtime/binding/python/native/common/common.c @@ -7,10 +7,10 @@ #include "include_internal/ten_runtime/binding/python/common/common.h" #include "include_internal/ten_runtime/binding/python/common/python_stuff.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_str.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" int ten_py_is_initialized(void) { return Py_IsInitialized(); } diff --git a/core/src/ten_runtime/binding/python/native/common/error.c b/core/src/ten_runtime/binding/python/native/common/error.c index cdff2d75b6..13ab720e2c 100644 --- a/core/src/ten_runtime/binding/python/native/common/error.c +++ b/core/src/ten_runtime/binding/python/native/common/error.c @@ -6,7 +6,7 @@ #include #include "include_internal/ten_runtime/binding/python/common/python_stuff.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" static void ten_py_print_py_error(void) { PyObject *ptype = NULL; diff --git a/core/src/ten_runtime/binding/python/native/msg/audio_frame.c b/core/src/ten_runtime/binding/python/native/msg/audio_frame.c index 29646b7be3..8e274f703c 100644 --- a/core/src/ten_runtime/binding/python/native/msg/audio_frame.c +++ b/core/src/ten_runtime/binding/python/native/msg/audio_frame.c @@ -8,11 +8,11 @@ #include "include_internal/ten_runtime/binding/python/common/error.h" #include "include_internal/ten_runtime/binding/python/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "longobject.h" #include "object.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" -#include "ten_utils/macro/check.h" static ten_py_audio_frame_t *ten_py_audio_frame_create_internal( PyTypeObject *py_type) { diff --git a/core/src/ten_runtime/binding/python/native/msg/data.c b/core/src/ten_runtime/binding/python/native/msg/data.c index 4db32bc5d9..0ff9af17c8 100644 --- a/core/src/ten_runtime/binding/python/native/msg/data.c +++ b/core/src/ten_runtime/binding/python/native/msg/data.c @@ -8,11 +8,11 @@ #include "include_internal/ten_runtime/binding/python/common/error.h" #include "include_internal/ten_runtime/binding/python/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "pyport.h" #include "ten_runtime/msg/data/data.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/buf.h" -#include "ten_utils/macro/check.h" static ten_py_data_t *ten_py_data_create_internal(PyTypeObject *py_type) { if (!py_type) { diff --git a/core/src/ten_runtime/binding/python/native/msg/video_frame.c b/core/src/ten_runtime/binding/python/native/msg/video_frame.c index f5de5047d5..158eb6e60a 100644 --- a/core/src/ten_runtime/binding/python/native/msg/video_frame.c +++ b/core/src/ten_runtime/binding/python/native/msg/video_frame.c @@ -8,9 +8,9 @@ #include "include_internal/ten_runtime/binding/python/common/error.h" #include "include_internal/ten_runtime/binding/python/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "memoryobject.h" #include "ten_runtime/msg/video_frame/video_frame.h" -#include "ten_utils/macro/check.h" static ten_py_video_frame_t *ten_py_video_frame_create_internal( PyTypeObject *py_type) { diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env.c index 73eada59b4..13cca648dc 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env.c @@ -9,11 +9,11 @@ #include "include_internal/ten_runtime/binding/python/common/error.h" #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "object.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/signature.h" -#include "ten_utils/macro/check.h" bool ten_py_ten_env_check_integrity(ten_py_ten_env_t *self) { TEN_ASSERT(self, "Should not happen."); diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_get_property.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_get_property.c index 1272530d1a..29a064a8b6 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_get_property.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_get_property.c @@ -7,10 +7,10 @@ #include "include_internal/ten_runtime/binding/python/common/error.h" #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c index 5e3a64b73f..14c03c9146 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c @@ -8,8 +8,8 @@ #include "include_internal/ten_runtime/binding/python/common/error.h" #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" #include "include_internal/ten_runtime/ten_env/log.h" -#include "include_internal/ten_utils/log/new.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" typedef struct ten_env_notify_log_info_t { @@ -70,7 +70,7 @@ PyObject *ten_py_ten_env_log(PyObject *self, PyObject *args) { "Invalid argument count when ten_env.log."); } - TEN_LOG_NEW_LEVEL level = TEN_LOG_NEW_INVALID; + TEN_LOG_LEVEL level = TEN_LOG_LEVEL_INVALID; const char *func_name = NULL; const char *file_name = NULL; size_t line_no = 0; diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_init_done.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_init_done.c index 2941b8b568..efc004c975 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_init_done.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_init_done.c @@ -9,9 +9,9 @@ #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static void ten_env_notify_on_init_done(ten_env_t *ten_env, diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c index 94c97f6dfc..ccdb9f8ae1 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c @@ -10,10 +10,10 @@ #include "include_internal/ten_runtime/binding/python/msg/msg.h" #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" typedef struct ten_env_notify_send_cmd_info_t { diff --git a/core/src/ten_runtime/common/binding.c b/core/src/ten_runtime/common/binding.c index a558f0f3fe..52d0f1dbd5 100644 --- a/core/src/ten_runtime/common/binding.c +++ b/core/src/ten_runtime/common/binding.c @@ -4,8 +4,8 @@ // information. // #include "include_internal/ten_runtime/binding/common.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" -#include "ten_utils/macro/check.h" void ten_binding_handle_set_me_in_target_lang(ten_binding_handle_t *self, void *me_in_target_lang) { diff --git a/core/src/ten_runtime/common/closeable.c b/core/src/ten_runtime/common/closeable.c index 080508a9b3..43fec22597 100644 --- a/core/src/ten_runtime/common/closeable.c +++ b/core/src/ten_runtime/common/closeable.c @@ -5,13 +5,14 @@ // #include "include_internal/ten_runtime/common/closeable.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/container/list_node_ptr.h" #include "ten_utils/container/list_ptr.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/signature.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" #include "ten_utils/sanitizer/thread_check.h" diff --git a/core/src/ten_runtime/common/loc.c b/core/src/ten_runtime/common/loc.c index cf84fc6c80..905396ccd7 100644 --- a/core/src/ten_runtime/common/loc.c +++ b/core/src/ten_runtime/common/loc.c @@ -9,10 +9,10 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/extension/extension.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" bool ten_loc_check_integrity(ten_loc_t *self) { TEN_ASSERT(self, "Should not happen."); diff --git a/core/src/ten_runtime/connection/connection.c b/core/src/ten_runtime/connection/connection.c index 6bb783f149..d84e50d400 100644 --- a/core/src/ten_runtime/connection/connection.c +++ b/core/src/ten_runtime/connection/connection.c @@ -18,6 +18,8 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/remote/remote.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/container/list.h" @@ -27,8 +29,7 @@ #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/ref.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" bool ten_connection_check_integrity(ten_connection_t *self, bool check_thread) { diff --git a/core/src/ten_runtime/connection/migration.c b/core/src/ten_runtime/connection/migration.c index 580c7169eb..2659c400ae 100644 --- a/core/src/ten_runtime/connection/migration.c +++ b/core/src/ten_runtime/connection/migration.c @@ -10,9 +10,9 @@ #include "include_internal/ten_runtime/engine/engine.h" #include "include_internal/ten_runtime/engine/internal/migration.h" #include "include_internal/ten_runtime/protocol/protocol.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/ref.h" -#include "ten_utils/macro/check.h" void ten_connection_migrate(ten_connection_t *self, ten_engine_t *engine, ten_shared_ptr_t *cmd) { diff --git a/core/src/ten_runtime/engine/engine.c b/core/src/ten_runtime/engine/engine.c index ab4227526d..0adcbaa8fe 100644 --- a/core/src/ten_runtime/engine/engine.c +++ b/core/src/ten_runtime/engine/engine.c @@ -17,6 +17,8 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/remote/remote.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/container/hash_table.h" #include "ten_utils/container/list.h" @@ -26,8 +28,6 @@ #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/string.h" #include "ten_utils/lib/uuid.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/sanitizer/thread_check.h" bool ten_engine_check_integrity(ten_engine_t *self, bool check_thread) { diff --git a/core/src/ten_runtime/engine/internal/close.c b/core/src/ten_runtime/engine/internal/close.c index 60a26723f5..207fc137a3 100644 --- a/core/src/ten_runtime/engine/internal/close.c +++ b/core/src/ten_runtime/engine/internal/close.c @@ -12,19 +12,19 @@ #include "include_internal/ten_runtime/engine/engine.h" #include "include_internal/ten_runtime/engine/internal/thread.h" #include "include_internal/ten_runtime/extension_context/extension_context.h" -#include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/remote/remote.h" #include "include_internal/ten_runtime/timer/timer.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/hash_handle.h" #include "ten_utils/container/hash_table.h" #include "ten_utils/container/list.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" +#include "ten_utils/macro/mark.h" static void ten_engine_close_sync(ten_engine_t *self) { TEN_ASSERT(self && ten_engine_check_integrity(self, true), diff --git a/core/src/ten_runtime/engine/internal/extension_interface.c b/core/src/ten_runtime/engine/internal/extension_interface.c index 22093ae86b..08904be03d 100644 --- a/core/src/ten_runtime/engine/internal/extension_interface.c +++ b/core/src/ten_runtime/engine/internal/extension_interface.c @@ -15,14 +15,14 @@ #include "include_internal/ten_runtime/engine/msg_interface/start_graph.h" #include "include_internal/ten_runtime/extension_context/extension_context.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" // The 'cmd' parameter is the command triggers the enabling of extension system. diff --git a/core/src/ten_runtime/engine/internal/migration.c b/core/src/ten_runtime/engine/internal/migration.c index 930b2d1070..9716c0e606 100644 --- a/core/src/ten_runtime/engine/internal/migration.c +++ b/core/src/ten_runtime/engine/internal/migration.c @@ -12,9 +12,10 @@ #include "include_internal/ten_runtime/engine/msg_interface/common.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" static ten_engine_migration_user_data_t *ten_engine_migration_user_data_create( diff --git a/core/src/ten_runtime/engine/internal/remote_interface.c b/core/src/ten_runtime/engine/internal/remote_interface.c index 4e7040b689..41921e2770 100644 --- a/core/src/ten_runtime/engine/internal/remote_interface.c +++ b/core/src/ten_runtime/engine/internal/remote_interface.c @@ -19,6 +19,8 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/remote/remote.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" @@ -27,9 +29,8 @@ #include "ten_utils/container/list_ptr.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" +#include "ten_utils/macro/mark.h" static bool ten_engine_del_weak_remote(ten_engine_t *self, ten_remote_t *remote) { diff --git a/core/src/ten_runtime/engine/internal/thread.c b/core/src/ten_runtime/engine/internal/thread.c index 5d34190bb8..fca3013c31 100644 --- a/core/src/ten_runtime/engine/internal/thread.c +++ b/core/src/ten_runtime/engine/internal/thread.c @@ -11,13 +11,14 @@ #include "include_internal/ten_runtime/app/app.h" #include "include_internal/ten_runtime/connection/connection.h" #include "include_internal/ten_runtime/engine/engine.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/event.h" #include "ten_utils/lib/string.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" #define TIMEOUT_FOR_ENGINE_THREAD_STARTED 5000 // ms diff --git a/core/src/ten_runtime/engine/msg_interface/close_app.c b/core/src/ten_runtime/engine/msg_interface/close_app.c index afad695c23..48f7e34ea1 100644 --- a/core/src/ten_runtime/engine/msg_interface/close_app.c +++ b/core/src/ten_runtime/engine/msg_interface/close_app.c @@ -11,8 +11,9 @@ #include "include_internal/ten_runtime/engine/engine.h" #include "include_internal/ten_runtime/engine/internal/thread.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" void ten_engine_handle_cmd_close_app(ten_engine_t *self, ten_shared_ptr_t *cmd, TEN_UNUSED ten_error_t *err) { diff --git a/core/src/ten_runtime/engine/msg_interface/close_engine.c b/core/src/ten_runtime/engine/msg_interface/close_engine.c index 22ae98c0d0..641b98a682 100644 --- a/core/src/ten_runtime/engine/msg_interface/close_engine.c +++ b/core/src/ten_runtime/engine/msg_interface/close_engine.c @@ -12,9 +12,10 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/stop_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/remote/remote.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" void ten_engine_handle_cmd_stop_graph(ten_engine_t *self, ten_shared_ptr_t *cmd, TEN_UNUSED ten_error_t *err) { diff --git a/core/src/ten_runtime/engine/msg_interface/cmd_result.c b/core/src/ten_runtime/engine/msg_interface/cmd_result.c index 2b39ea339f..df3d78558b 100644 --- a/core/src/ten_runtime/engine/msg_interface/cmd_result.c +++ b/core/src/ten_runtime/engine/msg_interface/cmd_result.c @@ -19,12 +19,12 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/path/path_table.h" #include "include_internal/ten_runtime/remote/remote.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value_is.h" static bool ten_engine_close_duplicated_remote_or_upgrade_it_to_normal( diff --git a/core/src/ten_runtime/engine/msg_interface/common.c b/core/src/ten_runtime/engine/msg_interface/common.c index 95cb5ad696..37d1ba8525 100644 --- a/core/src/ten_runtime/engine/msg_interface/common.c +++ b/core/src/ten_runtime/engine/msg_interface/common.c @@ -23,6 +23,7 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/msg_info.h" #include "include_internal/ten_runtime/remote/remote.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" @@ -30,7 +31,6 @@ #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static void ten_engine_prepend_to_in_msgs_queue(ten_engine_t *self, diff --git a/core/src/ten_runtime/engine/msg_interface/start_graph.c b/core/src/ten_runtime/engine/msg_interface/start_graph.c index de94d56bb0..fdb365bf2a 100644 --- a/core/src/ten_runtime/engine/msg_interface/start_graph.c +++ b/core/src/ten_runtime/engine/msg_interface/start_graph.c @@ -17,13 +17,13 @@ #include "include_internal/ten_runtime/path/path.h" #include "include_internal/ten_runtime/path/path_group.h" #include "include_internal/ten_runtime/remote/remote.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_ptr.h" #include "ten_utils/lib/error.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" void ten_engine_handle_cmd_start_graph(ten_engine_t *self, ten_shared_ptr_t *cmd, diff --git a/core/src/ten_runtime/engine/msg_interface/timer.c b/core/src/ten_runtime/engine/msg_interface/timer.c index bfcd72af63..aaa4884aa7 100644 --- a/core/src/ten_runtime/engine/msg_interface/timer.c +++ b/core/src/ten_runtime/engine/msg_interface/timer.c @@ -11,10 +11,10 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/timer/timer.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/timer/timer.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" static void ten_engine_timer_on_trigger(ten_timer_t *self, void *on_trigger_data) { diff --git a/core/src/ten_runtime/engine/on_xxx.c b/core/src/ten_runtime/engine/on_xxx.c index 67e5058ea1..1c90e50d05 100644 --- a/core/src/ten_runtime/engine/on_xxx.c +++ b/core/src/ten_runtime/engine/on_xxx.c @@ -16,12 +16,13 @@ #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" void ten_engine_on_all_extensions_added(void *self_, void *arg) { @@ -117,7 +118,7 @@ void ten_engine_on_extension_thread_inited(void *self_, void *arg) { self->extension_context->extension_threads_cnt_of_inited++; if (self->extension_context->extension_threads_cnt_of_inited == ten_list_size(&self->extension_context->extension_threads)) { - TEN_LOGD("[%s] All extension threads are inited.", + TEN_LOGD("[%s] All extension threads are initted.", ten_engine_get_name(self)); ten_list_foreach (&self->extension_context->extension_threads, iter) { @@ -171,8 +172,9 @@ void ten_engine_on_extension_thread_inited(void *self_, void *arg) { extension_thread->extension_context->state_requester_cmd = NULL; #if defined(_DEBUG) - ten_msg_dump(returned_cmd, NULL, - "Return extension-system-inited-result to previous stage: ^m"); + ten_msg_dump( + returned_cmd, NULL, + "Return extension-system-initted-result to previous stage: ^m"); #endif ten_engine_dispatch_msg(self, returned_cmd); diff --git a/core/src/ten_runtime/extension/extension.c b/core/src/ten_runtime/extension/extension.c index d4d6c8046f..e633632302 100644 --- a/core/src/ten_runtime/extension/extension.c +++ b/core/src/ten_runtime/extension/extension.c @@ -30,6 +30,8 @@ #include "include_internal/ten_runtime/path/path_table.h" #include "include_internal/ten_runtime/schema_store/store.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/addon/addon.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" @@ -47,8 +49,6 @@ #include "ten_utils/lib/ref.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_runtime/extension/extension_hdr.c b/core/src/ten_runtime/extension/extension_hdr.c index fd1d237c77..2641b457d1 100644 --- a/core/src/ten_runtime/extension/extension_hdr.c +++ b/core/src/ten_runtime/extension/extension_hdr.c @@ -5,8 +5,8 @@ // #include "include_internal/ten_runtime/extension/extension_hdr.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" ten_extensionhdr_t *ten_extensionhdr_create_for_extension( diff --git a/core/src/ten_runtime/extension/extension_info/extension_info.c b/core/src/ten_runtime/extension/extension_info/extension_info.c index 14edfc81f0..c9cd686f13 100644 --- a/core/src/ten_runtime/extension/extension_info/extension_info.c +++ b/core/src/ten_runtime/extension/extension_info/extension_info.c @@ -12,6 +12,7 @@ #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/extension/msg_dest_info/msg_dest_info.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_conversion.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" @@ -20,7 +21,6 @@ #include "ten_utils/lib/error.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" ten_extension_info_t *ten_extension_info_create(void) { diff --git a/core/src/ten_runtime/extension/extension_info/json.c b/core/src/ten_runtime/extension/extension_info/json.c index d169a1e358..ceda3c3659 100644 --- a/core/src/ten_runtime/extension/extension_info/json.c +++ b/core/src/ten_runtime/extension/extension_info/json.c @@ -10,11 +10,11 @@ #include "include_internal/ten_runtime/extension/msg_dest_info/json.h" #include "include_internal/ten_runtime/extension/msg_dest_info/msg_dest_info.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_conversion.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" static ten_json_t *pack_msg_dest(ten_extension_info_t *self, ten_list_t *msg_dests, ten_error_t *err) { diff --git a/core/src/ten_runtime/extension/extension_info/value.c b/core/src/ten_runtime/extension/extension_info/value.c index 8aa627fc04..c242cc69dd 100644 --- a/core/src/ten_runtime/extension/extension_info/value.c +++ b/core/src/ten_runtime/extension/extension_info/value.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/extension/extension_info/json.h" #include "include_internal/ten_runtime/extension/msg_dest_info/value.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_conversion.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/value/value_merge.h" #include "ten_utils/value/value_object.h" diff --git a/core/src/ten_runtime/extension/internal/extension_cb_default.c b/core/src/ten_runtime/extension/internal/extension_cb_default.c index a8a1d9be8c..294c1a01b3 100644 --- a/core/src/ten_runtime/extension/internal/extension_cb_default.c +++ b/core/src/ten_runtime/extension/internal/extension_cb_default.c @@ -5,13 +5,13 @@ // #include "include_internal/ten_runtime/extension/extension_cb_default.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" #include "ten_runtime/ten_env/internal/return.h" #include "ten_runtime/ten_env/internal/send.h" #include "ten_runtime/ten_env/ten_env.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" void ten_extension_on_init_default(ten_extension_t *self, ten_env_t *ten_env) { diff --git a/core/src/ten_runtime/extension/internal/metadata.c b/core/src/ten_runtime/extension/internal/metadata.c index 95686dc4d3..2ba3969124 100644 --- a/core/src/ten_runtime/extension/internal/metadata.c +++ b/core/src/ten_runtime/extension/internal/metadata.c @@ -15,8 +15,8 @@ #include "include_internal/ten_runtime/extension/ten_env/metadata.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_utils/lib/placeholder.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" #include "ten_utils/value/value_is.h" diff --git a/core/src/ten_runtime/extension/msg_dest_info/all_msg_type_dest_info.c b/core/src/ten_runtime/extension/msg_dest_info/all_msg_type_dest_info.c index d4e5e45ffa..85b48f51fb 100644 --- a/core/src/ten_runtime/extension/msg_dest_info/all_msg_type_dest_info.c +++ b/core/src/ten_runtime/extension/msg_dest_info/all_msg_type_dest_info.c @@ -7,11 +7,11 @@ #include "include_internal/ten_runtime/extension/extension_hdr.h" #include "include_internal/ten_runtime/extension/msg_dest_info/msg_dest_info.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_utils/container/list_ptr.h" #include "ten_utils/container/list_smart_ptr.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" void ten_all_msg_type_dest_static_info_init( ten_all_msg_type_dest_static_info_t *self) { diff --git a/core/src/ten_runtime/extension/msg_dest_info/json.c b/core/src/ten_runtime/extension/msg_dest_info/json.c index b799060cac..1db2f9b4a1 100644 --- a/core/src/ten_runtime/extension/msg_dest_info/json.c +++ b/core/src/ten_runtime/extension/msg_dest_info/json.c @@ -13,13 +13,13 @@ #include "include_internal/ten_runtime/extension/msg_dest_info/msg_dest_info.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion_operation.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_conversion.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" ten_json_t *ten_msg_dest_static_info_to_json( ten_msg_dest_static_info_t *self, ten_extension_info_t *src_extension_info, diff --git a/core/src/ten_runtime/extension/msg_dest_info/msg_dest_info.c b/core/src/ten_runtime/extension/msg_dest_info/msg_dest_info.c index 80bbd9d890..5c3d33c769 100644 --- a/core/src/ten_runtime/extension/msg_dest_info/msg_dest_info.c +++ b/core/src/ten_runtime/extension/msg_dest_info/msg_dest_info.c @@ -9,11 +9,11 @@ #include "include_internal/ten_runtime/extension/extension_info/extension_info.h" #include "include_internal/ten_runtime/extension/extension_info/json.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list_node_smart_ptr.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" bool ten_msg_dest_static_info_check_integrity( ten_msg_dest_static_info_t *self) { diff --git a/core/src/ten_runtime/extension/msg_dest_info/value.c b/core/src/ten_runtime/extension/msg_dest_info/value.c index 511986db96..70b97e446a 100644 --- a/core/src/ten_runtime/extension/msg_dest_info/value.c +++ b/core/src/ten_runtime/extension/msg_dest_info/value.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/extension/extension_info/extension_info.h" #include "include_internal/ten_runtime/extension/extension_info/value.h" #include "include_internal/ten_runtime/extension/msg_dest_info/msg_dest_info.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" // Parse the following snippet. // diff --git a/core/src/ten_runtime/extension/msg_handling.c b/core/src/ten_runtime/extension/msg_handling.c index 9d1dfddb22..7ae4ec701e 100644 --- a/core/src/ten_runtime/extension/msg_handling.c +++ b/core/src/ten_runtime/extension/msg_handling.c @@ -19,6 +19,8 @@ #include "include_internal/ten_runtime/path/path.h" #include "include_internal/ten_runtime/path/path_group.h" #include "include_internal/ten_runtime/path/path_table.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/ten_env/internal/return.h" @@ -26,8 +28,6 @@ #include "ten_utils/container/list_ptr.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" static void ten_extension_cache_cmd_result_to_in_path_for_auto_return( ten_extension_t *extension, ten_shared_ptr_t *cmd) { diff --git a/core/src/ten_runtime/extension/ten_env/metadata.c b/core/src/ten_runtime/extension/ten_env/metadata.c index 314c0b70a0..1c7c789440 100644 --- a/core/src/ten_runtime/extension/ten_env/metadata.c +++ b/core/src/ten_runtime/extension/ten_env/metadata.c @@ -13,10 +13,10 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/schema_store/store.h" #include "include_internal/ten_runtime/ten_env/metadata_cb.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_runtime/extension/ten_env/on_xxx.c b/core/src/ten_runtime/extension/ten_env/on_xxx.c index ec6459a728..6405e9ce6c 100644 --- a/core/src/ten_runtime/extension/ten_env/on_xxx.c +++ b/core/src/ten_runtime/extension/ten_env/on_xxx.c @@ -13,9 +13,9 @@ #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" static ten_extension_on_init_done_t *ten_extension_on_init_done_create( ten_extension_t *extension) { diff --git a/core/src/ten_runtime/extension/ten_extension_addon_and_instance_name_pair.c b/core/src/ten_runtime/extension/ten_extension_addon_and_instance_name_pair.c index 31eece81ec..629b6c5f76 100644 --- a/core/src/ten_runtime/extension/ten_extension_addon_and_instance_name_pair.c +++ b/core/src/ten_runtime/extension/ten_extension_addon_and_instance_name_pair.c @@ -5,9 +5,9 @@ // #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/extension/extension_addon_and_instance_name_pair.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" ten_extension_addon_and_instance_name_pair_t * ten_extension_addon_and_instance_name_pair_create( diff --git a/core/src/ten_runtime/extension_context/extension_context.c b/core/src/ten_runtime/extension_context/extension_context.c index 6c9dd08e04..8d03f19bcb 100644 --- a/core/src/ten_runtime/extension_context/extension_context.c +++ b/core/src/ten_runtime/extension_context/extension_context.c @@ -25,6 +25,8 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/ten_env/ten_env.h" @@ -35,8 +37,6 @@ #include "ten_utils/lib/error.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" bool ten_extension_context_check_integrity(ten_extension_context_t *self, bool check_thread) { diff --git a/core/src/ten_runtime/extension_context/internal/add_extension.c b/core/src/ten_runtime/extension_context/internal/add_extension.c index 52014ca99e..fff9052d52 100644 --- a/core/src/ten_runtime/extension_context/internal/add_extension.c +++ b/core/src/ten_runtime/extension_context/internal/add_extension.c @@ -13,8 +13,9 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" void ten_extension_context_add_extension(void *self_, void *arg) { ten_extension_context_t *self = self_; diff --git a/core/src/ten_runtime/extension_context/internal/del_extension.c b/core/src/ten_runtime/extension_context/internal/del_extension.c index 86a183d7fc..d659dfd702 100644 --- a/core/src/ten_runtime/extension_context/internal/del_extension.c +++ b/core/src/ten_runtime/extension_context/internal/del_extension.c @@ -13,9 +13,9 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" void ten_extension_context_delete_extension(void *self_, void *arg) { ten_extension_context_t *self = self_; diff --git a/core/src/ten_runtime/extension_context/internal/extension_group_is_inited.c b/core/src/ten_runtime/extension_context/internal/extension_group_is_inited.c index 6f15fb999d..74bdbb0f3b 100644 --- a/core/src/ten_runtime/extension_context/internal/extension_group_is_inited.c +++ b/core/src/ten_runtime/extension_context/internal/extension_group_is_inited.c @@ -11,10 +11,10 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" void ten_extension_context_on_all_extensions_in_extension_group_are_inited( void *self_, void *arg) { @@ -32,26 +32,26 @@ void ten_extension_context_on_all_extensions_in_extension_group_are_inited( ten_extension_group_check_integrity(extension_group, false), "Should not happen."); - TEN_LOGD("[%s] Engine is notified that %s is inited", + TEN_LOGD("[%s] Engine is notified that %s is initted", ten_engine_get_name(self->engine), ten_string_get_raw_str(&extension_group->name)); self->extension_threads_cnt_of_all_extensions_inited++; // TODO(Wei): At present, we only check whether all extension threads in the - // same TEN app has reached the 'inited' state. And if this condition is met, + // same TEN app has reached the 'initted' state. And if this condition is met, // the engine will enable all the extension threads (in the belonging TEN app) // proceed to the 'on_start' stage. // // If, in the future, we need to ensure that all extension threads in _all_ - // the TEN app have reached the 'inited' state before entering into the + // the TEN app have reached the 'initted' state before entering into the // 'on_start' stage, this location is the right place to add more logic about // this. if (self->extension_threads_cnt_of_all_extensions_inited == ten_list_size(&self->extension_threads)) { TEN_LOGD( - "[%s] All extension threads enter 'all extensions are inited' state.", + "[%s] All extension threads enter 'all extensions are initted' state.", ten_engine_get_name(self->engine)); ten_list_foreach (&self->extension_threads, iter) { diff --git a/core/src/ten_runtime/extension_context/internal/extension_group_is_stopped.c b/core/src/ten_runtime/extension_context/internal/extension_group_is_stopped.c index 0b7b03a905..bfcca304ac 100644 --- a/core/src/ten_runtime/extension_context/internal/extension_group_is_stopped.c +++ b/core/src/ten_runtime/extension_context/internal/extension_group_is_stopped.c @@ -11,10 +11,10 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" void ten_extension_context_on_all_extensions_in_extension_group_are_stopped( void *self_, void *arg) { diff --git a/core/src/ten_runtime/extension_context/internal/extension_thread_is_closing.c b/core/src/ten_runtime/extension_context/internal/extension_thread_is_closing.c index ce54c588cf..1dff1115ac 100644 --- a/core/src/ten_runtime/extension_context/internal/extension_thread_is_closing.c +++ b/core/src/ten_runtime/extension_context/internal/extension_thread_is_closing.c @@ -11,10 +11,10 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" void ten_extension_context_on_extension_thread_closing_flag_is_set(void *self_, void *arg) { diff --git a/core/src/ten_runtime/extension_context/ten_env/on_xxx.c b/core/src/ten_runtime/extension_context/ten_env/on_xxx.c index ce4e45101f..ea59e0d759 100644 --- a/core/src/ten_runtime/extension_context/ten_env/on_xxx.c +++ b/core/src/ten_runtime/extension_context/ten_env/on_xxx.c @@ -9,8 +9,9 @@ #include "include_internal/ten_runtime/engine/engine.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" void ten_extension_context_on_addon_create_extension_group_done( diff --git a/core/src/ten_runtime/extension_group/extension_group.c b/core/src/ten_runtime/extension_group/extension_group.c index 75d6964edc..6f81b3ddb8 100644 --- a/core/src/ten_runtime/extension_group/extension_group.c +++ b/core/src/ten_runtime/extension_group/extension_group.c @@ -14,6 +14,8 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" @@ -22,8 +24,6 @@ #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/ref.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/sanitizer/thread_check.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_runtime/extension_group/extension_group_info/extension_group_info.c b/core/src/ten_runtime/extension_group/extension_group_info/extension_group_info.c index 37ba528e25..077aab6b56 100644 --- a/core/src/ten_runtime/extension_group/extension_group_info/extension_group_info.c +++ b/core/src/ten_runtime/extension_group/extension_group_info/extension_group_info.c @@ -8,11 +8,11 @@ #include #include "include_internal/ten_runtime/common/loc.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" bool ten_extension_group_info_check_integrity( diff --git a/core/src/ten_runtime/extension_group/extension_group_info/json.c b/core/src/ten_runtime/extension_group/extension_group_info/json.c index 1666b88d75..8c159fa8b9 100644 --- a/core/src/ten_runtime/extension_group/extension_group_info/json.c +++ b/core/src/ten_runtime/extension_group/extension_group_info/json.c @@ -7,10 +7,10 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/extension_group/extension_group_info/extension_group_info.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" // NOLINTNEXTLINE(misc-no-recursion) ten_json_t *ten_extension_group_info_to_json(ten_extension_group_info_t *self) { diff --git a/core/src/ten_runtime/extension_group/extension_group_info/value.c b/core/src/ten_runtime/extension_group/extension_group_info/value.c index 34035c893a..c293d4251b 100644 --- a/core/src/ten_runtime/extension_group/extension_group_info/value.c +++ b/core/src/ten_runtime/extension_group/extension_group_info/value.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/extension/extension_info/extension_info.h" #include "include_internal/ten_runtime/extension_group/extension_group_info/extension_group_info.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/value/value_merge.h" #include "ten_utils/value/value_object.h" diff --git a/core/src/ten_runtime/extension_group/internal/metadata.c b/core/src/ten_runtime/extension_group/internal/metadata.c index 56ef3190c9..786b8e89db 100644 --- a/core/src/ten_runtime/extension_group/internal/metadata.c +++ b/core/src/ten_runtime/extension_group/internal/metadata.c @@ -11,8 +11,8 @@ #include "include_internal/ten_runtime/extension_group/extension_group_info/extension_group_info.h" #include "include_internal/ten_runtime/extension_group/on_xxx.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" void ten_extension_group_load_metadata(ten_extension_group_t *self) { TEN_ASSERT(self && diff --git a/core/src/ten_runtime/extension_group/ten_env/metadata.c b/core/src/ten_runtime/extension_group/ten_env/metadata.c index a64a4c86a2..bdb01c324f 100644 --- a/core/src/ten_runtime/extension_group/ten_env/metadata.c +++ b/core/src/ten_runtime/extension_group/ten_env/metadata.c @@ -8,8 +8,8 @@ #include "include_internal/ten_runtime/app/ten_env/metadata.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" bool ten_extension_group_set_property(ten_extension_group_t *extension_group, const char *name, ten_value_t *value) { diff --git a/core/src/ten_runtime/extension_group/ten_env/on_xxx.c b/core/src/ten_runtime/extension_group/ten_env/on_xxx.c index b9e907073e..a62a6c0bca 100644 --- a/core/src/ten_runtime/extension_group/ten_env/on_xxx.c +++ b/core/src/ten_runtime/extension_group/ten_env/on_xxx.c @@ -15,11 +15,12 @@ #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/container/list.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" void ten_extension_group_on_init(ten_env_t *ten_env) { TEN_ASSERT(ten_env && ten_env_check_integrity(ten_env, true), diff --git a/core/src/ten_runtime/extension_store/extension_store.c b/core/src/ten_runtime/extension_store/extension_store.c index fa29fa498a..a6290807e3 100644 --- a/core/src/ten_runtime/extension_store/extension_store.c +++ b/core/src/ten_runtime/extension_store/extension_store.c @@ -9,12 +9,13 @@ #include #include "include_internal/ten_runtime/extension/extension.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/hash_table.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" TEN_UNUSED static bool ten_extension_store_check_integrity( diff --git a/core/src/ten_runtime/extension_thread/extension_thread.c b/core/src/ten_runtime/extension_thread/extension_thread.c index 651228931e..dbffc799d2 100644 --- a/core/src/ten_runtime/extension_thread/extension_thread.c +++ b/core/src/ten_runtime/extension_thread/extension_thread.c @@ -22,7 +22,8 @@ #include "include_internal/ten_runtime/extension_thread/msg_interface/common.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/new.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/sanitizer/thread_check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/ten_env/ten_env.h" @@ -32,8 +33,6 @@ #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/string.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" @@ -105,8 +104,6 @@ ten_extension_thread_t *ten_extension_thread_create(void) { ten_sanitizer_thread_check_init(&self->thread_check); self->runloop = NULL; - ten_log_new_init(&self->log); - return self; } @@ -155,8 +152,6 @@ void ten_extension_thread_destroy(ten_extension_thread_t *self) { ten_mutex_destroy(self->lock_mode_lock); self->lock_mode_lock = NULL; - ten_log_new_deinit(&self->log); - TEN_FREE(self); } @@ -249,7 +244,7 @@ static void ten_extension_thread_inherit_thread_ownership( } void *ten_extension_thread_main_actual(ten_extension_thread_t *self) { - TEN_LOG_NEW(&self->log, TEN_LOG_NEW_DEBUG, "Extension thread is started"); + TEN_LOGD("Extension thread is started"); TEN_ASSERT(self && // TEN_NOLINTNEXTLINE(thread-check) diff --git a/core/src/ten_runtime/extension_thread/msg_interface/common.c b/core/src/ten_runtime/extension_thread/msg_interface/common.c index aaa47cb797..1b775c4ef0 100644 --- a/core/src/ten_runtime/extension_thread/msg_interface/common.c +++ b/core/src/ten_runtime/extension_thread/msg_interface/common.c @@ -19,6 +19,8 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" @@ -29,8 +31,7 @@ #include "ten_utils/lib/event.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" void ten_extension_thread_handle_start_msg_task(void *self_, TEN_UNUSED void *arg) { diff --git a/core/src/ten_runtime/extension_thread/on_xxx.c b/core/src/ten_runtime/extension_thread/on_xxx.c index ad128731aa..538416feb2 100644 --- a/core/src/ten_runtime/extension_thread/on_xxx.c +++ b/core/src/ten_runtime/extension_thread/on_xxx.c @@ -37,6 +37,8 @@ #include "include_internal/ten_runtime/path/path_table.h" #include "include_internal/ten_runtime/schema_store/store.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/container/list.h" @@ -45,8 +47,6 @@ #include "ten_utils/lib/error.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" #include "ten_utils/value/value.h" @@ -310,7 +310,7 @@ void ten_extension_thread_on_extension_on_init_done(void *self_, void *arg) { if (self->extensions_cnt_of_on_init_done == ten_list_size(&self->extensions)) { - // All extensions in this extension group/thread have been inited. + // All extensions in this extension group/thread have been initted. // Because the extension's on_init() may initialize some states of the // extension, we must wait until all extensions have completed their @@ -706,7 +706,7 @@ void ten_extension_thread_on_all_extensions_in_all_extension_threads_added_to_en // the `interface` info is not available until `Extension::on_init_done()`. ten_extension_thread_determine_all_extension_dest_from_graph(self); - // Notify the engine that the extension thread is inited. + // Notify the engine that the extension thread is initted. ten_engine_t *engine = self->extension_context->engine; // TEN_NOLINTNEXTLINE(thread-check) // thread-check: The runloop of the engine will not be changed during the diff --git a/core/src/ten_runtime/global/global.c b/core/src/ten_runtime/global/global.c index 41d146c8fb..8e6926eaea 100644 --- a/core/src/ten_runtime/global/global.c +++ b/core/src/ten_runtime/global/global.c @@ -3,7 +3,7 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "ten_runtime/global/global.h" +#include "include_internal/ten_runtime/global/global.h" #include "include_internal/ten_runtime/app/app.h" #include "include_internal/ten_runtime/common/preserved_metadata.h" diff --git a/core/src/ten_runtime/global/on_load.c b/core/src/ten_runtime/global/on_load.c index 987474a03c..7d6dfda64b 100644 --- a/core/src/ten_runtime/global/on_load.c +++ b/core/src/ten_runtime/global/on_load.c @@ -3,12 +3,11 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "include_internal/ten_runtime/addon/addon_autoload.h" #include "include_internal/ten_runtime/common/log.h" +#include "include_internal/ten_runtime/global/global.h" #include "include_internal/ten_runtime/global/signal.h" -#include "ten_runtime/global/global.h" -#include "ten_utils/backtrace/backtrace.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/ctor.h" #include "ten_utils/sanitizer/memory_check.h" @@ -31,11 +30,13 @@ TEN_CONSTRUCTOR(ten_runtime_on_load) { ten_global_init(); ten_global_setup_signal_stuff(); - ten_log_set_output_level(DEFAULT_LOG_LEVEL); + ten_log_global_init(); + ten_log_global_set_output_level(DEFAULT_LOG_OUTPUT_LEVEL); } TEN_DESTRUCTOR(ten_runtime_on_unload) { ten_global_deinit(); + ten_log_global_deinit(); ten_backtrace_destroy_global(); ten_global_signal_alt_stack_destroy(); ten_sanitizer_memory_record_deinit(); diff --git a/core/src/ten_runtime/global/signal.c b/core/src/ten_runtime/global/signal.c index a4b7545f08..40dbef5246 100644 --- a/core/src/ten_runtime/global/signal.c +++ b/core/src/ten_runtime/global/signal.c @@ -11,13 +11,14 @@ #include #include "include_internal/ten_runtime/app/close.h" +#include "include_internal/ten_runtime/global/global.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" -#include "ten_runtime/global/global.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" #include "ten_utils/sanitizer/memory_check.h" @@ -72,7 +73,7 @@ static void ten_global_signal_handler(int signo, TEN_UNUSED siginfo_t *info, } // The alternate stack size. - #define ALT_STACK_SIZE (unsigned long)(1024 * 1024) +#define ALT_STACK_SIZE (unsigned long)(1024 * 1024) void *g_alt_stack = NULL; diff --git a/core/src/ten_runtime/metadata/default/default.c b/core/src/ten_runtime/metadata/default/default.c index ab3d205881..cafb84340d 100644 --- a/core/src/ten_runtime/metadata/default/default.c +++ b/core/src/ten_runtime/metadata/default/default.c @@ -6,6 +6,7 @@ #include "include_internal/ten_runtime/metadata/metadata.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/path.h" +#include "ten_utils/macro/mark.h" void ten_set_default_manifest_info(const char *base_dir, ten_metadata_info_t *manifest, diff --git a/core/src/ten_runtime/metadata/metadata.c b/core/src/ten_runtime/metadata/metadata.c index 5b1cc409b8..e70aeff971 100644 --- a/core/src/ten_runtime/metadata/metadata.c +++ b/core/src/ten_runtime/metadata/metadata.c @@ -9,11 +9,11 @@ #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/schema_store/store.h" #include "include_internal/ten_rust/ten_rust.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/file.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_is.h" #include "ten_utils/value/value_object.h" diff --git a/core/src/ten_runtime/metadata/metadata_info.c b/core/src/ten_runtime/metadata/metadata_info.c index bd0aba1ba5..35820725fb 100644 --- a/core/src/ten_runtime/metadata/metadata_info.c +++ b/core/src/ten_runtime/metadata/metadata_info.c @@ -14,13 +14,13 @@ #include "include_internal/ten_runtime/extension_group/on_xxx.h" #include "include_internal/ten_runtime/metadata/default/default.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/path.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" bool ten_metadata_info_check_integrity(ten_metadata_info_t *self) { TEN_ASSERT(self, "Should not happen."); diff --git a/core/src/ten_runtime/msg/audio_frame/field/bytes_per_sample.c b/core/src/ten_runtime/msg/audio_frame/field/bytes_per_sample.c index 25c94e435f..f13c87ff00 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/bytes_per_sample.c +++ b/core/src/ten_runtime/msg/audio_frame/field/bytes_per_sample.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_audio_frame_put_bytes_per_sample_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/audio_frame/field/channel_layout.c b/core/src/ten_runtime/msg/audio_frame/field/channel_layout.c index 50130aaffc..8b2cc10e87 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/channel_layout.c +++ b/core/src/ten_runtime/msg/audio_frame/field/channel_layout.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" void ten_audio_frame_put_channel_layout_to_json(ten_msg_t *self, ten_json_t *json) { diff --git a/core/src/ten_runtime/msg/audio_frame/field/data_fmt.c b/core/src/ten_runtime/msg/audio_frame/field/data_fmt.c index 95e50fce63..7c28cfbae7 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/data_fmt.c +++ b/core/src/ten_runtime/msg/audio_frame/field/data_fmt.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" const char *ten_audio_frame_data_fmt_to_string( const TEN_AUDIO_FRAME_DATA_FMT data_fmt) { diff --git a/core/src/ten_runtime/msg/audio_frame/field/line_size.c b/core/src/ten_runtime/msg/audio_frame/field/line_size.c index bb30e5ec78..396dafe776 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/line_size.c +++ b/core/src/ten_runtime/msg/audio_frame/field/line_size.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_audio_frame_put_line_size_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/audio_frame/field/number_of_channel.c b/core/src/ten_runtime/msg/audio_frame/field/number_of_channel.c index 03cd0f8a0c..9f6eb4c314 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/number_of_channel.c +++ b/core/src/ten_runtime/msg/audio_frame/field/number_of_channel.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_audio_frame_put_number_of_channel_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/audio_frame/field/sample_rate.c b/core/src/ten_runtime/msg/audio_frame/field/sample_rate.c index 5e3ad42df1..8f57b54015 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/sample_rate.c +++ b/core/src/ten_runtime/msg/audio_frame/field/sample_rate.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_audio_frame_put_sample_rate_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/audio_frame/field/samples_per_channel.c b/core/src/ten_runtime/msg/audio_frame/field/samples_per_channel.c index c71288a1dc..e9acac49ea 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/samples_per_channel.c +++ b/core/src/ten_runtime/msg/audio_frame/field/samples_per_channel.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_audio_frame_put_samples_per_channel_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/audio_frame/field/timestamp.c b/core/src/ten_runtime/msg/audio_frame/field/timestamp.c index 530e9ce216..df4d8a28b4 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/timestamp.c +++ b/core/src/ten_runtime/msg/audio_frame/field/timestamp.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_audio_frame_put_timestamp_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/audio_frame/pcm_frame.c b/core/src/ten_runtime/msg/audio_frame/pcm_frame.c index 844e95077d..799778c44a 100644 --- a/core/src/ten_runtime/msg/audio_frame/pcm_frame.c +++ b/core/src/ten_runtime/msg/audio_frame/pcm_frame.c @@ -11,12 +11,12 @@ #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/audio_frame/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "include_internal/ten_utils/value/value_set.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/close_app/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/close_app/cmd.c index 216d24f54f..92f4a35477 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/close_app/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/close_app/cmd.c @@ -11,10 +11,10 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/close_app/field/field_info.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" static void ten_raw_cmd_close_app_destroy(ten_cmd_close_app_t *self) { TEN_ASSERT(self, "Should not happen."); diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/cmd.c index 4da10441bd..2890b0fdc8 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/cmd.c @@ -14,12 +14,12 @@ #include "include_internal/ten_runtime/msg/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/msg_info.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/cmd/cmd.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" bool ten_raw_cmd_check_integrity(ten_cmd_t *self) { TEN_ASSERT(self, "Should not happen."); diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/custom/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/custom/cmd.c index 58c5709252..0482e36e53 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/custom/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/custom/cmd.c @@ -14,6 +14,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/custom/field/field_info.h" #include "include_internal/ten_runtime/msg/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" @@ -23,7 +24,7 @@ #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/value/value.h" static void ten_raw_cmd_custom_destroy(ten_cmd_t *self) { diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.c index 7f73514a29..0595f984e6 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.c @@ -21,6 +21,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" @@ -28,7 +29,7 @@ #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" static ten_cmd_start_graph_t *get_raw_cmd(ten_shared_ptr_t *self) { TEN_ASSERT(self && ten_cmd_base_check_integrity(self), "Should not happen."); diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/extension_info.c b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/extension_info.c index f8b35dcb76..153c8d8eb0 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/extension_info.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/extension_info.c @@ -16,6 +16,8 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/cmd/start_graph/cmd.h" #include "ten_utils/container/list.h" @@ -24,8 +26,7 @@ #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_cmd_start_graph_put_extension_info_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/long_running_mode.c b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/long_running_mode.c index a9226d45ab..888bf7d498 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/long_running_mode.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/long_running_mode.c @@ -3,17 +3,17 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // - #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/extension/extension_info/extension_info.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/cmd/start_graph/cmd.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_cmd_start_graph_put_long_running_mode_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/predefined_graph_name.c b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/predefined_graph_name.c index 2e72b13364..ce71f629ac 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/predefined_graph_name.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/predefined_graph_name.c @@ -8,11 +8,12 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/cmd/start_graph/cmd.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_cmd_start_graph_put_predefined_graph_name_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/cmd.c index b5dee18a93..9a7440d4e3 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/cmd.c @@ -10,12 +10,12 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/stop_graph/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/cmd/stop_graph/cmd.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" static ten_cmd_stop_graph_t *get_raw_cmd(ten_shared_ptr_t *self) { TEN_ASSERT(self && ten_cmd_base_check_integrity(self), "Should not happen."); diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/field/graph_name.c b/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/field/graph_name.c index 86ae130cc9..7919b510d7 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/field/graph_name.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/field/graph_name.c @@ -10,10 +10,11 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/stop_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_cmd_stop_graph_put_graph_name_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timeout/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/timeout/cmd.c index b0bf516654..fae2bfbe6f 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timeout/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timeout/cmd.c @@ -10,10 +10,10 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timeout/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" static ten_cmd_timeout_t *get_raw_cmd(ten_shared_ptr_t *self) { TEN_ASSERT(self && ten_cmd_base_check_integrity(self), "Should not happen."); diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timeout/field/timer_id.c b/core/src/ten_runtime/msg/cmd_base/cmd/timeout/field/timer_id.c index 610a1a8d66..0a00be6d22 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timeout/field/timer_id.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timeout/field/timer_id.c @@ -9,9 +9,10 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/timeout/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/json.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_cmd_timeout_put_timer_id_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timer/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/timer/cmd.c index a9adb17e1f..29a9e6d5f7 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timer/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timer/cmd.c @@ -11,6 +11,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" @@ -18,7 +19,6 @@ #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value_get.h" #include "ten_utils/value/value_is.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timeout_in_us.c b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timeout_in_us.c index 4f72114c17..e0b95a8147 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timeout_in_us.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timeout_in_us.c @@ -6,9 +6,10 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/json.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_cmd_timer_put_timeout_in_us_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timer_id.c b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timer_id.c index ca0aec2bda..33899e3c0e 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timer_id.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timer_id.c @@ -3,13 +3,13 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // - #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/json.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_cmd_timer_put_timer_id_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/times.c b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/times.c index 52c855d828..289c1bc09e 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/times.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/times.c @@ -3,15 +3,15 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // - #include #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/json.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_cmd_timer_put_times_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/cmd_base/cmd_base.c b/core/src/ten_runtime/msg/cmd_base/cmd_base.c index 2adadb716e..de0fb22e53 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd_base.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd_base.c @@ -14,11 +14,11 @@ #include "include_internal/ten_runtime/msg/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/remote/remote.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" #include "ten_utils/lib/uuid.h" -#include "ten_utils/macro/check.h" bool ten_raw_cmd_base_check_integrity(ten_cmd_base_t *self) { TEN_ASSERT(self, "Should not happen."); diff --git a/core/src/ten_runtime/msg/cmd_base/cmd_result/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd_result/cmd.c index a51d1d7680..e8e6d069db 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd_result/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd_result/cmd.c @@ -16,13 +16,13 @@ #include "include_internal/ten_runtime/schema_store/cmd.h" #include "include_internal/ten_runtime/schema_store/msg.h" #include "include_internal/ten_runtime/schema_store/store.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" static bool ten_raw_cmd_result_check_integrity(ten_cmd_result_t *self) { diff --git a/core/src/ten_runtime/msg/cmd_base/cmd_result/field/original_cmd_type.c b/core/src/ten_runtime/msg/cmd_base/cmd_result/field/original_cmd_type.c index 49e31a3ed5..f7df1d20f0 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd_result/field/original_cmd_type.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd_result/field/original_cmd_type.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_result/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/lib/json.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_cmd_result_put_original_cmd_type_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/cmd_base/cmd_result/field/status_code.c b/core/src/ten_runtime/msg/cmd_base/cmd_result/field/status_code.c index 2565813ad1..9da076b2fd 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd_result/field/status_code.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd_result/field/status_code.c @@ -8,11 +8,12 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_result/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/lib/json.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_cmd_result_put_status_code_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/cmd_base/field/cmd_id.c b/core/src/ten_runtime/msg/cmd_base/field/cmd_id.c index 8cd3c55c3b..a72449e560 100644 --- a/core/src/ten_runtime/msg/cmd_base/field/cmd_id.c +++ b/core/src/ten_runtime/msg/cmd_base/field/cmd_id.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_cmd_base_put_cmd_id_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/cmd_base/field/original_connection.c b/core/src/ten_runtime/msg/cmd_base/field/original_connection.c index c223bc166c..72be335ef7 100644 --- a/core/src/ten_runtime/msg/cmd_base/field/original_connection.c +++ b/core/src/ten_runtime/msg/cmd_base/field/original_connection.c @@ -5,10 +5,11 @@ // #include "include_internal/ten_runtime/msg/cmd_base/field/original_connection.h" -#include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" +#include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" void ten_cmd_base_copy_original_connection( ten_msg_t *self, ten_msg_t *src, diff --git a/core/src/ten_runtime/msg/cmd_base/field/response_handler.c b/core/src/ten_runtime/msg/cmd_base/field/response_handler.c index 0c7b1a3ede..516acc285a 100644 --- a/core/src/ten_runtime/msg/cmd_base/field/response_handler.c +++ b/core/src/ten_runtime/msg/cmd_base/field/response_handler.c @@ -3,11 +3,11 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // - -#include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" +#include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" void ten_cmd_base_copy_result_handler( ten_msg_t *self, ten_msg_t *src, diff --git a/core/src/ten_runtime/msg/cmd_base/field/response_handler_data.c b/core/src/ten_runtime/msg/cmd_base/field/response_handler_data.c index 1c68d2acd9..1903e10c1d 100644 --- a/core/src/ten_runtime/msg/cmd_base/field/response_handler_data.c +++ b/core/src/ten_runtime/msg/cmd_base/field/response_handler_data.c @@ -3,11 +3,11 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // - -#include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" +#include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" void ten_cmd_base_copy_result_handler_data( ten_msg_t *self, ten_msg_t *src, diff --git a/core/src/ten_runtime/msg/cmd_base/field/seq_id.c b/core/src/ten_runtime/msg/cmd_base/field/seq_id.c index fb4f34453c..43f9f7b41a 100644 --- a/core/src/ten_runtime/msg/cmd_base/field/seq_id.c +++ b/core/src/ten_runtime/msg/cmd_base/field/seq_id.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_cmd_base_put_seq_id_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/data/data.c b/core/src/ten_runtime/msg/data/data.c index 0be88775e2..1a9604af6f 100644 --- a/core/src/ten_runtime/msg/data/data.c +++ b/core/src/ten_runtime/msg/data/data.c @@ -8,6 +8,7 @@ #include "include_internal/ten_runtime/msg/data/field/field_info.h" #include "include_internal/ten_runtime/msg/locked_res.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/alloc.h" @@ -15,7 +16,7 @@ #include "ten_utils/lib/json.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/value/value_get.h" bool ten_raw_data_check_integrity(ten_data_t *self) { diff --git a/core/src/ten_runtime/msg/field/dest.c b/core/src/ten_runtime/msg/field/dest.c index 7a9caa0130..0591fa0e5c 100644 --- a/core/src/ten_runtime/msg/field/dest.c +++ b/core/src/ten_runtime/msg/field/dest.c @@ -9,9 +9,10 @@ #include "include_internal/ten_runtime/common/loc.h" #include "include_internal/ten_runtime/extension/extension_info/extension_info.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" // Set dest information of msg from JSON content if there are any. bool ten_raw_msg_dest_from_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/field/name.c b/core/src/ten_runtime/msg/field/name.c index a9244c193d..0b957b0f93 100644 --- a/core/src/ten_runtime/msg/field/name.c +++ b/core/src/ten_runtime/msg/field/name.c @@ -5,10 +5,11 @@ // #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_raw_msg_name_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/field/properties.c b/core/src/ten_runtime/msg/field/properties.c index 86e569769b..2c370d3e2d 100644 --- a/core/src/ten_runtime/msg/field/properties.c +++ b/core/src/ten_runtime/msg/field/properties.c @@ -8,13 +8,14 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_merge.h" diff --git a/core/src/ten_runtime/msg/field/src.c b/core/src/ten_runtime/msg/field/src.c index a0d03025c3..c901306419 100644 --- a/core/src/ten_runtime/msg/field/src.c +++ b/core/src/ten_runtime/msg/field/src.c @@ -8,8 +8,9 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/common/loc.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_raw_msg_src_from_json(ten_msg_t *self, ten_json_t *json, TEN_UNUSED ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/field/type.c b/core/src/ten_runtime/msg/field/type.c index 22ced2dd92..725463c1cd 100644 --- a/core/src/ten_runtime/msg/field/type.c +++ b/core/src/ten_runtime/msg/field/type.c @@ -7,8 +7,9 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_raw_msg_type_from_json(ten_msg_t *self, ten_json_t *json, TEN_UNUSED ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/locked_res.c b/core/src/ten_runtime/msg/locked_res.c index d242dfa73c..5c148e9f15 100644 --- a/core/src/ten_runtime/msg/locked_res.c +++ b/core/src/ten_runtime/msg/locked_res.c @@ -6,11 +6,11 @@ #include "include_internal/ten_runtime/msg/locked_res.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_ptr.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" static bool ten_msg_locked_res_check_integrity(ten_msg_locked_res_t *self) { TEN_ASSERT(self, "Should not happen."); diff --git a/core/src/ten_runtime/msg/msg.c b/core/src/ten_runtime/msg/msg.c index 5aba56bda4..05de597927 100644 --- a/core/src/ten_runtime/msg/msg.c +++ b/core/src/ten_runtime/msg/msg.c @@ -22,6 +22,8 @@ #include "include_internal/ten_runtime/msg/field/field_info.h" #include "include_internal/ten_runtime/msg/msg_info.h" #include "include_internal/ten_runtime/schema_store/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" @@ -37,8 +39,6 @@ #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_runtime/msg/video_frame/field/height.c b/core/src/ten_runtime/msg/video_frame/field/height.c index fd7fc38c83..02b4a99002 100644 --- a/core/src/ten_runtime/msg/video_frame/field/height.c +++ b/core/src/ten_runtime/msg/video_frame/field/height.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/video_frame/video_frame.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/msg.h" #include "ten_runtime/msg/video_frame/video_frame.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_video_frame_put_height_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/video_frame/field/pixel_fmt.c b/core/src/ten_runtime/msg/video_frame/field/pixel_fmt.c index e5060248db..ac67aaa3f8 100644 --- a/core/src/ten_runtime/msg/video_frame/field/pixel_fmt.c +++ b/core/src/ten_runtime/msg/video_frame/field/pixel_fmt.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/video_frame/video_frame.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/msg.h" #include "ten_runtime/msg/video_frame/video_frame.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" const char *ten_video_frame_pixel_fmt_to_string(const TEN_PIXEL_FMT pixel_fmt) { switch (pixel_fmt) { diff --git a/core/src/ten_runtime/msg/video_frame/field/timestamp.c b/core/src/ten_runtime/msg/video_frame/field/timestamp.c index 87e88badcf..60c98b385b 100644 --- a/core/src/ten_runtime/msg/video_frame/field/timestamp.c +++ b/core/src/ten_runtime/msg/video_frame/field/timestamp.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/video_frame/video_frame.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/msg.h" #include "ten_runtime/msg/video_frame/video_frame.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_video_frame_put_timestamp_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/video_frame/field/width.c b/core/src/ten_runtime/msg/video_frame/field/width.c index 73be04dbb6..8e21312e88 100644 --- a/core/src/ten_runtime/msg/video_frame/field/width.c +++ b/core/src/ten_runtime/msg/video_frame/field/width.c @@ -8,10 +8,11 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/video_frame/video_frame.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/msg.h" #include "ten_runtime/msg/video_frame/video_frame.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_video_frame_put_width_to_json(ten_msg_t *self, ten_json_t *json, ten_error_t *err) { diff --git a/core/src/ten_runtime/msg/video_frame/video_frame.c b/core/src/ten_runtime/msg/video_frame/video_frame.c index 401cee966f..b42c819751 100644 --- a/core/src/ten_runtime/msg/video_frame/video_frame.c +++ b/core/src/ten_runtime/msg/video_frame/video_frame.c @@ -11,6 +11,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/video_frame/field/field_info.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "include_internal/ten_utils/value/value_set.h" #include "ten_runtime/common/errno.h" @@ -19,7 +20,6 @@ #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/buf.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion.c b/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion.c index 9d42852fc2..729acb8c5d 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion.c @@ -6,9 +6,9 @@ #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" ten_msg_and_result_conversion_t *ten_msg_and_result_conversion_create( ten_shared_ptr_t *msg, ten_msg_conversion_operation_t *result_conversion) { diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion_operation.c b/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion_operation.c index 03189daa4a..361b2ad550 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion_operation.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion_operation.c @@ -7,9 +7,9 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/base.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" static ten_msg_and_result_conversion_operation_t * diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion/msg_conversion.c b/core/src/ten_runtime/msg_conversion/msg_conversion/msg_conversion.c index 5bfe255cc7..ad8ae363f2 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion/msg_conversion.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion/msg_conversion.c @@ -12,6 +12,7 @@ #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion_operation.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/base.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" @@ -20,7 +21,6 @@ #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/type.h" bool ten_msg_conversion_check_integrity(ten_msg_conversion_t *self) { diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/base.c b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/base.c index 228d4d85b4..eeb0607521 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/base.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/base.c @@ -8,10 +8,10 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/per_property/per_property.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_kv.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/fixed_value.c b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/fixed_value.c index 52265b8ad4..f154f26bee 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/fixed_value.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/fixed_value.c @@ -8,10 +8,10 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/field/properties.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_convert.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/type.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/from_original.c b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/from_original.c index d427899e46..26b65c0863 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/from_original.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/from_original.c @@ -8,10 +8,10 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/field/properties.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_kv.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/per_property.c b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/per_property.c index d396a9721b..a5e0775771 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/per_property.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/per_property.c @@ -9,9 +9,9 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/base.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rules.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_is.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rule.c b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rule.c index 89463887d4..4bd817899b 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rule.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rule.c @@ -8,13 +8,13 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/per_property/fixed_value.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_kv.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rules.c b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rules.c index fffe8fe704..ff415074da 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rules.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rules.c @@ -10,13 +10,13 @@ #include "include_internal/ten_runtime/msg/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rule.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_kv.h" diff --git a/core/src/ten_runtime/path/path.c b/core/src/ten_runtime/path/path.c index d3dfeaa5bf..316ad4e9c6 100644 --- a/core/src/ten_runtime/path/path.c +++ b/core/src/ten_runtime/path/path.c @@ -12,10 +12,10 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/base.h" #include "include_internal/ten_runtime/path/path_group.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/sanitizer/thread_check.h" bool ten_path_check_integrity(ten_path_t *self, bool check_thread) { diff --git a/core/src/ten_runtime/path/path_group.c b/core/src/ten_runtime/path/path_group.c index 16bdac4914..2982ebdfc9 100644 --- a/core/src/ten_runtime/path/path_group.c +++ b/core/src/ten_runtime/path/path_group.c @@ -9,6 +9,7 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/path/path.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/container/list.h" @@ -16,7 +17,7 @@ #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_path_group_check_integrity(ten_path_group_t *self, bool check_thread) { TEN_ASSERT(self, "Should not happen."); diff --git a/core/src/ten_runtime/path/path_in.c b/core/src/ten_runtime/path/path_in.c index 0f1a8777d7..a756af302c 100644 --- a/core/src/ten_runtime/path/path_in.c +++ b/core/src/ten_runtime/path/path_in.c @@ -7,8 +7,8 @@ #include "include_internal/ten_runtime/path/path.h" #include "include_internal/ten_runtime/path/path_table.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" ten_path_in_t *ten_path_in_create( ten_path_table_t *table, const char *cmd_name, const char *parent_cmd_id, diff --git a/core/src/ten_runtime/path/path_out.c b/core/src/ten_runtime/path/path_out.c index 71b26b3122..ac123aaf08 100644 --- a/core/src/ten_runtime/path/path_out.c +++ b/core/src/ten_runtime/path/path_out.c @@ -5,8 +5,8 @@ // #include "include_internal/ten_runtime/path/path_out.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" ten_path_out_t *ten_path_out_create( ten_path_table_t *table, const char *cmd_name, const char *parent_cmd_id, diff --git a/core/src/ten_runtime/path/path_table.c b/core/src/ten_runtime/path/path_table.c index af0f978457..c9bca9642d 100644 --- a/core/src/ten_runtime/path/path_table.c +++ b/core/src/ten_runtime/path/path_table.c @@ -21,6 +21,7 @@ #include "include_internal/ten_runtime/path/path_group.h" #include "include_internal/ten_runtime/path/path_in.h" #include "include_internal/ten_runtime/path/path_out.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" @@ -28,7 +29,6 @@ #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" #include "ten_utils/lib/time.h" -#include "ten_utils/macro/check.h" #include "ten_utils/sanitizer/thread_check.h" #define PATH_TABLE_REASONABLE_MAX_CNT 1000 diff --git a/core/src/ten_runtime/protocol/asynced/external.c b/core/src/ten_runtime/protocol/asynced/external.c index 4e7e04e892..897e52a462 100644 --- a/core/src/ten_runtime/protocol/asynced/external.c +++ b/core/src/ten_runtime/protocol/asynced/external.c @@ -7,8 +7,8 @@ #include "include_internal/ten_runtime/protocol/asynced/internal.h" #include "include_internal/ten_runtime/protocol/asynced/protocol_asynced.h" #include "include_internal/ten_runtime/protocol/protocol.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/ref.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" // @{ diff --git a/core/src/ten_runtime/protocol/asynced/internal.c b/core/src/ten_runtime/protocol/asynced/internal.c index 00e0592efd..51f5b127df 100644 --- a/core/src/ten_runtime/protocol/asynced/internal.c +++ b/core/src/ten_runtime/protocol/asynced/internal.c @@ -9,8 +9,8 @@ #include "include_internal/ten_runtime/protocol/asynced/protocol_asynced.h" #include "include_internal/ten_runtime/protocol/close.h" #include "include_internal/ten_runtime/protocol/protocol.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/ref.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/protocol/asynced/protocol_asynced.c b/core/src/ten_runtime/protocol/asynced/protocol_asynced.c index 01e23d3767..0858801899 100644 --- a/core/src/ten_runtime/protocol/asynced/protocol_asynced.c +++ b/core/src/ten_runtime/protocol/asynced/protocol_asynced.c @@ -20,6 +20,8 @@ #include "include_internal/ten_runtime/protocol/close.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/remote/remote.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/protocol/close.h" #include "ten_utils/container/list.h" @@ -29,8 +31,7 @@ #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/ref.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" #include "ten_utils/sanitizer/thread_check.h" diff --git a/core/src/ten_runtime/protocol/close.c b/core/src/ten_runtime/protocol/close.c index 5526e53744..627d6bf12c 100644 --- a/core/src/ten_runtime/protocol/close.c +++ b/core/src/ten_runtime/protocol/close.c @@ -7,8 +7,8 @@ #include "include_internal/ten_runtime/common/closeable.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/macro/field.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/protocol/context.c b/core/src/ten_runtime/protocol/context.c index c5fe8a1246..8e329fd025 100644 --- a/core/src/ten_runtime/protocol/context.c +++ b/core/src/ten_runtime/protocol/context.c @@ -8,13 +8,13 @@ #include "include_internal/ten_runtime/protocol/context.h" #include "include_internal/ten_runtime/protocol/context_store.h" #include "include_internal/ten_runtime/protocol/protocol.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/ref.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" #include "ten_utils/sanitizer/thread_check.h" diff --git a/core/src/ten_runtime/protocol/context_store.c b/core/src/ten_runtime/protocol/context_store.c index 1d8501fc55..d37c2f4319 100644 --- a/core/src/ten_runtime/protocol/context_store.c +++ b/core/src/ten_runtime/protocol/context_store.c @@ -10,6 +10,7 @@ #include "include_internal/ten_runtime/protocol/context.h" #include "include_internal/ten_runtime/protocol/context_store.h" #include "include_internal/ten_runtime/protocol/protocol.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/protocol/context.h" #include "ten_utils/container/hash_table.h" #include "ten_utils/container/list.h" @@ -22,7 +23,6 @@ #include "ten_utils/lib/rwlock.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" #include "ten_utils/sanitizer/thread_check.h" diff --git a/core/src/ten_runtime/protocol/integrated/close.c b/core/src/ten_runtime/protocol/integrated/close.c index fec7927f88..ef6855ffed 100644 --- a/core/src/ten_runtime/protocol/integrated/close.c +++ b/core/src/ten_runtime/protocol/integrated/close.c @@ -9,9 +9,9 @@ #include "include_internal/ten_runtime/protocol/integrated/close.h" #include "include_internal/ten_runtime/protocol/integrated/protocol_integrated.h" #include "include_internal/ten_runtime/protocol/protocol.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/io/stream.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" // The principle is very simple. As long as the integrated protocol still has // resources in hands, it cannot be closed, otherwise it can. diff --git a/core/src/ten_runtime/protocol/integrated/protocol_integrated.c b/core/src/ten_runtime/protocol/integrated/protocol_integrated.c index 90c68f78ed..0dcb22c72a 100644 --- a/core/src/ten_runtime/protocol/integrated/protocol_integrated.c +++ b/core/src/ten_runtime/protocol/integrated/protocol_integrated.c @@ -22,6 +22,8 @@ #include "include_internal/ten_runtime/protocol/integrated/close.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/remote/remote.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/protocol/close.h" #include "ten_utils/container/list.h" #include "ten_utils/io/runloop.h" @@ -30,8 +32,6 @@ #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/ref.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static void ten_protocol_close_task(void *self_, TEN_UNUSED void *arg) { diff --git a/core/src/ten_runtime/protocol/protocol.c b/core/src/ten_runtime/protocol/protocol.c index 4fc8c90781..6fa229f8ba 100644 --- a/core/src/ten_runtime/protocol/protocol.c +++ b/core/src/ten_runtime/protocol/protocol.c @@ -17,6 +17,8 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/close.h" #include "include_internal/ten_runtime/remote/remote.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/addon/addon.h" #include "ten_runtime/app/app.h" #include "ten_runtime/protocol/close.h" @@ -25,8 +27,7 @@ #include "ten_utils/lib/ref.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/uri.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" #include "ten_utils/value/value_object.h" diff --git a/core/src/ten_runtime/remote/remote.c b/core/src/ten_runtime/remote/remote.c index 21f428b322..ba947ba327 100644 --- a/core/src/ten_runtime/remote/remote.c +++ b/core/src/ten_runtime/remote/remote.c @@ -14,12 +14,13 @@ #include "include_internal/ten_runtime/engine/internal/thread.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" bool ten_remote_check_integrity(ten_remote_t *self, bool check_thread) { diff --git a/core/src/ten_runtime/schema_store/interface.c b/core/src/ten_runtime/schema_store/interface.c index 812e1545ed..b8756e5eb6 100644 --- a/core/src/ten_runtime/schema_store/interface.c +++ b/core/src/ten_runtime/schema_store/interface.c @@ -8,13 +8,13 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/schema_store/cmd.h" #include "include_internal/ten_runtime/schema_store/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" #include "ten_utils/container/list_ptr.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_is.h" diff --git a/core/src/ten_runtime/schema_store/interface_info.c b/core/src/ten_runtime/schema_store/interface_info.c index f910ee61a8..7b12cb845b 100644 --- a/core/src/ten_runtime/schema_store/interface_info.c +++ b/core/src/ten_runtime/schema_store/interface_info.c @@ -5,11 +5,11 @@ // #include "include_internal/ten_runtime/schema_store/interface.h" #include "include_internal/ten_rust/ten_rust.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_is.h" diff --git a/core/src/ten_runtime/schema_store/property.c b/core/src/ten_runtime/schema_store/property.c index b771b9bfdf..62370c2199 100644 --- a/core/src/ten_runtime/schema_store/property.c +++ b/core/src/ten_runtime/schema_store/property.c @@ -6,6 +6,7 @@ #include "include_internal/ten_runtime/schema_store/property.h" #include "include_internal/ten_runtime/common/constant_str.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/constant_str.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/schema.h" @@ -13,7 +14,6 @@ #include "ten_utils/container/list.h" #include "ten_utils/container/list_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_is.h" diff --git a/core/src/ten_runtime/schema_store/store.c b/core/src/ten_runtime/schema_store/store.c index 1ddf2d5692..665c4ec683 100644 --- a/core/src/ten_runtime/schema_store/store.c +++ b/core/src/ten_runtime/schema_store/store.c @@ -14,6 +14,8 @@ #include "include_internal/ten_runtime/schema_store/interface.h" #include "include_internal/ten_runtime/schema_store/msg.h" #include "include_internal/ten_runtime/schema_store/property.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/constant_str.h" #include "include_internal/ten_utils/schema/schema.h" #include "include_internal/ten_utils/schema/types/schema_object.h" @@ -24,8 +26,6 @@ #include "ten_utils/container/list_ptr.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_is.h" diff --git a/core/src/ten_runtime/ten_env/internal/get_property.c b/core/src/ten_runtime/ten_env/internal/get_property.c index 6bf808a63f..c163ca8e64 100644 --- a/core/src/ten_runtime/ten_env/internal/get_property.c +++ b/core/src/ten_runtime/ten_env/internal/get_property.c @@ -16,12 +16,13 @@ #include "include_internal/ten_runtime/ten_env/metadata.h" #include "include_internal/ten_runtime/ten_env/metadata_cb.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/ten_env/internal/metadata.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" static ten_env_peek_property_sync_context_t * ten_env_peek_property_sync_context_create(void) { diff --git a/core/src/ten_runtime/ten_env/internal/is_cmd_connected.c b/core/src/ten_runtime/ten_env/internal/is_cmd_connected.c index cfba26886d..86c38e81b1 100644 --- a/core/src/ten_runtime/ten_env/internal/is_cmd_connected.c +++ b/core/src/ten_runtime/ten_env/internal/is_cmd_connected.c @@ -14,6 +14,7 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/ten_env/metadata_cb.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/extension/extension.h" @@ -21,7 +22,7 @@ #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" typedef struct ten_is_cmd_connected_context_t { ten_string_t name; diff --git a/core/src/ten_runtime/ten_env/internal/log.c b/core/src/ten_runtime/ten_env/internal/log.c index b32bb48752..94949aefd1 100644 --- a/core/src/ten_runtime/ten_env/internal/log.c +++ b/core/src/ten_runtime/ten_env/internal/log.c @@ -6,18 +6,17 @@ #include "include_internal/ten_runtime/ten_env/log.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/new.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_runtime/ten_env/ten_env.h" -void ten_env_log(ten_env_t *self, TEN_LOG_NEW_LEVEL level, - const char *func_name, const char *file_name, size_t line_no, - const char *msg) { +void ten_env_log(ten_env_t *self, TEN_LOG_LEVEL level, const char *func_name, + const char *file_name, size_t line_no, const char *msg) { TEN_ASSERT(self && ten_env_check_integrity(self, true), "Should not happen."); - ten_log_new_log(&self->log, level, func_name, file_name, line_no, msg); + ten_log_log(&ten_global_log, level, func_name, file_name, line_no, msg); } -void ten_env_log_formatted(ten_env_t *self, TEN_LOG_NEW_LEVEL level, +void ten_env_log_formatted(ten_env_t *self, TEN_LOG_LEVEL level, const char *func_name, const char *file_name, size_t line_no, const char *fmt, ...) { TEN_ASSERT(self && ten_env_check_integrity(self, true), "Should not happen."); @@ -25,13 +24,13 @@ void ten_env_log_formatted(ten_env_t *self, TEN_LOG_NEW_LEVEL level, va_list ap; va_start(ap, fmt); - ten_log_new_log_from_va_list(&self->log, level, func_name, file_name, line_no, - fmt, ap); + ten_log_log_from_va_list(&ten_global_log, level, func_name, file_name, + line_no, fmt, ap); va_end(ap); } -void ten_env_log_with_size_formatted(ten_env_t *self, TEN_LOG_NEW_LEVEL level, +void ten_env_log_with_size_formatted(ten_env_t *self, TEN_LOG_LEVEL level, const char *func_name, size_t func_name_len, const char *file_name, @@ -42,9 +41,9 @@ void ten_env_log_with_size_formatted(ten_env_t *self, TEN_LOG_NEW_LEVEL level, va_list ap; va_start(ap, fmt); - ten_log_new_log_with_size_from_va_list(&self->log, level, func_name, - func_name_len, file_name, - file_name_len, line_no, fmt, ap); + ten_log_log_with_size_from_va_list(&ten_global_log, level, func_name, + func_name_len, file_name, file_name_len, + line_no, fmt, ap); va_end(ap); } diff --git a/core/src/ten_runtime/ten_env/internal/metadata.c b/core/src/ten_runtime/ten_env/internal/metadata.c index 9be7a6701b..7f28f8195b 100644 --- a/core/src/ten_runtime/ten_env/internal/metadata.c +++ b/core/src/ten_runtime/ten_env/internal/metadata.c @@ -17,10 +17,10 @@ #include "include_internal/ten_runtime/ten_env/metadata.h" #include "include_internal/ten_runtime/ten_env/metadata_cb.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static TEN_METADATA_LEVEL ten_get_metadata_level_from_name( diff --git a/core/src/ten_runtime/ten_env/internal/on_xxx_done.c b/core/src/ten_runtime/ten_env/internal/on_xxx_done.c index 2d3ddcde9f..cd9c0f89d7 100644 --- a/core/src/ten_runtime/ten_env/internal/on_xxx_done.c +++ b/core/src/ten_runtime/ten_env/internal/on_xxx_done.c @@ -15,8 +15,9 @@ #include "include_internal/ten_runtime/extension_group/on_xxx.h" #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" bool ten_env_on_init_done(ten_env_t *self, ten_error_t *err) { TEN_ASSERT(self, "Invalid argument."); diff --git a/core/src/ten_runtime/ten_env/internal/return.c b/core/src/ten_runtime/ten_env/internal/return.c index e90f39da39..c976ba6680 100644 --- a/core/src/ten_runtime/ten_env/internal/return.c +++ b/core/src/ten_runtime/ten_env/internal/return.c @@ -11,9 +11,9 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" static bool ten_env_return_result_internal(ten_env_t *self, ten_shared_ptr_t *result_cmd, diff --git a/core/src/ten_runtime/ten_env/internal/send.c b/core/src/ten_runtime/ten_env/internal/send.c index 20b0be697d..943c6972bb 100644 --- a/core/src/ten_runtime/ten_env/internal/send.c +++ b/core/src/ten_runtime/ten_env/internal/send.c @@ -14,12 +14,12 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/msg.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/error.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" /** * @brief All message sending code flows will eventually fall into this diff --git a/core/src/ten_runtime/ten_env/internal/set_property.c b/core/src/ten_runtime/ten_env/internal/set_property.c index 245bd21a91..04de57bb18 100644 --- a/core/src/ten_runtime/ten_env/internal/set_property.c +++ b/core/src/ten_runtime/ten_env/internal/set_property.c @@ -16,14 +16,14 @@ #include "include_internal/ten_runtime/ten_env/metadata.h" #include "include_internal/ten_runtime/ten_env/metadata_cb.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/ten_env/internal/metadata.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static ten_env_set_property_sync_context_t * diff --git a/core/src/ten_runtime/ten_env/ten_env.c b/core/src/ten_runtime/ten_env/ten_env.c index df39de041f..53ec70fa44 100644 --- a/core/src/ten_runtime/ten_env/ten_env.c +++ b/core/src/ten_runtime/ten_env/ten_env.c @@ -16,14 +16,14 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/new.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/sanitizer/thread_check.h" bool ten_env_check_integrity(ten_env_t *self, bool check_thread) { @@ -87,7 +87,6 @@ ten_env_t *ten_env_create(void) { self->close_handler = NULL; self->destroy_handler = NULL; ten_list_init(&self->ten_proxy_list); - ten_log_new_init(&self->log); self->attach_to = TEN_ENV_ATTACH_TO_INVALID; self->attached_target.addon_host = NULL; @@ -164,8 +163,6 @@ void ten_env_destroy(ten_env_t *self) { ten_sanitizer_thread_check_deinit(&self->thread_check); ten_signature_set(&self->signature, 0); - ten_log_new_deinit(&self->log); - TEN_FREE(self); } diff --git a/core/src/ten_runtime/ten_env/ten_proxy.c b/core/src/ten_runtime/ten_env/ten_proxy.c index 320c17806e..6612a3c81d 100644 --- a/core/src/ten_runtime/ten_env/ten_proxy.c +++ b/core/src/ten_runtime/ten_env/ten_proxy.c @@ -10,11 +10,11 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_runtime/ten_env_proxy/ten_env_proxy.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/container/list_ptr.h" -#include "ten_utils/macro/check.h" void ten_env_add_ten_proxy(ten_env_t *self, ten_env_proxy_t *ten_env_proxy) { TEN_ASSERT(self && ten_env_check_integrity(self, true), "Invalid argument."); diff --git a/core/src/ten_runtime/ten_env_proxy/internal/acquire_lock_mode.c b/core/src/ten_runtime/ten_env_proxy/internal/acquire_lock_mode.c index 6fca6ae527..fd66b4ede4 100644 --- a/core/src/ten_runtime/ten_env_proxy/internal/acquire_lock_mode.c +++ b/core/src/ten_runtime/ten_env_proxy/internal/acquire_lock_mode.c @@ -9,6 +9,7 @@ #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_runtime/ten_env/ten_env_proxy.h" #include "include_internal/ten_runtime/ten_env_proxy/ten_env_proxy.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/extension_group/extension_group.h" #include "ten_runtime/ten_env/ten_env.h" @@ -17,7 +18,6 @@ #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" bool ten_env_proxy_acquire_lock_mode(ten_env_proxy_t *self, ten_error_t *err) { // The outer thread must ensure the validity of the ten_env_proxy instance. diff --git a/core/src/ten_runtime/ten_env_proxy/internal/notify.c b/core/src/ten_runtime/ten_env_proxy/internal/notify.c index 4477020818..885000f8aa 100644 --- a/core/src/ten_runtime/ten_env_proxy/internal/notify.c +++ b/core/src/ten_runtime/ten_env_proxy/internal/notify.c @@ -10,13 +10,13 @@ #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_runtime/ten_env/ten_env_proxy.h" #include "include_internal/ten_runtime/ten_env_proxy/ten_env_proxy.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/extension_group/extension_group.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" static ten_notify_data_t *ten_notify_data_create(ten_notify_func_t notify_func, diff --git a/core/src/ten_runtime/ten_env_proxy/internal/release_lock_mode.c b/core/src/ten_runtime/ten_env_proxy/internal/release_lock_mode.c index a97340ba07..082a6c5ac4 100644 --- a/core/src/ten_runtime/ten_env_proxy/internal/release_lock_mode.c +++ b/core/src/ten_runtime/ten_env_proxy/internal/release_lock_mode.c @@ -9,13 +9,13 @@ #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_runtime/ten_env/ten_env_proxy.h" #include "include_internal/ten_runtime/ten_env_proxy/ten_env_proxy.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/extension_group/extension_group.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" bool ten_env_proxy_release_lock_mode(ten_env_proxy_t *self, ten_error_t *err) { diff --git a/core/src/ten_runtime/ten_env_proxy/ten_env_proxy.c b/core/src/ten_runtime/ten_env_proxy/ten_env_proxy.c index 82203267e2..4a328e6a33 100644 --- a/core/src/ten_runtime/ten_env_proxy/ten_env_proxy.c +++ b/core/src/ten_runtime/ten_env_proxy/ten_env_proxy.c @@ -11,6 +11,7 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_runtime/ten_env_proxy/ten_env_proxy.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/extension_group/extension_group.h" @@ -19,7 +20,7 @@ #include "ten_utils/io/runloop.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/mutex.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" // There's no need to check for thread-safety, as ten_env_proxy is inherently // designed to be used in a multi-threaded environment. diff --git a/core/src/ten_runtime/timer/timer.c b/core/src/ten_runtime/timer/timer.c index ae6c26f0e7..38ba1eb6fe 100644 --- a/core/src/ten_runtime/timer/timer.c +++ b/core/src/ten_runtime/timer/timer.c @@ -11,12 +11,12 @@ #include "include_internal/ten_runtime/common/loc.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/timer/timer.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static bool ten_timer_is_closing(ten_timer_t *self) { diff --git a/core/src/ten_rust/src/json_schema/mod.rs b/core/src/ten_rust/src/json_schema/mod.rs index 9f16e7c755..f7e6d41f72 100644 --- a/core/src/ten_rust/src/json_schema/mod.rs +++ b/core/src/ten_rust/src/json_schema/mod.rs @@ -1128,7 +1128,7 @@ mod tests { let property = r#" { "_ten": { - "log_level": 1, + "log_level": 2, "log_file": "api.log", "uri": "localhost" }, diff --git a/core/src/ten_utils/backtrace/common.c b/core/src/ten_utils/backtrace/common.c index 66f7c42823..6786b47172 100644 --- a/core/src/ten_utils/backtrace/common.c +++ b/core/src/ten_utils/backtrace/common.c @@ -3,22 +3,23 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "ten_utils/backtrace/common.h" +#include "include_internal/ten_utils/backtrace/common.h" #include #include #include -#include "include_internal/ten_utils/log/platform/general/log.h" -#include "ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/alloc.h" +#include "ten_utils/macro/mark.h" ten_backtrace_t *g_ten_backtrace; #if defined(OS_WINDOWS) - // There is no 'strerror_r in Windows, use strerror_s instead. Note that the - // parameter order of strerror_s is different from strerror_r. - #define strerror_r(errno, buf, len) strerror_s(buf, len, errno) +// There is no 'strerror_r in Windows, use strerror_s instead. Note that the +// parameter order of strerror_s is different from strerror_r. +#define strerror_r(errno, buf, len) strerror_s(buf, len, errno) #endif /** @@ -46,8 +47,7 @@ int ten_backtrace_default_dump_cb(ten_backtrace_t *self_, uintptr_t pc, ten_backtrace_common_t *self = (ten_backtrace_common_t *)self_; assert(self && "Invalid argument."); - TEN_LOGE_AUX(self->log, "%s:%d %s (0x%0" PRIxPTR ")", filename, lineno, - function, pc); + TEN_LOGE("%s:%d %s (0x%0" PRIxPTR ")", filename, lineno, function, pc); return 0; } @@ -57,11 +57,11 @@ void ten_backtrace_default_error_cb(ten_backtrace_t *self_, const char *msg, ten_backtrace_common_t *self = (ten_backtrace_common_t *)self_; assert(self && "Invalid argument."); - TEN_LOGE_AUX(self->log, "%s", msg); + TEN_LOGE("%s", msg); if (errnum > 0) { char *buf = ten_strerror(errnum); - TEN_LOGE_AUX(self->log, ": %s", buf); + TEN_LOGE(": %s", buf); ten_free_without_backtrace(buf); } @@ -72,11 +72,6 @@ void ten_backtrace_common_init(ten_backtrace_common_t *self, ten_backtrace_error_func_t error_cb) { assert(self && "Invalid argument."); - self->log = ten_log_create(); - self->log->format = TEN_LOG_GLOBAL_FORMAT; - self->log->output = - ten_log_output_create(TEN_LOG_PUT_MSG, ten_log_out_stderr_cb, NULL, NULL); - self->dump_cb = dump_cb; self->error_cb = error_cb; } @@ -84,8 +79,6 @@ void ten_backtrace_common_init(ten_backtrace_common_t *self, void ten_backtrace_common_deinit(ten_backtrace_t *self) { ten_backtrace_common_t *common_self = (ten_backtrace_common_t *)self; assert(common_self && "Invalid argument."); - - ten_log_destroy(common_self->log); } void ten_backtrace_create_global(void) { diff --git a/core/src/ten_utils/backtrace/platform/posix/backtrace.c b/core/src/ten_utils/backtrace/platform/posix/backtrace.c index 460e14cf67..2a43a4ac40 100644 --- a/core/src/ten_utils/backtrace/platform/posix/backtrace.c +++ b/core/src/ten_utils/backtrace/platform/posix/backtrace.c @@ -6,13 +6,14 @@ // This file is modified from // https://github.com/ianlancetaylor/libbacktrace [BSD license] // -#include "ten_utils/backtrace/backtrace.h" +#include "ten_utils/ten_config.h" + +#include "include_internal/ten_utils/backtrace/backtrace.h" #include #include -#include "internal.h" -#include "ten_utils/ten_config.h" +#include "include_internal/ten_utils/backtrace/platform/posix/internal.h" #include "unwind.h" /** diff --git a/core/src/ten_utils/backtrace/platform/posix/darwin/backtrace.c b/core/src/ten_utils/backtrace/platform/posix/darwin/backtrace.c index 092c3032f5..213d120616 100644 --- a/core/src/ten_utils/backtrace/platform/posix/darwin/backtrace.c +++ b/core/src/ten_utils/backtrace/platform/posix/darwin/backtrace.c @@ -3,7 +3,7 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" #include #include @@ -11,9 +11,9 @@ #include #include -#include "ten_utils/backtrace/common.h" +#include "include_internal/ten_utils/backtrace/common.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/log/log.h" /** * @note On Mac, we are currently using a simple method instead of a complicated diff --git a/core/src/ten_utils/backtrace/platform/posix/darwin/macho.c b/core/src/ten_utils/backtrace/platform/posix/darwin/macho.c index 6770da2612..e2c0eefb3e 100644 --- a/core/src/ten_utils/backtrace/platform/posix/darwin/macho.c +++ b/core/src/ten_utils/backtrace/platform/posix/darwin/macho.c @@ -15,13 +15,13 @@ #include #include -#include "ten_utils/backtrace/backtrace.h" -#include "ten_utils/backtrace/platform/posix/internal.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/backtrace/platform/posix/internal.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/io/mmap.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/atomic_ptr.h" #include "ten_utils/lib/file.h" -#include "ten_utils/macro/check.h" // Mach-O file header for a 32-bit executable. typedef struct macho_header_32 { @@ -1035,9 +1035,9 @@ static int macho_add(ten_backtrace_t *self, const char *filename, is_big_endian = 0; #if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) - #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ is_big_endian = 1; - #endif +#endif #endif if (!backtrace_dwarf_add(self, base_address, &dwarf_sections, is_big_endian, diff --git a/core/src/ten_utils/backtrace/platform/posix/dwarf.c b/core/src/ten_utils/backtrace/platform/posix/dwarf.c index 2d9b8c022c..40df063791 100644 --- a/core/src/ten_utils/backtrace/platform/posix/dwarf.c +++ b/core/src/ten_utils/backtrace/platform/posix/dwarf.c @@ -13,9 +13,8 @@ #include #include -#include "internal.h" -#include "ten_utils/backtrace/backtrace.h" -#include "ten_utils/backtrace/platform/posix/internal.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/backtrace/platform/posix/internal.h" #include "ten_utils/container/vector.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/atomic.h" diff --git a/core/src/ten_utils/backtrace/platform/posix/fileline.c b/core/src/ten_utils/backtrace/platform/posix/fileline.c index c40067b6ad..7e019d64ae 100644 --- a/core/src/ten_utils/backtrace/platform/posix/fileline.c +++ b/core/src/ten_utils/backtrace/platform/posix/fileline.c @@ -15,23 +15,22 @@ #include #include -#include "ten_utils/backtrace/platform/posix/config.h" // IWYU pragma: keep +#include "include_internal/ten_utils/backtrace/platform/posix/config.h" // IWYU pragma: keep #ifdef HAVE_MACH_O_DYLD_H - #include +#include #endif -#include "internal.h" -#include "ten_utils/backtrace/backtrace.h" -#include "ten_utils/backtrace/platform/posix/internal.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/backtrace/platform/posix/internal.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/atomic_ptr.h" #include "ten_utils/lib/file.h" -#include "ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #ifdef HAVE_MACH_O_DYLD_H - #include "ten_utils/lib/alloc.h" +#include "ten_utils/lib/alloc.h" static char *macho_get_executable_path(ten_backtrace_t *self, ten_backtrace_error_func_t error_cb, @@ -54,7 +53,7 @@ static char *macho_get_executable_path(ten_backtrace_t *self, #else /* !defined (HAVE_MACH_O_DYLD_H) */ - #define macho_get_executable_path(self, error_cb, data) NULL +#define macho_get_executable_path(self, error_cb, data) NULL #endif /* !defined (HAVE_MACH_O_DYLD_H) */ diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/backtrace.c b/core/src/ten_utils/backtrace/platform/posix/linux/backtrace.c index 54460171ab..9c98df3da2 100644 --- a/core/src/ten_utils/backtrace/platform/posix/linux/backtrace.c +++ b/core/src/ten_utils/backtrace/platform/posix/linux/backtrace.c @@ -3,14 +3,14 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" #include #include #include -#include "ten_utils/backtrace/common.h" -#include "ten_utils/backtrace/platform/posix/internal.h" +#include "include_internal/ten_utils/backtrace/common.h" +#include "include_internal/ten_utils/backtrace/platform/posix/internal.h" #include "ten_utils/lib/alloc.h" ten_backtrace_t *ten_backtrace_create(void) { diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/crc32.c b/core/src/ten_utils/backtrace/platform/posix/linux/crc32.c index 6075fa5115..ed8269296f 100644 --- a/core/src/ten_utils/backtrace/platform/posix/linux/crc32.c +++ b/core/src/ten_utils/backtrace/platform/posix/linux/crc32.c @@ -6,7 +6,7 @@ // This file is modified from // https://github.com/ianlancetaylor/libbacktrace [BSD license] // -#include "ten_utils/backtrace/platform/posix/linux/crc32.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/crc32.h" #include #include diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/debugfile.c b/core/src/ten_utils/backtrace/platform/posix/linux/debugfile.c index ec1cb74ba3..a0ce9ffdae 100644 --- a/core/src/ten_utils/backtrace/platform/posix/linux/debugfile.c +++ b/core/src/ten_utils/backtrace/platform/posix/linux/debugfile.c @@ -6,17 +6,17 @@ // This file is modified from // https://github.com/ianlancetaylor/libbacktrace [BSD license] // -#include "ten_utils/backtrace/platform/posix/linux/debugfile.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/debugfile.h" #include #include #include #include -#include "ten_utils/backtrace/platform/posix/linux/crc32.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/crc32.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/file.h" -#include "ten_utils/macro/check.h" #define SYSTEM_BUILD_ID_DIR "/usr/lib/debug/.build-id/" diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/elf.c b/core/src/ten_utils/backtrace/platform/posix/linux/elf.c index aa51a20bac..9bf497892c 100644 --- a/core/src/ten_utils/backtrace/platform/posix/linux/elf.c +++ b/core/src/ten_utils/backtrace/platform/posix/linux/elf.c @@ -16,44 +16,44 @@ #include #include -#include "ten_utils/backtrace/platform/posix/config.h" +#include "include_internal/ten_utils/backtrace/platform/posix/config.h" #ifdef HAVE_DL_ITERATE_PHDR - #ifdef HAVE_LINK_H - #define __USE_GNU - #include - #undef __USE_GNU - #endif +#ifdef HAVE_LINK_H +#define __USE_GNU +#include +#undef __USE_GNU +#endif #endif -#include "ten_utils/backtrace/backtrace.h" -#include "ten_utils/backtrace/platform/posix/internal.h" -#include "ten_utils/backtrace/platform/posix/linux/crc32.h" -#include "ten_utils/backtrace/platform/posix/linux/debugfile.h" -#include "ten_utils/backtrace/platform/posix/linux/uncompress.h" -#include "ten_utils/backtrace/platform/posix/linux/view.h" -#include "ten_utils/backtrace/platform/posix/linux/zlib.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/backtrace/platform/posix/internal.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/crc32.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/debugfile.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/uncompress.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/view.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/zlib.h" #include "ten_utils/io/mmap.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/atomic_ptr.h" #include "ten_utils/lib/file.h" #ifndef S_ISLNK - #ifndef S_IFLNK - #define S_IFLNK 0120000 - #endif - #ifndef S_IFMT - #define S_IFMT 0170000 - #endif - #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +#ifndef S_IFLNK +#define S_IFLNK 0120000 +#endif +#ifndef S_IFMT +#define S_IFMT 0170000 +#endif +#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) #endif #ifndef HAVE_DL_ITERATE_PHDR /* Dummy version of dl_iterate_phdr for systems that don't have it. */ - #define dl_phdr_info x_dl_phdr_info - #define dl_iterate_phdr x_dl_iterate_phdr +#define dl_phdr_info x_dl_phdr_info +#define dl_iterate_phdr x_dl_iterate_phdr struct dl_phdr_info { uintptr_t dlpi_addr; @@ -75,7 +75,7 @@ static int dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, configure time. */ #if BACKTRACE_ELF_SIZE != 32 && BACKTRACE_ELF_SIZE != 64 - #error "Unknown BACKTRACE_ELF_SIZE" +#error "Unknown BACKTRACE_ELF_SIZE" #endif /* might #include which might define our constants @@ -573,9 +573,9 @@ int elf_fetch_bits(const unsigned char **ppin, const unsigned char *pinend, /* We've ensured that PIN is aligned. */ next = *(const uint32_t *)pin; - #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ next = __builtin_bswap32(next); - #endif +#endif #else next = pin[0] | (pin[1] << 8) | (pin[2] << 16) | (pin[3] << 24); #endif @@ -626,9 +626,9 @@ static int elf_fetch_bits_backward(const unsigned char **ppin, /* We've ensured that PIN is aligned. */ next = *(const uint32_t *)pin; - #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ next = __builtin_bswap32(next); - #endif +#endif #else next = pin[0] | (pin[1] << 8) | (pin[2] << 16) | (pin[3] << 24); #endif @@ -1199,7 +1199,7 @@ static int elf_zstd_make_match_baseline_fse( /* Used to generate the predefined FSE decoding tables for zstd. */ - #include +#include /* These values are straight from RFC 8878. */ @@ -2958,7 +2958,7 @@ static int elf_uncompress_chdr(ten_backtrace_t *self, Linux kernel implementation. */ #if LZMA_PROB_TOTAL_COUNT != 1846 + (1 << 4) * 0x300 - #error Wrong number of LZMA probabilities +#error Wrong number of LZMA probabilities #endif /* Expressions for the offset in the LZMA probabilities array of a @@ -4064,9 +4064,9 @@ static int elf_add(ten_backtrace_t *self, const char *filename, int descriptor, } #if BACKTRACE_ELF_SIZE == 32 - #define BACKTRACE_ELFCLASS ELFCLASS32 +#define BACKTRACE_ELFCLASS ELFCLASS32 #else - #define BACKTRACE_ELFCLASS ELFCLASS64 +#define BACKTRACE_ELFCLASS ELFCLASS64 #endif if (ehdr.e_ident[EI_CLASS] != BACKTRACE_ELFCLASS) { diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/uncompress.c b/core/src/ten_utils/backtrace/platform/posix/linux/uncompress.c index 2d32abc8e0..1d092aeebe 100644 --- a/core/src/ten_utils/backtrace/platform/posix/linux/uncompress.c +++ b/core/src/ten_utils/backtrace/platform/posix/linux/uncompress.c @@ -6,7 +6,7 @@ // This file is modified from // https://github.com/ianlancetaylor/libbacktrace [BSD license] // -#include "ten_utils/backtrace/platform/posix/linux/uncompress.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/uncompress.h" /** * @brief A function useful for setting a breakpoint for an inflation failure diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/view.c b/core/src/ten_utils/backtrace/platform/posix/linux/view.c index 132ba8e21e..8ace230c21 100644 --- a/core/src/ten_utils/backtrace/platform/posix/linux/view.c +++ b/core/src/ten_utils/backtrace/platform/posix/linux/view.c @@ -6,11 +6,12 @@ // This file is modified from // https://github.com/ianlancetaylor/libbacktrace [BSD license] // -#include "ten_utils/backtrace/platform/posix/linux/view.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/view.h" #include -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" /** * @brief Create a view of SIZE bytes from DESCRIPTOR/MEMORY at OFFSET. diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/zlib.c b/core/src/ten_utils/backtrace/platform/posix/linux/zlib.c index c4fc36f4d7..a222bb2a05 100644 --- a/core/src/ten_utils/backtrace/platform/posix/linux/zlib.c +++ b/core/src/ten_utils/backtrace/platform/posix/linux/zlib.c @@ -6,13 +6,13 @@ // This file is modified from // https://github.com/ianlancetaylor/libbacktrace [BSD license] // -#include "ten_utils/backtrace/platform/posix/linux/zlib.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/zlib.h" #include -#include "ten_utils/backtrace/platform/posix/internal.h" -#include "ten_utils/backtrace/platform/posix/linux/elf.h" -#include "ten_utils/backtrace/platform/posix/linux/uncompress.h" +#include "include_internal/ten_utils/backtrace/platform/posix/internal.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/elf.h" +#include "include_internal/ten_utils/backtrace/platform/posix/linux/uncompress.h" #ifdef BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE @@ -305,7 +305,7 @@ static int elf_zlib_inflate_table(unsigned char *codes, size_t codes_len, * @brief Used to generate the fixed Huffman table for block type 1. */ - #include +#include static uint16_t table[ZLIB_TABLE_SIZE]; static unsigned char codes[288]; diff --git a/core/src/ten_utils/backtrace/platform/posix/sort.c b/core/src/ten_utils/backtrace/platform/posix/sort.c index 062a70be65..ea5cd8a82d 100644 --- a/core/src/ten_utils/backtrace/platform/posix/sort.c +++ b/core/src/ten_utils/backtrace/platform/posix/sort.c @@ -6,11 +6,12 @@ // This file is modified from // https://github.com/ianlancetaylor/libbacktrace [BSD license] // +#include "ten_utils/ten_config.h" + #include #include -#include "internal.h" -#include "ten_utils/ten_config.h" +#include "include_internal/ten_utils/backtrace/platform/posix/internal.h" /** * @file The GNU glibc version of qsort allocates memory, which we must not do diff --git a/core/src/ten_utils/backtrace/platform/win/internal.c b/core/src/ten_utils/backtrace/platform/win/internal.c index a18f5a09f5..be037cad72 100644 --- a/core/src/ten_utils/backtrace/platform/win/internal.c +++ b/core/src/ten_utils/backtrace/platform/win/internal.c @@ -14,10 +14,10 @@ #include #include -#include "ten_utils/backtrace/backtrace.h" -#include "ten_utils/backtrace/common.h" +#include "include_internal/ten_utils/backtrace/backtrace.h" +#include "include_internal/ten_utils/backtrace/common.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/log/log.h" #include "ten_utils/macro/memory.h" typedef BOOL(WINAPI *win_SymInitialize_func_t)(HANDLE hProcess, diff --git a/core/src/ten_utils/container/list.c b/core/src/ten_utils/container/list.c index 6de3b948e0..178b0a8c4e 100644 --- a/core/src/ten_utils/container/list.c +++ b/core/src/ten_utils/container/list.c @@ -9,9 +9,9 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" bool ten_list_check_integrity(ten_list_t *self) { diff --git a/core/src/ten_utils/container/list_int32.c b/core/src/ten_utils/container/list_int32.c index 07c85eb864..adfe6966f5 100644 --- a/core/src/ten_utils/container/list_int32.c +++ b/core/src/ten_utils/container/list_int32.c @@ -7,9 +7,9 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" -#include "ten_utils/macro/check.h" ten_listnode_t *ten_list_find_int32(ten_list_t *self, int32_t int32) { TEN_ASSERT(self && ten_list_check_integrity(self), "Invalid argument."); diff --git a/core/src/ten_utils/container/list_node.c b/core/src/ten_utils/container/list_node.c index 30afcf1268..6268d84785 100644 --- a/core/src/ten_utils/container/list_node.c +++ b/core/src/ten_utils/container/list_node.c @@ -8,8 +8,8 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" bool ten_listnode_check_integrity(ten_listnode_t *self) { TEN_ASSERT(self, "Invalid argument."); diff --git a/core/src/ten_utils/container/list_node_int32.c b/core/src/ten_utils/container/list_node_int32.c index 5def4039b1..5fc0dded8a 100644 --- a/core/src/ten_utils/container/list_node_int32.c +++ b/core/src/ten_utils/container/list_node_int32.c @@ -3,9 +3,9 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" static bool ten_int32_listnode_check_integrity(ten_int32_listnode_t *self) { TEN_ASSERT(self, "Invalid argument."); diff --git a/core/src/ten_utils/container/list_node_ptr.c b/core/src/ten_utils/container/list_node_ptr.c index 68a6681ede..ac4e6856e2 100644 --- a/core/src/ten_utils/container/list_node_ptr.c +++ b/core/src/ten_utils/container/list_node_ptr.c @@ -3,9 +3,9 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" static bool ten_ptr_listnode_check_integrity(ten_ptr_listnode_t *self) { TEN_ASSERT(self, "Invalid argument."); diff --git a/core/src/ten_utils/container/list_node_smart_ptr.c b/core/src/ten_utils/container/list_node_smart_ptr.c index 5f1825885a..591c6210a5 100644 --- a/core/src/ten_utils/container/list_node_smart_ptr.c +++ b/core/src/ten_utils/container/list_node_smart_ptr.c @@ -6,10 +6,10 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" static bool ten_smart_ptr_listnode_check_integrity( ten_smart_ptr_listnode_t *self) { diff --git a/core/src/ten_utils/container/list_node_str.c b/core/src/ten_utils/container/list_node_str.c index c6f7dcb04f..b7886d8bf3 100644 --- a/core/src/ten_utils/container/list_node_str.c +++ b/core/src/ten_utils/container/list_node_str.c @@ -6,9 +6,9 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" static bool ten_str_listnode_check_integrity(ten_str_listnode_t *self) { TEN_ASSERT(self, "Invalid argument."); diff --git a/core/src/ten_utils/container/list_ptr.c b/core/src/ten_utils/container/list_ptr.c index 1a6e438b51..f4fad7f72d 100644 --- a/core/src/ten_utils/container/list_ptr.c +++ b/core/src/ten_utils/container/list_ptr.c @@ -7,9 +7,9 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" -#include "ten_utils/macro/check.h" ten_listnode_t *ten_list_find_ptr(ten_list_t *self, const void *ptr) { TEN_ASSERT(self && ten_list_check_integrity(self) && ptr, diff --git a/core/src/ten_utils/container/list_smart_ptr.c b/core/src/ten_utils/container/list_smart_ptr.c index 82d6197efc..c2f3943d5b 100644 --- a/core/src/ten_utils/container/list_smart_ptr.c +++ b/core/src/ten_utils/container/list_smart_ptr.c @@ -7,11 +7,11 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/container/list_node_smart_ptr.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" ten_listnode_t *ten_list_find_shared_ptr_custom_( ten_list_t *self, const void *ptr, diff --git a/core/src/ten_utils/container/list_str.c b/core/src/ten_utils/container/list_str.c index 7caf13e3c7..a74cf46d59 100644 --- a/core/src/ten_utils/container/list_str.c +++ b/core/src/ten_utils/container/list_str.c @@ -7,9 +7,9 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" -#include "ten_utils/macro/check.h" void ten_list_push_str_back(ten_list_t *self, const char *str) { TEN_ASSERT(self && ten_list_check_integrity(self) && str, diff --git a/core/src/ten_utils/container/vector.c b/core/src/ten_utils/container/vector.c index 562a75bf0d..c998296265 100644 --- a/core/src/ten_utils/container/vector.c +++ b/core/src/ten_utils/container/vector.c @@ -8,8 +8,8 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" void ten_vector_init(ten_vector_t *self, size_t capacity) { TEN_ASSERT(self, "Invalid argument."); diff --git a/core/src/ten_utils/io/general/loops/bare/runloop.c b/core/src/ten_utils/io/general/loops/bare/runloop.c index 016620f13d..373bdea546 100644 --- a/core/src/ten_utils/io/general/loops/bare/runloop.c +++ b/core/src/ten_utils/io/general/loops/bare/runloop.c @@ -8,9 +8,9 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/io/general/loops/runloop.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" @@ -27,7 +27,7 @@ typedef struct ten_runloop_async_bare_t { typedef struct ten_runloop_timer_bare_t { ten_runloop_timer_common_t common; - bool inited; + bool initted; void (*notify_callback)(ten_runloop_timer_t *, void *); void (*stop_callback)(ten_runloop_timer_t *, void *); void (*close_callback)(ten_runloop_timer_t *, void *); @@ -230,8 +230,8 @@ static int ten_runloop_timer_bare_start( } timer_impl->notify_callback = notify_callback; - if (timer_impl->inited == false) { - timer_impl->inited = true; + if (timer_impl->initted == false) { + timer_impl->initted = true; } return 0; @@ -289,7 +289,7 @@ ten_runloop_timer_common_t *ten_runloop_timer_create_bare(void) { memset(impl, 0, sizeof(ten_runloop_timer_bare_t)); - impl->inited = false; + impl->initted = false; impl->common.base.impl = ten_strdup(TEN_RUNLOOP_BARE); impl->common.start = ten_runloop_timer_bare_start; impl->common.stop = ten_runloop_timer_bare_stop; diff --git a/core/src/ten_utils/io/general/loops/runloop.c b/core/src/ten_utils/io/general/loops/runloop.c index ab35f0ccec..62cc74ac83 100644 --- a/core/src/ten_utils/io/general/loops/runloop.c +++ b/core/src/ten_utils/io/general/loops/runloop.c @@ -8,6 +8,8 @@ #include #include +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/io/general/loops/runloop.h" #include "ten_utils/lib/alloc.h" @@ -15,8 +17,6 @@ #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/thread_local.h" #include "ten_utils/lib/thread_once.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_utils/io/general/loops/uv/runloop.c b/core/src/ten_utils/io/general/loops/uv/runloop.c index c62a296553..ffadf9d848 100644 --- a/core/src/ten_utils/io/general/loops/uv/runloop.c +++ b/core/src/ten_utils/io/general/loops/uv/runloop.c @@ -9,13 +9,13 @@ #include #include +#include "include_internal/ten_utils/io/general/transport/backend/uv/stream/migrate.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/io/general/loops/runloop.h" -#include "ten_utils/io/general/transport/backend/uv/stream/migrate.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/mutex.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" #include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" @@ -51,7 +51,7 @@ typedef struct ten_runloop_async_uv_t { typedef struct ten_runloop_timer_uv_t { ten_runloop_timer_common_t common; uv_timer_t uv_timer; - bool inited; + bool initted; void (*notify_callback)(ten_runloop_timer_t *, void *); void (*stop_callback)(ten_runloop_timer_t *, void *); void (*close_callback)(ten_runloop_timer_t *, void *); @@ -494,13 +494,13 @@ static int ten_runloop_timer_uv_start( "Invalid argument."); timer_impl->notify_callback = notify_callback; - if (timer_impl->inited == false) { + if (timer_impl->initted == false) { int rc = uv_timer_init(loop_impl->uv_loop, &timer_impl->uv_timer); if (rc != 0) { TEN_ASSERT(!rc, "uv_timer_init() failed: %d", rc); return -1; } - timer_impl->inited = true; + timer_impl->initted = true; } int rc = uv_timer_start(&timer_impl->uv_timer, uv_timer_callback, @@ -594,7 +594,7 @@ ten_runloop_timer_common_t *ten_runloop_timer_create_uv(void) { memset(impl, 0, sizeof(ten_runloop_timer_uv_t)); - impl->inited = false; + impl->initted = false; impl->common.base.impl = ten_strdup(TEN_RUNLOOP_UV); impl->common.start = ten_runloop_timer_uv_start; impl->common.stop = ten_runloop_timer_uv_stop; diff --git a/core/src/ten_utils/io/general/shmchannel.c b/core/src/ten_utils/io/general/shmchannel.c index 275a4d5f84..83ebd01486 100644 --- a/core/src/ten_utils/io/general/shmchannel.c +++ b/core/src/ten_utils/io/general/shmchannel.c @@ -12,11 +12,12 @@ #include "ten_utils/lib/shm.h" #include "ten_utils/lib/spinlock.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/mark.h" #if defined(_WIN32) - #define TEN_ANYSIZE_ARRAY 1 +#define TEN_ANYSIZE_ARRAY 1 #else - #define TEN_ANYSIZE_ARRAY 0 +#define TEN_ANYSIZE_ARRAY 0 #endif typedef struct ten_shm_layout_t { diff --git a/core/src/ten_utils/io/general/socket.c b/core/src/ten_utils/io/general/socket.c index 7296e0386b..e67480ddeb 100644 --- a/core/src/ten_utils/io/general/socket.c +++ b/core/src/ten_utils/io/general/socket.c @@ -9,19 +9,19 @@ #include #include +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" #if defined(_WIN32) - #include - #include +#include +#include #else - #include - #include +#include +#include #endif +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" ten_socket_addr_t *ten_socket_addr_create(const char *address, uint16_t port) { ten_socket_addr_t *self = diff --git a/core/src/ten_utils/io/general/transport/backend/general/transport/raw.c b/core/src/ten_utils/io/general/transport/backend/general/transport/raw.c index 7aa94a621e..c96eed6e6f 100644 --- a/core/src/ten_utils/io/general/transport/backend/general/transport/raw.c +++ b/core/src/ten_utils/io/general/transport/backend/general/transport/raw.c @@ -18,6 +18,7 @@ #include "ten_utils/lib/string.h" #include "ten_utils/lib/thread_once.h" #include "ten_utils/macro/field.h" +#include "ten_utils/macro/mark.h" #define TEN_STREAMBACKEND_RAW_SIGNATURE 0x861D0758EA843916U diff --git a/core/src/ten_utils/io/general/transport/backend/uv/stream/migrate.c b/core/src/ten_utils/io/general/transport/backend/uv/stream/migrate.c index 55e219f181..e1c352a4ab 100644 --- a/core/src/ten_utils/io/general/transport/backend/uv/stream/migrate.c +++ b/core/src/ten_utils/io/general/transport/backend/uv/stream/migrate.c @@ -3,21 +3,21 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "ten_utils/io/general/transport/backend/uv/stream/migrate.h" +#include "include_internal/ten_utils/io/general/transport/backend/uv/stream/migrate.h" #include +#include "include_internal/ten_utils/io/general/transport/backend/uv/stream/tcp.h" #include "include_internal/ten_utils/io/runloop.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/io/general/loops/uv/runloop.h" -#include "ten_utils/io/general/transport/backend/uv/stream/tcp.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/atomic.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #if defined(_WIN32) - #include "ten_utils/lib/task.h" +#include "ten_utils/lib/task.h" #endif static void migration_dst_done(uv_stream_t *pipe_, ssize_t nread, diff --git a/core/src/ten_utils/io/general/transport/backend/uv/stream/pipe.c b/core/src/ten_utils/io/general/transport/backend/uv/stream/pipe.c index 76f480573c..b1ce9f8276 100644 --- a/core/src/ten_utils/io/general/transport/backend/uv/stream/pipe.c +++ b/core/src/ten_utils/io/general/transport/backend/uv/stream/pipe.c @@ -3,7 +3,7 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "ten_utils/io/general/transport/backend/uv/stream/pipe.h" +#include "include_internal/ten_utils/io/general/transport/backend/uv/stream/pipe.h" #include #include @@ -12,9 +12,7 @@ #include "ten_utils/io/general/transport/backend/base.h" #include "ten_utils/io/stream.h" #include "ten_utils/io/transport.h" -#include "ten_utils/lib/string.h" -#include "ten_utils/lib/uri.h" -#include "ten_utils/macro/macros.h" +#include "ten_utils/macro/mark.h" // Message write structure typedef struct ten_uv_write_req_t { diff --git a/core/src/ten_utils/io/general/transport/backend/uv/stream/tcp.c b/core/src/ten_utils/io/general/transport/backend/uv/stream/tcp.c index d5149e87ad..5fda23a9ad 100644 --- a/core/src/ten_utils/io/general/transport/backend/uv/stream/tcp.c +++ b/core/src/ten_utils/io/general/transport/backend/uv/stream/tcp.c @@ -3,7 +3,7 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "ten_utils/io/general/transport/backend/uv/stream/tcp.h" +#include "include_internal/ten_utils/io/general/transport/backend/uv/stream/tcp.h" #include #include diff --git a/core/src/ten_utils/io/general/transport/backend/uv/transport/pipe.c b/core/src/ten_utils/io/general/transport/backend/uv/transport/pipe.c index feee73501d..36adcd3e82 100644 --- a/core/src/ten_utils/io/general/transport/backend/uv/transport/pipe.c +++ b/core/src/ten_utils/io/general/transport/backend/uv/transport/pipe.c @@ -3,7 +3,7 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "ten_utils/io/general/transport/backend/uv/stream/pipe.h" +#include "include_internal/ten_utils/io/general/transport/backend/uv/stream/pipe.h" #include #include diff --git a/core/src/ten_utils/io/general/transport/backend/uv/transport/tcp.c b/core/src/ten_utils/io/general/transport/backend/uv/transport/tcp.c index 21157f6f8b..352802056a 100644 --- a/core/src/ten_utils/io/general/transport/backend/uv/transport/tcp.c +++ b/core/src/ten_utils/io/general/transport/backend/uv/transport/tcp.c @@ -3,7 +3,7 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "ten_utils/io/general/transport/backend/uv/stream/tcp.h" +#include "include_internal/ten_utils/io/general/transport/backend/uv/stream/tcp.h" #include #include diff --git a/core/src/ten_utils/io/general/transport/stream.c b/core/src/ten_utils/io/general/transport/stream.c index f7e7beab9f..2a249369ed 100644 --- a/core/src/ten_utils/io/general/transport/stream.c +++ b/core/src/ten_utils/io/general/transport/stream.c @@ -9,9 +9,9 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/io/general/transport/backend/base.h" #include "ten_utils/lib/signature.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" bool ten_stream_check_integrity(ten_stream_t *self) { diff --git a/core/src/ten_utils/io/general/transport/transport.c b/core/src/ten_utils/io/general/transport/transport.c index 62f1d77970..fadf079290 100644 --- a/core/src/ten_utils/io/general/transport/transport.c +++ b/core/src/ten_utils/io/general/transport/transport.c @@ -8,11 +8,11 @@ #include #include "include_internal/ten_utils/io/runloop.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/io/general/transport/backend/base.h" #include "ten_utils/io/general/transport/backend/factory.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" // Destroy all the resources hold by this transport object. diff --git a/core/src/ten_utils/io/posix/mmap.c b/core/src/ten_utils/io/posix/mmap.c index 91c0e9c6db..2fe8052091 100644 --- a/core/src/ten_utils/io/posix/mmap.c +++ b/core/src/ten_utils/io/posix/mmap.c @@ -13,7 +13,7 @@ #include #include -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" /** * @file This file implements file views and memory allocation when mmap is diff --git a/core/src/ten_utils/io/posix/socket.c b/core/src/ten_utils/io/posix/socket.c index 0836a4c5d7..2ac3e9ad68 100644 --- a/core/src/ten_utils/io/posix/socket.c +++ b/core/src/ten_utils/io/posix/socket.c @@ -11,9 +11,9 @@ #include #include +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" ten_socket_t *ten_socket_create(TEN_SOCKET_FAMILY family, TEN_SOCKET_TYPE type, diff --git a/core/src/ten_utils/lib/sys/general/alloc.c b/core/src/ten_utils/lib/sys/general/alloc.c index 9d77dd574c..97f2ad5f03 100644 --- a/core/src/ten_utils/lib/sys/general/alloc.c +++ b/core/src/ten_utils/lib/sys/general/alloc.c @@ -9,8 +9,8 @@ #include #include +#include "include_internal/ten_utils/backtrace/backtrace.h" #include "include_internal/ten_utils/lib/alloc.h" -#include "ten_utils/backtrace/backtrace.h" void *ten_malloc_without_backtrace(size_t size) { if (!size) { diff --git a/core/src/ten_utils/lib/sys/general/buf.c b/core/src/ten_utils/lib/sys/general/buf.c index 01216047ae..3e730771b3 100644 --- a/core/src/ten_utils/lib/sys/general/buf.c +++ b/core/src/ten_utils/lib/sys/general/buf.c @@ -10,9 +10,9 @@ #include #include "include_internal/ten_utils/lib/buf.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/signature.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" bool ten_buf_check_integrity(ten_buf_t *self) { diff --git a/core/src/ten_utils/lib/sys/general/error.c b/core/src/ten_utils/lib/sys/general/error.c index 41ea436ff0..e11ff842dd 100644 --- a/core/src/ten_utils/lib/sys/general/error.c +++ b/core/src/ten_utils/lib/sys/general/error.c @@ -7,9 +7,9 @@ #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" bool ten_error_check_integrity(ten_error_t *self) { diff --git a/core/src/ten_utils/lib/sys/general/file.c b/core/src/ten_utils/lib/sys/general/file.c index 05d75218f5..29b7de64ae 100644 --- a/core/src/ten_utils/lib/sys/general/file.c +++ b/core/src/ten_utils/lib/sys/general/file.c @@ -14,11 +14,11 @@ #include #include +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/path.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #define FILE_COPY_BUF_SIZE 4096 diff --git a/core/src/ten_utils/lib/sys/general/json.c b/core/src/ten_utils/lib/sys/general/json.c index 6486c443e2..d3042cb0be 100644 --- a/core/src/ten_utils/lib/sys/general/json.c +++ b/core/src/ten_utils/lib/sys/general/json.c @@ -7,10 +7,10 @@ #include +#include "include_internal/ten_utils/macro/check.h" #include "jansson.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/type.h" bool ten_json_check_integrity(ten_json_t *json) { diff --git a/core/src/ten_utils/lib/sys/general/path.c b/core/src/ten_utils/lib/sys/general/path.c index c4be179a31..d52bc77a76 100644 --- a/core/src/ten_utils/lib/sys/general/path.c +++ b/core/src/ten_utils/lib/sys/general/path.c @@ -8,13 +8,13 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/file.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #if defined(_WIN32) - #include - #include +#include +#include #endif int ten_path_is_special_dir(const ten_string_t *path) { diff --git a/core/src/ten_utils/lib/sys/general/placeholder.c b/core/src/ten_utils/lib/sys/general/placeholder.c index 083244373f..60824c1123 100644 --- a/core/src/ten_utils/lib/sys/general/placeholder.c +++ b/core/src/ten_utils/lib/sys/general/placeholder.c @@ -9,13 +9,13 @@ #include #include "include_internal/ten_utils/common/constant_str.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/macro/memory.h" #include "include_internal/ten_utils/value/value.h" #include "include_internal/ten_utils/value/value_set.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" diff --git a/core/src/ten_utils/lib/sys/general/ref.c b/core/src/ten_utils/lib/sys/general/ref.c index 326c5d979c..3b2286441c 100644 --- a/core/src/ten_utils/lib/sys/general/ref.c +++ b/core/src/ten_utils/lib/sys/general/ref.c @@ -5,11 +5,11 @@ // #include "ten_utils/lib/ref.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/signature.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" static bool ten_ref_check_integrity(ten_ref_t *self, bool has_positive_ref_cnt) { diff --git a/core/src/ten_utils/lib/sys/general/signature.c b/core/src/ten_utils/lib/sys/general/signature.c index 961df13c1d..2dd81dd4a4 100644 --- a/core/src/ten_utils/lib/sys/general/signature.c +++ b/core/src/ten_utils/lib/sys/general/signature.c @@ -5,7 +5,7 @@ // #include "ten_utils/lib/signature.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" void ten_signature_set(ten_signature_t *signature, ten_signature_t value) { TEN_ASSERT(signature, "Invalid argument."); diff --git a/core/src/ten_utils/lib/sys/general/sm.c b/core/src/ten_utils/lib/sys/general/sm.c index 30dedc2fe3..94ecfd027f 100644 --- a/core/src/ten_utils/lib/sys/general/sm.c +++ b/core/src/ten_utils/lib/sys/general/sm.c @@ -22,7 +22,7 @@ struct ten_sm_t { int begin_state; ten_sm_op default_op; ten_list_t history; - int inited; + int initted; }; ten_sm_t *ten_state_machine_create() { @@ -110,7 +110,7 @@ int ten_state_machine_init(ten_sm_t *sm, int begin_state, ten_sm_op default_op, } ten_mutex_lock(sm->lock); - if (sm->entries || sm->entry_count || sm->inited) { + if (sm->entries || sm->entry_count || sm->initted) { goto leave_and_error; } @@ -121,7 +121,7 @@ int ten_state_machine_init(ten_sm_t *sm, int begin_state, ten_sm_op default_op, sm->current_state = begin_state; sm->begin_state = begin_state; sm->default_op = default_op; - sm->inited = 1; + sm->initted = 1; ten_mutex_unlock(sm->lock); return 0; @@ -145,7 +145,7 @@ int ten_state_machine_reset_state(ten_sm_t *sm) { } ten_mutex_lock(sm->lock); - if (!sm->entries || !sm->entry_count || !sm->inited) { + if (!sm->entries || !sm->entry_count || !sm->initted) { goto leave_and_error; } @@ -177,7 +177,7 @@ int ten_state_machine_trigger(ten_sm_t *sm, int event, int reason, void *arg) { } ten_mutex_lock(sm->lock); - if (!sm->entries || !sm->entry_count || !sm->inited) { + if (!sm->entries || !sm->entry_count || !sm->initted) { goto leave_and_error; } diff --git a/core/src/ten_utils/lib/sys/general/smart_ptr.c b/core/src/ten_utils/lib/sys/general/smart_ptr.c index edc015bee7..b8d8629aa9 100644 --- a/core/src/ten_utils/lib/sys/general/smart_ptr.c +++ b/core/src/ten_utils/lib/sys/general/smart_ptr.c @@ -9,10 +9,10 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/signature.h" -#include "ten_utils/macro/check.h" #define TEN_SMART_PTR_SIGNATURE 0x7BB9769E3A5CBA5FU diff --git a/core/src/ten_utils/lib/sys/general/string.c b/core/src/ten_utils/lib/sys/general/string.c index a7266a0445..3df23de37f 100644 --- a/core/src/ten_utils/lib/sys/general/string.c +++ b/core/src/ten_utils/lib/sys/general/string.c @@ -11,10 +11,10 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/signature.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #if defined(_WIN32) || defined(_WIN64) diff --git a/core/src/ten_utils/lib/sys/general/thread.c b/core/src/ten_utils/lib/sys/general/thread.c index 16bb3a3759..a17363668a 100644 --- a/core/src/ten_utils/lib/sys/general/thread.c +++ b/core/src/ten_utils/lib/sys/general/thread.c @@ -10,16 +10,16 @@ #include #if defined(__linux__) - #include - #include - #include +#include +#include +#include #endif +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread_local.h" #include "ten_utils/lib/thread_once.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" static ten_thread_once_t __tcb_once = TEN_THREAD_ONCE_INIT; static ten_thread_key_t __tcb = kInvalidTlsKey; @@ -183,14 +183,14 @@ ten_thread_t *ten_thread_create(const char *name, pthread_attr_t *attr_ptr = NULL; - #if defined(__i386__) +#if defined(__i386__) pthread_attr_t attr; pthread_attr_init(&attr); size_t stacksize = 256UL * 1024UL; pthread_attr_setstacksize(&attr, stacksize); attr_ptr = &attr; - #endif +#endif int rc = pthread_create(&self, attr_ptr, pthread_routine, thread); if (rc != 0) { @@ -199,10 +199,10 @@ ten_thread_t *ten_thread_create(const char *name, goto error; } - #if defined(_DEBUG) && defined(__linux__) +#if defined(_DEBUG) && defined(__linux__) TEN_LOGV("New thread is created, id(%lu), name(%s).", syscall(__NR_gettid), name); - #endif +#endif #endif @@ -267,10 +267,10 @@ ten_thread_t *ten_thread_create_fake(const char *name) { #else t->aux = (void *)pthread_self(); - #if defined(_DEBUG) && defined(__linux__) +#if defined(_DEBUG) && defined(__linux__) TEN_LOGV("New thread is created, id(%lu), name(%s).", syscall(__NR_gettid), name); - #endif +#endif #endif diff --git a/core/src/ten_utils/lib/sys/general/uuid.c b/core/src/ten_utils/lib/sys/general/uuid.c index dc3c70aca7..7b9929f11a 100644 --- a/core/src/ten_utils/lib/sys/general/uuid.c +++ b/core/src/ten_utils/lib/sys/general/uuid.c @@ -10,7 +10,7 @@ #include #include -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" /** * http://xoshiro.di.unimi.it/splitmix64.c diff --git a/core/src/ten_utils/lib/sys/posix/cond.c b/core/src/ten_utils/lib/sys/posix/cond.c index 407f59a51e..4807d15fe8 100644 --- a/core/src/ten_utils/lib/sys/posix/cond.c +++ b/core/src/ten_utils/lib/sys/posix/cond.c @@ -10,9 +10,9 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/mutex.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" struct ten_cond_t { diff --git a/core/src/ten_utils/lib/sys/posix/darwin/pc/path.c b/core/src/ten_utils/lib/sys/posix/darwin/pc/path.c index d957d2f4df..bc0bf113e7 100644 --- a/core/src/ten_utils/lib/sys/posix/darwin/pc/path.c +++ b/core/src/ten_utils/lib/sys/posix/darwin/pc/path.c @@ -8,8 +8,8 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" ten_string_t *ten_path_get_executable_path() { char *buf = NULL; diff --git a/core/src/ten_utils/lib/sys/posix/event.c b/core/src/ten_utils/lib/sys/posix/event.c index 87f13d336d..97f7238cce 100644 --- a/core/src/ten_utils/lib/sys/posix/event.c +++ b/core/src/ten_utils/lib/sys/posix/event.c @@ -9,12 +9,12 @@ #include #include "include_internal/ten_utils/lib/mutex.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/cond.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #define TEN_EVENT_SIGNATURE 0xB5F7D324A07B41E4U diff --git a/core/src/ten_utils/lib/sys/posix/file_lock.c b/core/src/ten_utils/lib/sys/posix/file_lock.c index af8ec83c16..fbacd30b64 100644 --- a/core/src/ten_utils/lib/sys/posix/file_lock.c +++ b/core/src/ten_utils/lib/sys/posix/file_lock.c @@ -8,7 +8,7 @@ #include #include -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" static int ten_file_lock_reg(int fd, int cmd, short type, off_t offset, short whence, off_t len) { diff --git a/core/src/ten_utils/lib/sys/posix/linux/pc/module.c b/core/src/ten_utils/lib/sys/posix/linux/pc/module.c index 3043f76f2d..44f0683b37 100644 --- a/core/src/ten_utils/lib/sys/posix/linux/pc/module.c +++ b/core/src/ten_utils/lib/sys/posix/linux/pc/module.c @@ -10,7 +10,7 @@ #define _GNU_SOURCE #include -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" void *ten_module_load(const ten_string_t *name, int as_local) { if (!name || !ten_string_check_integrity(name)) { diff --git a/core/src/ten_utils/lib/sys/posix/linux/uuid.c b/core/src/ten_utils/lib/sys/posix/linux/uuid.c index 9fb81f7160..387bbb5db1 100644 --- a/core/src/ten_utils/lib/sys/posix/linux/uuid.c +++ b/core/src/ten_utils/lib/sys/posix/linux/uuid.c @@ -11,7 +11,7 @@ #include #include -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" void ten_uuid4_seed(ten_uuid4_state_t *seed) { static uint64_t state0 = 0; diff --git a/core/src/ten_utils/lib/sys/posix/path.c b/core/src/ten_utils/lib/sys/posix/path.c index aa381ccb75..e093aa0770 100644 --- a/core/src/ten_utils/lib/sys/posix/path.c +++ b/core/src/ten_utils/lib/sys/posix/path.c @@ -4,7 +4,7 @@ // information. // #if defined(OS_LINUX) - #define _GNU_SOURCE +#define _GNU_SOURCE #endif #include "ten_utils/lib/path.h" @@ -17,10 +17,10 @@ #include #include +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" int ten_path_to_system_flavor(ten_string_t *path) { diff --git a/core/src/ten_utils/lib/sys/posix/process_mutex.c b/core/src/ten_utils/lib/sys/posix/process_mutex.c index 4e4550cc40..6afceef538 100644 --- a/core/src/ten_utils/lib/sys/posix/process_mutex.c +++ b/core/src/ten_utils/lib/sys/posix/process_mutex.c @@ -11,9 +11,9 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #define TEN_PROCESS_MUTEX_CREATE_MODE 0644 diff --git a/core/src/ten_utils/lib/sys/posix/thread.c b/core/src/ten_utils/lib/sys/posix/thread.c index 82149a69cd..922c8be496 100644 --- a/core/src/ten_utils/lib/sys/posix/thread.c +++ b/core/src/ten_utils/lib/sys/posix/thread.c @@ -8,7 +8,7 @@ #include #include -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" TEN_UTILS_API ten_thread_t *__get_self(); diff --git a/core/src/ten_utils/lib/sys/posix/thread_local.c b/core/src/ten_utils/lib/sys/posix/thread_local.c index b367c19d38..23ab6ecc78 100644 --- a/core/src/ten_utils/lib/sys/posix/thread_local.c +++ b/core/src/ten_utils/lib/sys/posix/thread_local.c @@ -7,7 +7,7 @@ #include -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" ten_thread_key_t ten_thread_key_create(void) { ten_thread_key_t key = kInvalidTlsKey; diff --git a/core/src/ten_utils/lib/sys/posix/thread_once.c b/core/src/ten_utils/lib/sys/posix/thread_once.c index 69decf60de..cbccc806c5 100644 --- a/core/src/ten_utils/lib/sys/posix/thread_once.c +++ b/core/src/ten_utils/lib/sys/posix/thread_once.c @@ -7,8 +7,8 @@ #include -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" int ten_thread_once(ten_thread_once_t *once_control, void (*init_routine)(void)) { diff --git a/core/src/ten_utils/lib/sys/win/atomic.c b/core/src/ten_utils/lib/sys/win/atomic.c index b0aa04c796..e3572eb49a 100644 --- a/core/src/ten_utils/lib/sys/win/atomic.c +++ b/core/src/ten_utils/lib/sys/win/atomic.c @@ -8,7 +8,7 @@ #include #include -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" int64_t ten_atomic_fetch_add(volatile ten_atomic_t *a, int64_t v) { return InterlockedExchangeAdd64(a, v); diff --git a/core/src/ten_utils/lib/sys/win/cond.c b/core/src/ten_utils/lib/sys/win/cond.c index eef12c70c0..21a7497af3 100644 --- a/core/src/ten_utils/lib/sys/win/cond.c +++ b/core/src/ten_utils/lib/sys/win/cond.c @@ -8,10 +8,10 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/time.h" -#include "ten_utils/macro/check.h" struct ten_cond_t { CONDITION_VARIABLE cond; diff --git a/core/src/ten_utils/lib/sys/win/path.c b/core/src/ten_utils/lib/sys/win/path.c index cd8759f8da..001e1a1852 100644 --- a/core/src/ten_utils/lib/sys/win/path.c +++ b/core/src/ten_utils/lib/sys/win/path.c @@ -12,8 +12,8 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" ten_string_t *ten_path_get_cwd() { char *buf = NULL; diff --git a/core/src/ten_utils/lib/sys/win/thread.c b/core/src/ten_utils/lib/sys/win/thread.c index 2eea2e80e7..9cbb164128 100644 --- a/core/src/ten_utils/lib/sys/win/thread.c +++ b/core/src/ten_utils/lib/sys/win/thread.c @@ -8,8 +8,8 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/thread_local.h" -#include "ten_utils/macro/check.h" TEN_UTILS_API ten_thread_t *__get_self(); diff --git a/core/src/ten_utils/lib/sys/win/uuid.c b/core/src/ten_utils/lib/sys/win/uuid.c index c1f089e740..693efc8b73 100644 --- a/core/src/ten_utils/lib/sys/win/uuid.c +++ b/core/src/ten_utils/lib/sys/win/uuid.c @@ -9,7 +9,7 @@ #include -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" void ten_uuid4_seed(ten_uuid4_state_t *seed) { static uint64_t state0 = 0; diff --git a/core/src/ten_utils/log/BUILD.gn b/core/src/ten_utils/log/BUILD.gn index 8d3a83c2a4..30e10c050b 100644 --- a/core/src/ten_utils/log/BUILD.gn +++ b/core/src/ten_utils/log/BUILD.gn @@ -6,5 +6,4 @@ import("//build/ten_utils/utils.gni") ten_utils_glob("log") { - deps = [ "platform" ] } diff --git a/core/src/ten_utils/log/buffer.c b/core/src/ten_utils/log/buffer.c deleted file mode 100644 index b327bd2c6b..0000000000 --- a/core/src/ten_utils/log/buffer.c +++ /dev/null @@ -1,19 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#include "include_internal/ten_utils/log/buffer.h" - -#include "include_internal/ten_utils/log/eol.h" - -static size_t g_buf_sz = TEN_LOG_BUF_SZ - TEN_LOG_EOL_SZ; - -buffer_cb g_buffer_cb = buffer_callback; - -void buffer_callback(ten_log_message_t *log_msg, char *buf) { - log_msg->buf_end = - (log_msg->buf_content_end = log_msg->buf_start = buf) + g_buf_sz; -} diff --git a/core/src/ten_utils/log/close.c b/core/src/ten_utils/log/close.c deleted file mode 100644 index 1b0da6a520..0000000000 --- a/core/src/ten_utils/log/close.c +++ /dev/null @@ -1,40 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#if defined(_WIN32) || defined(_WIN64) - #include -#else - #include -#endif - -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" - -void ten_log_close(void) { - if (TEN_LOG_GLOBAL_OUTPUT->close_cb) { - TEN_LOG_GLOBAL_OUTPUT->close_cb(TEN_LOG_GLOBAL_OUTPUT->arg); - } - - // After closing the whatever log stream, reset it to the stderr one so that - // the possible more logs could be dumped. - ten_log_set_output_to_stderr(); -} - -void ten_log_close_aux(ten_log_t *self) { - TEN_ASSERT(self && ten_log_check_integrity(self), "Invalid argument."); - - if (self->output && self->output->close_cb) { - self->output->close_cb(self->output->arg); - } - - // @{ - // After closing the whatever log stream, reset it to the stderr one so that - // the possible more logs could be dumped. - ten_log_output_destroy(self->output); - ten_log_set_output_to_stderr_aux(self); - // @} -} diff --git a/core/src/ten_utils/log/dump.c b/core/src/ten_utils/log/dump.c deleted file mode 100644 index 64fc11b9e9..0000000000 --- a/core/src/ten_utils/log/dump.c +++ /dev/null @@ -1,364 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#include -#include -#include - -#include "include_internal/ten_utils/log/buffer.h" -#include "include_internal/ten_utils/log/format.h" -#include "include_internal/ten_utils/log/internal.h" -#include "include_internal/ten_utils/log/level.h" -#include "include_internal/ten_utils/log/pid.h" -#include "include_internal/ten_utils/log/time.h" -#include "ten_utils/lib/buf.h" -#include "ten_utils/macro/check.h" -#include "ten_utils/macro/mark.h" - -#ifndef _countof - #define _countof(xs) (sizeof(xs) / sizeof((xs)[0])) -#endif - -static const char c_hex[] = "0123456789abcdef"; - -/** - * @brief Put @a padding_char reversely into the buffer specified by @a end - * which points to the end of the buffer. - * - * |<-- width -->| - * |-----------------| - * cccccc^ end - * ptr - */ -static char *put_padding_r(const size_t width, const char padding_char, - char *ptr, char *end) { - for (char *begin = end - width; begin < ptr; *--ptr = padding_char) { - } - return ptr; -} - -/** - * @brief Put @a value reversely into a buffer specified by @a end points to the - * end of the buffer. - * - * |<-- width -->| - * |-----------------| - * end - * value - * padding - */ -static char *put_integer_r(uint64_t value, const TEN_SIGN sign, - const size_t width, const char padding_char, - char *end) { - static const char _signs[] = {'-', '0', '+'}; - static const char *signs = _signs + 1; - - char *ptr = end; - - // Dump 'value'. - do { - *--ptr = (char)('0' + (value % 10)); - } while (0 != (value /= 10)); - - if (sign == TEN_SIGN_ZERO) { - return put_padding_r(width, padding_char, ptr, end); - } - - if ('0' != padding_char) { - *--ptr = signs[sign]; - return put_padding_r(width, padding_char, ptr, end); - } - - ptr = put_padding_r(width, padding_char, ptr, end + 1); - *--ptr = signs[sign]; - - return ptr; -} - -/** - * @brief Put @a value reversely into a buffer specified by @a end points to the - * end of the buffer. - * - * |<-- width -->| - * |-----------------| - * end - * value - * padding - */ -static char *put_int_r(const int64_t value, const size_t width, - const char padding_char, char *end) { - return 0 <= value - ? put_integer_r((uint64_t)value, 0, width, padding_char, end) - : put_integer_r((uint64_t)-value, -1, width, padding_char, end); -} - -static char *put_uint_r(const uint64_t value, const size_t width, - const char padding_char, char *end) { - return put_integer_r(value, TEN_SIGN_ZERO, width, padding_char, end); -} - -/** - * @brief Put a string into a buffer specified by @a end points to the end of - * the buffer. - * - * |-----------------| - * ptr end - * ^ ^ - * str_begin str_end - */ -static char *put_stringn(const char *str_begin, const char *str_end, char *ptr, - const char *end) { - const ptrdiff_t m = end - ptr; - ptrdiff_t n = str_end - str_begin; - - // Check if the string is larger than the buffer. - if (n > m) { - n = m; - } - - memcpy(ptr, str_begin, n); - - return ptr + n; -} - -/** - * @brief Put @a value into a buffer specified by @a end points to the end of - * the buffer. - * - * |<-- width -->| - * padding - * value - * |------------------| - * ptr end - */ -static char *put_uint(uint64_t value, const size_t width, - const char padding_char, char *ptr, char *end) { - char buf[16]; - char *const buf_end = buf + _countof(buf); - char *str_begin = put_uint_r(value, width, padding_char, buf_end); - return put_stringn(str_begin, buf_end, ptr, end); -} - -/** - * @brief Put @a str into a buffer specified by @a ptr to @a end. - * - * |------------------| - * ptr end - * str-> - */ -static char *put_string(const char *str, char *ptr, char *end) { - const ptrdiff_t n = end - ptr; - char *const c = (char *)memccpy(ptr, str, '\0', n); - return 0 != c ? c - 1 : end; -} - -/** - * @brief Move the end of the log message content to @a n characters forward, - * and do not exceed the end of the log buffer. - */ -static void put_nprintf(ten_log_message_t *log_msg, const int n) { - TEN_ASSERT(log_msg, "Invalid argument."); - - if (n > 0) { - log_msg->buf_content_end = n < log_msg->buf_end - log_msg->buf_content_end - ? log_msg->buf_content_end + n - : log_msg->buf_end; - } -} - -/** - * @brief *nprintf() (ex: vsnprintf) always puts 0 in the end when input buffer - * is not empty. This 0 is not desired because its presence sets (ctx->p) to - * (ctx->e - 1) which leaves space for one more character. Some put_xxx() - * functions don't use *nprintf() and could use that last character. In that - * case log line will have multiple (two) half-written parts which is confusing. - * To workaround that we allow *nprintf() to write its 0 in the eol area (which - * is always not empty). - */ -static size_t nprintf_size(ten_log_message_t *log_msg) { - TEN_ASSERT(log_msg, "Invalid argument."); - - return (size_t)(log_msg->buf_end - log_msg->buf_content_end + 1); -} - -const char *funcname(const char *func) { return func ? func : ""; } - -const char *filename(const char *file) { - const char *f = file; - for (const char *p = file; 0 != *p; ++p) { - if ('/' == *p || '\\' == *p) { - f = p + 1; - } - } - return f; -} - -/** - * @brief Put log context to @a log_msg. - */ -static void put_ctx(ten_log_message_t *log_msg) { - TEN_ASSERT(log_msg, "Invalid argument."); - - _PP_MAP(_TEN_LOG_MESSAGE_FORMAT_INIT, TEN_LOG_MESSAGE_CTX_FORMAT) - -#if !_TEN_LOG_MESSAGE_FORMAT_FIELDS(TEN_LOG_MESSAGE_CTX_FORMAT) - VAR_UNUSED(msg); -#else - - #if _TEN_LOG_MESSAGE_FORMAT_DATETIME_USED - struct tm tm; - size_t msec = 0; - g_ten_log_get_time(&tm, &msec); - #endif - - #if _TEN_LOG_MESSAGE_FORMAT_CONTAINS(PID, TEN_LOG_MESSAGE_CTX_FORMAT) || \ - _TEN_LOG_MESSAGE_FORMAT_CONTAINS(TID, TEN_LOG_MESSAGE_CTX_FORMAT) - int64_t pid = 0; - int64_t tid = 0; - ten_log_get_pid_tid(&pid, &tid); - #endif - - char ctx_buf[64]; - char *end = ctx_buf + sizeof(ctx_buf); - char *ptr = end; - - _PP_RMAP(_TEN_LOG_MESSAGE_FORMAT_PUT_R, TEN_LOG_MESSAGE_CTX_FORMAT) - - log_msg->buf_content_end = - put_stringn(ptr, end, log_msg->buf_content_end, log_msg->buf_end); - -#endif // !_TEN_LOG_MESSAGE_FORMAT_FIELDS(TEN_LOG_MESSAGE_CTX_FORMAT) -} - -/** - * @brief Put log @a tag to @a log_msg. - */ -static void put_tag(ten_log_message_t *log_msg, const char *tag) { - TEN_ASSERT(log_msg, "Invalid argument."); - - _PP_MAP(_TEN_LOG_MESSAGE_FORMAT_INIT, TEN_LOG_MESSAGE_TAG_FORMAT) - -#if !_TEN_LOG_MESSAGE_FORMAT_CONTAINS(TAG, TEN_LOG_MESSAGE_TAG_FORMAT) - VAR_UNUSED(tag); -#endif - -#if !_TEN_LOG_MESSAGE_FORMAT_FIELDS(TEN_LOG_MESSAGE_TAG_FORMAT) - VAR_UNUSED(log_msg); -#else - - _PP_MAP(_TEN_LOG_MESSAGE_FORMAT_PUT, TEN_LOG_MESSAGE_TAG_FORMAT) - -#endif -} - -static void put_src(ten_log_message_t *const log_msg, - const ten_log_src_location_t *src_loc) { - TEN_ASSERT(log_msg, "Invalid argument."); - - _PP_MAP(_TEN_LOG_MESSAGE_FORMAT_INIT, TEN_LOG_MESSAGE_SRC_FORMAT) - -#if !_TEN_LOG_MESSAGE_FORMAT_CONTAINS(FUNCTION, TEN_LOG_MESSAGE_SRC_FORMAT) && \ - !_TEN_LOG_MESSAGE_FORMAT_CONTAINS(FILENAME, TEN_LOG_MESSAGE_SRC_FORMAT) && \ - !_TEN_LOG_MESSAGE_FORMAT_CONTAINS(FILELINE, TEN_LOG_MESSAGE_SRC_FORMAT) - VAR_UNUSED(src); -#endif - -#if !_TEN_LOG_MESSAGE_FORMAT_FIELDS(TEN_LOG_MESSAGE_SRC_FORMAT) - VAR_UNUSED(msg); -#else - - _PP_MAP(_TEN_LOG_MESSAGE_FORMAT_PUT, TEN_LOG_MESSAGE_SRC_FORMAT) - -#endif -} - -static void put_msg(ten_log_message_t *log_msg, const char *fmt, va_list va) { - TEN_ASSERT(log_msg, "Invalid argument."); - - int n = 0; - log_msg->msg_start = log_msg->buf_content_end; - - // 'n' is the number of characters that would have been written if n had been - // sufficiently large, not counting the terminating null character. - n = vsnprintf(log_msg->buf_content_end, nprintf_size(log_msg), fmt, va); - - put_nprintf(log_msg, n); -} - -static void output_mem(const ten_log_t *log, ten_log_message_t *log_msg, - const ten_buf_t *mem) { - TEN_ASSERT(mem, "Invalid argument."); - - if (mem->data == NULL || mem->content_size == 0) { - return; - } - - const char *mem_p = (const char *)mem->data; - const char *mem_e = mem_p + mem->content_size; - const char *mem_cut = NULL; - const ptrdiff_t mem_width = (ptrdiff_t)log->format->mem_width; - char *const hex_b = log_msg->msg_start; - char *const ascii_b = hex_b + 2 * mem_width + 2; - char *const ascii_e = ascii_b + mem_width; - - if (log_msg->buf_end < ascii_e) { - return; - } - - while (mem_p != mem_e) { - char *hex = hex_b; - char *ascii = ascii_b; - for (mem_cut = mem_width < mem_e - mem_p ? mem_p + mem_width : mem_e; - mem_cut != mem_p; ++mem_p) { - const unsigned char ch = *mem_p; - *hex++ = c_hex[(0xf0 & ch) >> 4]; - *hex++ = c_hex[(0x0f & ch)]; - *ascii++ = isprint(ch) ? (char)ch : '?'; - } - - while (hex != ascii_b) { - *hex++ = ' '; - } - - log_msg->buf_content_end = ascii; - log->output->output_cb(log_msg, log->output->arg); - } -} - -void ten_log_write_imp(const ten_log_t *log, - const ten_log_src_location_t *src_loc, - const ten_buf_t *mem, const TEN_LOG_LEVEL level, - const char *tag, const char *fmt, va_list va) { - TEN_ASSERT(log && fmt, "Invalid argument."); - - ten_log_message_t log_msg; - char buf[TEN_LOG_BUF_SZ]; - const uint64_t mask = log->output->mask; - log_msg.level = level; - log_msg.tag = tag; - - g_buffer_cb(&log_msg, buf); - - if (TEN_LOG_PUT_CTX & mask) { - put_ctx(&log_msg); - } - if (TEN_LOG_PUT_TAG & mask) { - put_tag(&log_msg, tag); - } - if (0 != src_loc && TEN_LOG_PUT_SRC & mask) { - put_src(&log_msg, src_loc); - } - if (TEN_LOG_PUT_MSG & mask) { - put_msg(&log_msg, fmt, va); - } - - log->output->output_cb(&log_msg, log->output->arg); - - if (0 != mem && TEN_LOG_PUT_MSG & mask) { - output_mem(log, &log_msg, mem); - } -} diff --git a/core/src/ten_utils/log/global.c b/core/src/ten_utils/log/global.c new file mode 100644 index 0000000000..2e645403c2 --- /dev/null +++ b/core/src/ten_utils/log/global.c @@ -0,0 +1,29 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#include "ten_utils/ten_config.h" + +#include +#include + +#include "include_internal/ten_utils/log/level.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/log/output.h" + +ten_log_t ten_global_log = {TEN_LOG_SIGNATURE, + TEN_LOG_LEVEL_DEBUG, + {ten_log_out_stderr_cb, NULL, NULL}}; + +void ten_log_global_init(void) { ten_log_init(&ten_global_log); } + +void ten_log_global_deinit(void) { ten_log_deinit(&ten_global_log); } + +void ten_log_global_set_output_level(TEN_LOG_LEVEL level) { + ten_log_set_output_level(&ten_global_log, level); +} + +void ten_log_global_set_output_to_file(const char *log_path) { + ten_log_set_output_to_file(&ten_global_log, log_path); +} diff --git a/core/src/ten_utils/log/global_var.c b/core/src/ten_utils/log/global_var.c deleted file mode 100644 index a566808ebc..0000000000 --- a/core/src/ten_utils/log/global_var.c +++ /dev/null @@ -1,54 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#include "include_internal/ten_utils/log/log_fmt.h" -#include "include_internal/ten_utils/log/platform/general/log.h" -#include "include_internal/ten_utils/log/platform/mac/log.h" -#include "include_internal/ten_utils/log/platform/win/log.h" -#include "include_internal/ten_utils/log/tag.h" -#include "ten_utils/log/log.h" - -#if !TEN_LOG_EXTERN_TAG_PREFIX -// Define the variable for tag_prefix. -TEN_LOG_DEFINE_TAG_PREFIX = NULL; -#endif - -#if !TEN_LOG_EXTERN_GLOBAL_FORMAT -// Define the variable for global_format. -TEN_LOG_DEFINE_GLOBAL_FORMAT = {false, TEN_LOG_MEM_WIDTH}; -#endif - -#if !TEN_LOG_EXTERN_GLOBAL_OUTPUT_LEVEL -// Define the variable for global_output_level. -TEN_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL = TEN_LOG_NONE; -#endif - -#if !TEN_LOG_EXTERN_GLOBAL_OUTPUT - #if TEN_LOG_USE_ANDROID_LOG -TEN_LOG_DEFINE_GLOBAL_OUTPUT = {OUT_ANDROID}; - #elif TEN_LOG_USE_NSLOG -TEN_LOG_DEFINE_GLOBAL_OUTPUT = {OUT_NSLOG}; - #elif TEN_LOG_USE_DEBUGSTRING -TEN_LOG_DEFINE_GLOBAL_OUTPUT = {OUT_DEBUGSTRING}; - #else -TEN_LOG_DEFINE_GLOBAL_OUTPUT = {TEN_LOG_OUT_STDERR}; - #endif -#endif - -static ten_log_output_t out_stderr = {TEN_LOG_OUT_STDERR}; - -const ten_log_t ten_log_stderr_spec = { - TEN_LOG_SIGNATURE, - TEN_LOG_GLOBAL_FORMAT, - &out_stderr, -}; - -const ten_log_t global_spec = { - TEN_LOG_SIGNATURE, - TEN_LOG_GLOBAL_FORMAT, - TEN_LOG_GLOBAL_OUTPUT, -}; diff --git a/core/src/ten_utils/log/level.c b/core/src/ten_utils/log/level.c index 3907ac9e1a..e0938b59de 100644 --- a/core/src/ten_utils/log/level.c +++ b/core/src/ten_utils/log/level.c @@ -11,23 +11,25 @@ char ten_log_level_char(const TEN_LOG_LEVEL level) { switch (level) { - case TEN_LOG_VERBOSE: + case TEN_LOG_LEVEL_VERBOSE: return 'V'; - case TEN_LOG_DEBUG: + case TEN_LOG_LEVEL_DEBUG: return 'D'; - case TEN_LOG_INFO: + case TEN_LOG_LEVEL_INFO: return 'I'; - case TEN_LOG_WARN: + case TEN_LOG_LEVEL_WARN: return 'W'; - case TEN_LOG_ERROR: + case TEN_LOG_LEVEL_ERROR: return 'E'; - case TEN_LOG_FATAL: + case TEN_LOG_LEVEL_FATAL: return 'F'; default: return '?'; } } -void ten_log_set_output_level(const TEN_LOG_LEVEL level) { - ten_log_global_output_level = level; +void ten_log_set_output_level(ten_log_t *self, TEN_LOG_LEVEL level) { + assert(self && "Invalid argument."); + + self->output_level = level; } diff --git a/core/src/ten_utils/log/log.c b/core/src/ten_utils/log/log.c index bda397224e..5099b1c36e 100644 --- a/core/src/ten_utils/log/log.c +++ b/core/src/ten_utils/log/log.c @@ -3,99 +3,193 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "ten_utils/log/log.h" - -#include "ten_utils/lib/alloc.h" +#include "include_internal/ten_runtime/common/log.h" + +#include +#include +#include + +#include "include_internal/ten_utils/lib/string.h" +#include "include_internal/ten_utils/log/level.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/log/output.h" +#include "include_internal/ten_utils/log/pid.h" +#include "include_internal/ten_utils/log/time.h" #include "ten_utils/lib/signature.h" -#include "ten_utils/macro/check.h" -#include "ten_utils/macro/memory.h" -#include "ten_utils/ten_config.h" +#include "ten_utils/lib/string.h" bool ten_log_check_integrity(ten_log_t *self) { - TEN_ASSERT(self, "Should not happen."); + assert(self && "Invalid argument."); if (ten_signature_get(&self->signature) != (ten_signature_t)TEN_LOG_SIGNATURE) { return false; } + + if (self->output_level == TEN_LOG_LEVEL_INVALID) { + return false; + } + return true; } -void ten_log_init(ten_log_t *log) { - TEN_ASSERT(log, "Invalid argument."); - ten_signature_set(&log->signature, TEN_LOG_SIGNATURE); +void ten_log_init(ten_log_t *self) { + assert(self && "Invalid argument."); + + ten_signature_set(&self->signature, TEN_LOG_SIGNATURE); + self->output_level = TEN_LOG_LEVEL_INVALID; + + ten_log_set_output_to_stderr(self); } ten_log_t *ten_log_create(void) { - ten_log_t *log = ten_malloc(sizeof(ten_log_t)); - TEN_ASSERT(log, "Failed to allocate memory."); + ten_log_t *log = malloc(sizeof(ten_log_t)); + assert(log && "Failed to allocate memory."); ten_log_init(log); return log; } -void ten_log_destroy(ten_log_t *log) { - TEN_ASSERT(log && ten_log_check_integrity(log), "Invalid argument."); +void ten_log_deinit(ten_log_t *self) { + assert(self && ten_log_check_integrity(self) && "Invalid argument."); - ten_log_format_destroy(log->format); - ten_log_output_destroy(log->output); - - TEN_FREE(log); + if (self->output.close_cb) { + self->output.close_cb(self->output.user_data); + } } -void ten_log_format_init(ten_log_format_t *format, size_t mem_width) { - TEN_ASSERT(format, "Invalid argument."); +void ten_log_destroy(ten_log_t *self) { + assert(self && ten_log_check_integrity(self) && "Invalid argument."); - format->mem_width = mem_width; + ten_log_deinit(self); + free(self); } -ten_log_format_t *ten_log_format_create(size_t mem_width) { - ten_log_format_t *format = ten_malloc(sizeof(ten_log_format_t)); - TEN_ASSERT(format, "Failed to allocate memory."); +static const char *funcname(const char *func) { return func ? func : ""; } - format->is_allocated = true; - ten_log_format_init(format, mem_width); +static const char *filename(const char *path, size_t path_len, + size_t *filename_len) { + assert(filename_len && "Invalid argument."); - return format; -} + if (!path || path_len == 0) { + *filename_len = 0; + return ""; + } -void ten_log_format_destroy(ten_log_format_t *format) { - TEN_ASSERT(format, "Invalid argument."); + const char *filename = NULL; + size_t pos = 0; - if (format->is_allocated) { - TEN_FREE(format); + // Start from the end of the path and go backwards. + for (size_t i = path_len; i > 0; i--) { + if (path[i - 1] == '/' || path[i - 1] == '\\') { + filename = &path[i]; + pos = i; + break; + } } + + if (!filename) { + filename = path; + pos = 0; + } + + // Calculate the length of the filename. + *filename_len = path_len - pos; + + return filename; } -void ten_log_output_init(ten_log_output_t *output, uint64_t mask, - ten_log_output_func_t output_cb, - ten_log_close_func_t close_cb, void *arg) { - TEN_ASSERT(output, "Invalid argument."); +void ten_log_log_from_va_list(ten_log_t *self, TEN_LOG_LEVEL level, + const char *func_name, const char *file_name, + size_t line_no, const char *fmt, va_list ap) { + assert(self && ten_log_check_integrity(self) && "Invalid argument."); + + ten_string_t msg; + ten_string_init_from_va_list(&msg, fmt, ap); - output->mask = mask; - output->output_cb = output_cb; - output->close_cb = close_cb; - output->arg = arg; + ten_log_log(self, level, func_name, file_name, line_no, + ten_string_get_raw_str(&msg)); + + ten_string_deinit(&msg); } -ten_log_output_t *ten_log_output_create(uint64_t mask, - ten_log_output_func_t output_cb, - ten_log_close_func_t close_cb, - void *arg) { - ten_log_output_t *output = ten_malloc(sizeof(ten_log_output_t)); - TEN_ASSERT(output, "Failed to allocate memory."); +void ten_log_log_with_size_from_va_list(ten_log_t *self, TEN_LOG_LEVEL level, + const char *func_name, + size_t func_name_len, + const char *file_name, + size_t file_name_len, size_t line_no, + const char *fmt, va_list ap) { + assert(self && ten_log_check_integrity(self) && "Invalid argument."); + + ten_string_t msg; + ten_string_init_from_va_list(&msg, fmt, ap); - output->is_allocated = true; - ten_log_output_init(output, mask, output_cb, close_cb, arg); + ten_log_log_with_size(self, level, func_name, func_name_len, file_name, + file_name_len, line_no, ten_string_get_raw_str(&msg), + ten_string_len(&msg)); - return output; + ten_string_deinit(&msg); } -void ten_log_output_destroy(ten_log_output_t *output) { - TEN_ASSERT(output, "Invalid argument."); +void ten_log_log_formatted(ten_log_t *self, TEN_LOG_LEVEL level, + const char *func_name, const char *file_name, + size_t line_no, const char *fmt, ...) { + assert(self && ten_log_check_integrity(self) && "Invalid argument."); - if (output->is_allocated) { - TEN_FREE(output); + va_list ap; + va_start(ap, fmt); + + ten_log_log_from_va_list(self, level, func_name, file_name, line_no, fmt, ap); + + va_end(ap); +} + +void ten_log_log(ten_log_t *self, TEN_LOG_LEVEL level, const char *func_name, + const char *file_name, size_t line_no, const char *msg) { + assert(self && ten_log_check_integrity(self) && "Invalid argument."); + + ten_log_log_with_size(self, level, func_name, strlen(func_name), file_name, + strlen(file_name), line_no, msg, strlen(msg)); +} + +void ten_log_log_with_size(ten_log_t *self, TEN_LOG_LEVEL level, + const char *func_name, size_t func_name_len, + const char *file_name, size_t file_name_len, + size_t line_no, const char *msg, size_t msg_len) { + assert(self && ten_log_check_integrity(self) && "Invalid argument."); + + ten_string_t buf; + ten_string_init(&buf); + + struct tm time_info; + size_t msec = 0; + ten_log_get_time(&time_info, &msec); + ten_log_add_time_string(&buf, &time_info, msec); + + int64_t pid = 0; + int64_t tid = 0; + ten_log_get_pid_tid(&pid, &tid); + + ten_string_append_formatted(&buf, " %d(%d) %c", pid, tid, + ten_log_level_char(level)); + + if (func_name_len) { + ten_string_append_formatted(&buf, " %.*s", func_name_len, + funcname(func_name)); + } + + size_t actual_file_name_len = 0; + const char *actual_file_name = + filename(file_name, file_name_len, &actual_file_name_len); + if (actual_file_name_len) { + ten_string_append_formatted(&buf, "@%.*s:%d", actual_file_name_len, + actual_file_name, line_no); } + + ten_string_append_formatted(&buf, " %.*s", msg_len, msg); + + self->output.output_cb(&buf, self->output.user_data); + + ten_string_deinit(&buf); } diff --git a/core/src/ten_utils/log/mem.c b/core/src/ten_utils/log/mem.c deleted file mode 100644 index 94d4312cd2..0000000000 --- a/core/src/ten_utils/log/mem.c +++ /dev/null @@ -1,72 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#include "include_internal/ten_utils/log/dump.h" -#include "include_internal/ten_utils/log/internal.h" -#include "include_internal/ten_utils/log/spec.h" -#include "ten_utils/lib/buf.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" - -void ten_log_write_mem_d(const char *func_name, const char *file_name, - const size_t line, const TEN_LOG_LEVEL level, - const char *tag, void *buf, size_t buf_size, - const char *fmt, ...) { - TEN_ASSERT(buf && buf_size && fmt, "Invalid argument."); - - const ten_log_src_location_t src_loc = {func_name, file_name, line}; - ten_buf_t mem = TEN_BUF_STATIC_INIT_WITH_DATA_UNOWNED(buf, buf_size); - - va_list va; - va_start(va, fmt); - ten_log_write_imp(&global_spec, &src_loc, &mem, level, tag, fmt, va); - va_end(va); -} - -void ten_log_write_mem_aux_d(const char *func_name, const char *file_name, - const size_t line, ten_log_t *log, - const TEN_LOG_LEVEL level, const char *tag, - void *buf, size_t buf_size, const char *fmt, ...) { - TEN_ASSERT(buf && buf_size && fmt, "Invalid argument."); - - const ten_log_src_location_t src_loc = {func_name, file_name, line}; - ten_buf_t mem = TEN_BUF_STATIC_INIT_WITH_DATA_UNOWNED(buf, buf_size); - - va_list va; - va_start(va, fmt); - ten_log_write_imp(log, &src_loc, &mem, level, tag, fmt, va); - va_end(va); -} - -void ten_log_write_mem(const TEN_LOG_LEVEL level, const char *tag, void *buf, - size_t buf_size, const char *fmt, ...) { - TEN_ASSERT(buf && buf_size && fmt, "Invalid argument."); - - ten_buf_t mem = TEN_BUF_STATIC_INIT_WITH_DATA_UNOWNED(buf, buf_size); - - va_list va; - va_start(va, fmt); - ten_log_write_imp(&global_spec, 0, &mem, level, tag, fmt, va); - va_end(va); -} - -void ten_log_write_mem_aux(ten_log_t *log, const TEN_LOG_LEVEL level, - const char *tag, void *buf, size_t buf_size, - const char *fmt, ...) { - TEN_ASSERT(buf && buf_size && fmt, "Invalid argument."); - - ten_buf_t mem = TEN_BUF_STATIC_INIT_WITH_DATA_UNOWNED(buf, buf_size); - - va_list va; - va_start(va, fmt); - ten_log_write_imp(log, 0, &mem, level, tag, fmt, va); - va_end(va); -} - -void ten_log_set_mem_width(const size_t width) { - ten_log_global_format.mem_width = width; -} diff --git a/core/src/ten_utils/log/new.c b/core/src/ten_utils/log/new.c deleted file mode 100644 index 6dd52fe93b..0000000000 --- a/core/src/ten_utils/log/new.c +++ /dev/null @@ -1,182 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "include_internal/ten_utils/log/new.h" - -#include -#include -#include - -#include "include_internal/ten_utils/lib/string.h" -#include "include_internal/ten_utils/log/new_level.h" -#include "include_internal/ten_utils/log/new_pid.h" -#include "include_internal/ten_utils/log/new_time.h" -#include "ten_utils/lib/signature.h" -#include "ten_utils/lib/string.h" - -bool ten_log_new_check_integrity(ten_log_new_t *self) { - assert(self && "Invalid argument."); - - if (ten_signature_get(&self->signature) != - (ten_signature_t)TEN_LOG_NEW_SIGNATURE) { - return false; - } - - return true; -} - -void ten_log_new_init(ten_log_new_t *self) { - assert(self && "Invalid argument."); - - ten_signature_set(&self->signature, TEN_LOG_NEW_SIGNATURE); -} - -ten_log_new_t *ten_log_new_create(void) { - ten_log_new_t *log = malloc(sizeof(ten_log_new_t)); - assert(log && "Failed to allocate memory."); - - ten_log_new_init(log); - - return log; -} - -void ten_log_new_deinit(ten_log_new_t *self) { - assert(ten_log_new_check_integrity(self) && "Invalid argument."); -} - -void ten_log_new_destroy(ten_log_new_t *self) { - assert(ten_log_new_check_integrity(self) && "Invalid argument."); - - ten_log_new_deinit(self); - free(self); -} - -static const char *funcname(const char *func) { return func ? func : ""; } - -static const char *filename(const char *path, size_t path_len, - size_t *filename_len) { - assert(filename_len && "Invalid argument."); - - if (!path || path_len == 0) { - *filename_len = 0; - return ""; - } - - const char *filename = NULL; - size_t pos = 0; - - // Start from the end of the path and go backwards. - for (size_t i = path_len; i > 0; i--) { - if (path[i - 1] == '/' || path[i - 1] == '\\') { - filename = &path[i]; - pos = i; - break; - } - } - - if (!filename) { - filename = path; - pos = 0; - } - - // Calculate the length of the filename. - *filename_len = path_len - pos; - - return filename; -} - -void ten_log_new_log_from_va_list(ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, - const char *func_name, const char *file_name, - size_t line_no, const char *fmt, va_list ap) { - assert(ten_log_new_check_integrity(self) && "Invalid argument."); - - ten_string_t msg; - ten_string_init_from_va_list(&msg, fmt, ap); - - ten_log_new_log(self, level, func_name, file_name, line_no, - ten_string_get_raw_str(&msg)); - - ten_string_deinit(&msg); -} - -void ten_log_new_log_with_size_from_va_list( - ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, const char *func_name, - size_t func_name_len, const char *file_name, size_t file_name_len, - size_t line_no, const char *fmt, va_list ap) { - assert(ten_log_new_check_integrity(self) && "Invalid argument."); - - ten_string_t msg; - ten_string_init_from_va_list(&msg, fmt, ap); - - ten_log_new_log_with_size(self, level, func_name, func_name_len, file_name, - file_name_len, line_no, - ten_string_get_raw_str(&msg), ten_string_len(&msg)); - - ten_string_deinit(&msg); -} - -void ten_log_new_log_formatted(ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, - const char *func_name, const char *file_name, - size_t line_no, const char *fmt, ...) { - assert(ten_log_new_check_integrity(self) && "Invalid argument."); - - va_list ap; - va_start(ap, fmt); - - ten_log_new_log_from_va_list(self, level, func_name, file_name, line_no, fmt, - ap); - - va_end(ap); -} - -void ten_log_new_log(ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, - const char *func_name, const char *file_name, - size_t line_no, const char *msg) { - ten_log_new_log_with_size(self, level, func_name, strlen(func_name), - file_name, strlen(file_name), line_no, msg, - strlen(msg)); -} - -void ten_log_new_log_with_size(ten_log_new_t *self, TEN_LOG_NEW_LEVEL level, - const char *func_name, size_t func_name_len, - const char *file_name, size_t file_name_len, - size_t line_no, const char *msg, - size_t msg_len) { - assert(ten_log_new_check_integrity(self) && "Invalid argument."); - - ten_string_t buf; - ten_string_init(&buf); - - struct tm time_info; - size_t msec = 0; - ten_log_new_get_time(&time_info, &msec); - ten_log_new_add_time_string(&buf, &time_info, msec); - - int64_t pid = 0; - int64_t tid = 0; - ten_log_new_get_pid_tid(&pid, &tid); - - ten_string_append_formatted(&buf, " %d(%d) %c", pid, tid, - ten_log_new_level_char(level)); - - if (func_name_len) { - ten_string_append_formatted(&buf, " %.*s", func_name_len, - funcname(func_name)); - } - - size_t actual_file_name_len = 0; - const char *actual_file_name = - filename(file_name, file_name_len, &actual_file_name_len); - if (actual_file_name_len) { - ten_string_append_formatted(&buf, "@%.*s:%d", actual_file_name_len, - actual_file_name, line_no); - } - - ten_string_append_formatted(&buf, " %.*s", msg_len, msg); - - (void)fprintf(stderr, "%s\n", ten_string_get_raw_str(&buf)); - - ten_string_deinit(&buf); -} diff --git a/core/src/ten_utils/log/new_level.c b/core/src/ten_utils/log/new_level.c deleted file mode 100644 index 68d192de3f..0000000000 --- a/core/src/ten_utils/log/new_level.c +++ /dev/null @@ -1,29 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#include "include_internal/ten_utils/log/new_level.h" - -#include - -char ten_log_new_level_char(const TEN_LOG_NEW_LEVEL level) { - switch (level) { - case TEN_LOG_NEW_VERBOSE: - return 'V'; - case TEN_LOG_NEW_DEBUG: - return 'D'; - case TEN_LOG_NEW_INFO: - return 'I'; - case TEN_LOG_NEW_WARN: - return 'W'; - case TEN_LOG_NEW_ERROR: - return 'E'; - case TEN_LOG_NEW_FATAL: - return 'F'; - default: - return '?'; - } -} diff --git a/core/src/ten_utils/log/new_pid.c b/core/src/ten_utils/log/new_pid.c deleted file mode 100644 index e3c941d764..0000000000 --- a/core/src/ten_utils/log/new_pid.c +++ /dev/null @@ -1,60 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#include "include_internal/ten_utils/log/new_pid.h" - -#include -#include - -#if defined(__linux__) - -#include -#include - -#if !defined(__ANDROID__) -#include -#endif - -#endif - -#if defined(__MACH__) -#include -#endif - -#if defined(_WIN32) || defined(_WIN64) -#include -#else - -#include - -#if defined(__linux__) -#include -#elif defined(__MACH__) -#include -#endif - -#endif - -void ten_log_new_get_pid_tid(int64_t *pid, int64_t *tid) { - assert(pid && tid && "Invalid argument."); - -#if defined(OS_WINDOWS) - *pid = GetCurrentProcessId(); -#else - *pid = getpid(); -#endif - -#if defined(OS_WINDOWS) - *tid = GetCurrentThreadId(); -#elif defined(OS_LINUX) - *tid = syscall(SYS_gettid); -#elif defined(OS_MACOS) - *tid = (int)pthread_mach_thread_np(pthread_self()); -#else -#error Platform not supported -#endif -} diff --git a/core/src/ten_utils/log/new_time.c b/core/src/ten_utils/log/new_time.c deleted file mode 100644 index 29570b8515..0000000000 --- a/core/src/ten_utils/log/new_time.c +++ /dev/null @@ -1,77 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#include "include_internal/ten_utils/log/new_time.h" - -#include -#include - -#include "include_internal/ten_utils/log/new_time_cache.h" -#include "ten_utils/lib/string.h" - -#if defined(OS_WINDOWS) -#include -#else - -#include -#include - -#if defined(OS_LINUX) -#include -#elif defined(OS_MACOS) -#include -#endif - -#endif - -// Maximum length of "MM-DD HH:MM:SS.XXX" -// 212 1 212 12 1 3 = 18 -#define TIME_LOG_SIZE (size_t)(18 * 2) - -void ten_log_new_get_time(struct tm *time_info, size_t *msec) { - assert(time_info && msec && "Invalid argument."); - -#if defined(OS_WINDOWS) - SYSTEMTIME st; - GetLocalTime(&st); - tm->tm_year = st.wYear; - tm->tm_mon = st.wMonth - 1; - tm->tm_mday = st.wDay; - tm->tm_wday = st.wDayOfWeek; - tm->tm_hour = st.wHour; - tm->tm_min = st.wMinute; - tm->tm_sec = st.wSecond; - *msec = st.wMilliseconds; -#else - struct timeval tv; - gettimeofday(&tv, 0); - - if (!ten_log_new_time_cache_get(&tv, time_info)) { - (void)localtime_r(&tv.tv_sec, time_info); - ten_log_new_time_cache_set(&tv, time_info); - } - - *msec = (unsigned)tv.tv_usec / 1000; -#endif -} - -void ten_log_new_add_time_string(ten_string_t *buf, struct tm *time_info, - size_t msec) { - assert(buf && "Invalid argument."); - - ten_string_reserve(buf, TIME_LOG_SIZE); - - // Format the date and time into the buffer, excluding milliseconds. - size_t written = strftime(&buf->buf[buf->first_unused_idx], - buf->buf_size - buf->first_unused_idx, - "%m-%d %H:%M:%S", time_info); - assert(written && "Should not happen."); - - buf->first_unused_idx = strlen(buf->buf); - - ten_string_append_formatted(buf, ".%03zu", msec); -} diff --git a/core/src/ten_utils/log/new_time_cache.c b/core/src/ten_utils/log/new_time_cache.c deleted file mode 100644 index 2d4999e3d2..0000000000 --- a/core/src/ten_utils/log/new_time_cache.c +++ /dev/null @@ -1,91 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#include "include_internal/ten_utils/log/new_time_cache.h" - -#include -#include -#include - -#include "ten_utils/lib/atomic.h" - -// There is no 'struct timeval' in Windows. -#if !defined(OS_WINDOWS) - -// Indicates that the time cache is outdated. -#define TIME_CACHE_STALE (0x40000000) - -// Indicate the time is updating. -#define TIME_CACHE_UPDATING (0x40000000 | 0x80000000) - -// The initial value is `TIME_CACHE_STALE`, indicating that the cache is -// outdated. -static ten_atomic_t g_time_cache_mode = TIME_CACHE_STALE; - -// Store the values of the time cache. g_time_cache_tv stores seconds and -// microseconds. -static struct timeval g_time_cache_tv = {0, 0}; - -// Store the values of the time cache. g_time_cache_tm stores the decomposed -// time structure. -static struct tm g_time_cache_tm; - -bool ten_log_new_time_cache_get(const struct timeval *tv, struct tm *tm) { - assert(tv && tm && "Invalid argument."); - - int64_t mode = ten_atomic_load(&g_time_cache_mode); - if (0 == (mode & TIME_CACHE_UPDATING)) { - // The time cache is up-to-date, so the reader can use 'tm' directly. - // - // And add 1 to indicate that there is one more 'reader', and this operation - // will prevent the 'writer' to update the time. - mode = ten_atomic_fetch_add(&g_time_cache_mode, 1); - if (0 == (mode & TIME_CACHE_UPDATING)) { - // The time cache is up-to-date, so the reader can use 'tm' directly. - - if (g_time_cache_tv.tv_sec == tv->tv_sec) { - // Use the cached 'tm' directly. - *tm = g_time_cache_tm; - - // Indicate that one 'reader' is completed. - ten_atomic_sub_fetch(&g_time_cache_mode, 1); - return true; - } - - // Mark the time cache is outdated. - ten_atomic_or_fetch(&g_time_cache_mode, TIME_CACHE_STALE); - } - - // The time cache is _not_ up-to-date, so the reader can not use 'tm' - // directly. - ten_atomic_sub_fetch(&g_time_cache_mode, 1); - } - - // The time cache is _not_ up-to-date, so the reader can not use 'tm' - // directly. - return false; -} - -void ten_log_new_time_cache_set(const struct timeval *tv, struct tm *tm) { - assert(tv && tm && "Invalid argument."); - - // Only update the time when the time cache is outdated. - int64_t stale = TIME_CACHE_STALE; - - // Mark the time is updating, and create a critical section for the updating - // operation. - if (ten_atomic_bool_compare_swap(&g_time_cache_mode, stale, - TIME_CACHE_UPDATING)) { - g_time_cache_tv = *tv; - g_time_cache_tm = *tm; - - // Mark the time cache is up-to-date. - ten_atomic_and_fetch(&g_time_cache_mode, ~TIME_CACHE_UPDATING); - } -} - -#endif diff --git a/core/src/ten_utils/log/normal.c b/core/src/ten_utils/log/normal.c deleted file mode 100644 index ab4ef588e3..0000000000 --- a/core/src/ten_utils/log/normal.c +++ /dev/null @@ -1,67 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#include "include_internal/ten_utils/log/dump.h" -#include "include_internal/ten_utils/log/internal.h" -#include "include_internal/ten_utils/log/spec.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" - -void ten_log_vwrite_d(const char *func_name, const char *file_name, - const size_t line, const TEN_LOG_LEVEL level, - const char *tag, const char *fmt, va_list va) { - TEN_ASSERT(fmt, "Invalid argument."); - - const ten_log_src_location_t src = {func_name, file_name, line}; - - ten_log_write_imp(&global_spec, &src, 0, level, tag, fmt, va); -} - -void ten_log_write_d(const char *func_name, const char *file_name, - const size_t line, const TEN_LOG_LEVEL level, - const char *tag, const char *fmt, ...) { - TEN_ASSERT(fmt, "Invalid argument."); - - va_list va; - va_start(va, fmt); - ten_log_vwrite_d(func_name, file_name, line, level, tag, fmt, va); - va_end(va); -} - -void ten_log_write_aux_d(const char *func_name, const char *file_name, - const size_t line, const ten_log_t *log, - const TEN_LOG_LEVEL level, const char *tag, - const char *fmt, ...) { - TEN_ASSERT(fmt, "Invalid argument."); - - const ten_log_src_location_t src_loc = {func_name, file_name, line}; - - va_list va; - va_start(va, fmt); - ten_log_write_imp(log, &src_loc, 0, level, tag, fmt, va); - va_end(va); -} - -void ten_log_write(const TEN_LOG_LEVEL level, const char *tag, const char *fmt, - ...) { - TEN_ASSERT(fmt, "Invalid argument."); - - va_list va; - va_start(va, fmt); - ten_log_write_imp(&global_spec, 0, 0, level, tag, fmt, va); - va_end(va); -} - -void ten_log_write_aux(const ten_log_t *log, const TEN_LOG_LEVEL level, - const char *tag, const char *fmt, ...) { - TEN_ASSERT(fmt, "Invalid argument."); - - va_list va; - va_start(va, fmt); - ten_log_write_imp(log, 0, 0, level, tag, fmt, va); - va_end(va); -} diff --git a/core/src/ten_utils/log/output.c b/core/src/ten_utils/log/output.c index dae12c4e53..7584e07487 100644 --- a/core/src/ten_utils/log/output.c +++ b/core/src/ten_utils/log/output.c @@ -5,32 +5,35 @@ // #include "ten_utils/ten_config.h" +#include "ten_utils/lib/string.h" + #if defined(_WIN32) || defined(_WIN64) - #include - #include +#include +#include #else - #include - #include +#include +#include #endif -#include "include_internal/ten_utils/log/platform/general/log.h" -#include "ten_utils/lib/alloc.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/log/output.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/file.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" - -void ten_log_set_output_v(const uint64_t mask, - const ten_log_output_func_t output_cb, - const ten_log_close_func_t close_cb, void *arg) { - ten_log_global_output.mask = mask; - ten_log_global_output.arg = arg; - ten_log_global_output.output_cb = output_cb; - ten_log_global_output.close_cb = close_cb; + +static void ten_log_output_set(ten_log_t *self, + const ten_log_output_func_t output_cb, + const ten_log_close_func_t close_cb, + void *user_data) { + assert(self && "Invalid argument."); + + self->output.user_data = user_data; + self->output.output_cb = output_cb; + self->output.close_cb = close_cb; } -static void ten_log_close_file_cb(void *arg) { - int *fd = arg; - TEN_ASSERT(fd && *fd, "Invalid argument."); +static void ten_log_close_file_cb(void *user_data) { + int *fd = user_data; + assert(fd && *fd && "Invalid argument."); #if defined(_WIN32) || defined(_WIN64) arg = NULL; @@ -40,12 +43,12 @@ static void ten_log_close_file_cb(void *arg) { close(*fd); #endif - TEN_FREE(fd); + free(fd); } static int *get_log_fd(const char *log_path) { - int *fd_ptr = TEN_MALLOC(sizeof(int)); - TEN_ASSERT(fd_ptr, "Failed to allocate memory."); + int *fd_ptr = malloc(sizeof(int)); + assert(fd_ptr && "Failed to allocate memory."); FILE *fp = fopen(log_path, "ab"); *fd_ptr = ten_file_get_fd(fp); @@ -53,54 +56,63 @@ static int *get_log_fd(const char *log_path) { return fd_ptr; } -void ten_log_set_output_to_file(const char *log_path) { - TEN_ASSERT(log_path, "Invalid argument."); +static void ten_log_output_file_cb(ten_string_t *msg, void *user_data) { + assert(msg && "Invalid argument."); - int *fd = get_log_fd(log_path); - - ten_log_set_output_v(TEN_LOG_PUT_STD, ten_log_out_file_cb, - ten_log_close_file_cb, fd); -} + if (!user_data) { + return; + } -void ten_log_set_output_to_file_aux(ten_log_t *log, const char *log_path) { - TEN_ASSERT(log && ten_log_check_integrity(log) && log_path, - "Invalid argument."); + ten_string_append_formatted(msg, "%s", TEN_LOG_EOL); - int *fd = get_log_fd(log_path); +#if defined(_WIN32) || defined(_WIN64) + HANDLE handle = *(HANDLE *)arg; + + // WriteFile() is atomic for local files opened with + // FILE_APPEND_DATA and without FILE_WRITE_DATA + DWORD written; + WriteFile(handle, msg->buf_start, + (DWORD)(msg->buf_content_end - msg->buf_start + eol_len), &written, + 0); +#else + int fd = *(int *)user_data; - log->format = TEN_LOG_GLOBAL_FORMAT; - log->output = ten_log_output_create(TEN_LOG_PUT_STD, ten_log_out_file_cb, - ten_log_close_file_cb, fd); + // TODO(Wei): write() is atomic for buffers less than or equal to PIPE_BUF, + // therefore we need to have some locking mechanism here to prevent log + // interleaved. + write(fd, ten_string_get_raw_str(msg), ten_string_len(msg)); +#endif } -void ten_log_set_output_to_stderr(void) { - ten_log_set_output_v(TEN_LOG_PUT_STD, ten_log_out_stderr_cb, NULL, NULL); +void ten_log_set_output_to_file(ten_log_t *self, const char *log_path) { + assert(log_path && "Invalid argument."); + + int *fd = get_log_fd(log_path); + ten_log_output_set(self, ten_log_output_file_cb, ten_log_close_file_cb, fd); } -void ten_log_set_output_to_stderr_aux(ten_log_t *log) { - TEN_ASSERT(log && ten_log_check_integrity(log), "Invalid argument."); +void ten_log_out_stderr_cb(ten_string_t *msg, void *user_data) { + assert(msg && "Invalid argument."); - log->format = TEN_LOG_GLOBAL_FORMAT; - log->output = TEN_LOG_GLOBAL_OUTPUT; -} + (void)user_data; -void ten_log_save_output_spec(ten_log_output_t *output) { - TEN_ASSERT(output, "Invalid argument."); - if (!output) { - return; - } + ten_string_append_formatted(msg, "%s", TEN_LOG_EOL); - output->mask = TEN_LOG_GLOBAL_OUTPUT->mask; - output->arg = TEN_LOG_GLOBAL_OUTPUT->arg; - output->output_cb = TEN_LOG_GLOBAL_OUTPUT->output_cb; - output->close_cb = TEN_LOG_GLOBAL_OUTPUT->close_cb; +#if defined(_WIN32) || defined(_WIN64) + // WriteFile() is atomic for local files opened with FILE_APPEND_DATA and + // without FILE_WRITE_DATA + DWORD written; + WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg->buf_start, + (DWORD)(msg->buf_content_end - msg->buf_start + eol_len), &written, + 0); +#else + // TODO(Wei): write() is atomic for buffers less than or equal to PIPE_BUF, + // therefore we need to have some locking mechanism here to prevent log + // interleaved. + write(STDERR_FILENO, ten_string_get_raw_str(msg), ten_string_len(msg)); +#endif } -void ten_log_restore_output_spec(ten_log_output_t *output) { - TEN_ASSERT(output, "Invalid argument."); - if (!output) { - return; - } - - ten_log_set_output_p(output); +void ten_log_set_output_to_stderr(ten_log_t *self) { + ten_log_output_set(self, ten_log_out_stderr_cb, NULL, NULL); } diff --git a/core/src/ten_utils/log/pid.c b/core/src/ten_utils/log/pid.c index 629afb105e..b4e35321b6 100644 --- a/core/src/ten_utils/log/pid.c +++ b/core/src/ten_utils/log/pid.c @@ -10,67 +10,51 @@ #include #include -#include "include_internal/ten_utils/log/format.h" - #if defined(__linux__) - #include - #include +#include +#include - #if !defined(__ANDROID__) - #include - #endif +#if !defined(__ANDROID__) +#include +#endif #endif #if defined(__MACH__) - #include +#include #endif #if defined(_WIN32) || defined(_WIN64) - #include +#include #else - #include +#include - #if defined(__linux__) - #include - #elif defined(__MACH__) - #include - #endif +#if defined(__linux__) +#include +#elif defined(__MACH__) +#include +#endif #endif void ten_log_get_pid_tid(int64_t *pid, int64_t *tid) { assert(pid && tid && "Invalid argument."); -#if !_TEN_LOG_MESSAGE_FORMAT_CONTAINS(PID, TEN_LOG_MESSAGE_CTX_FORMAT) - VAR_UNUSED(pid); -#else - - #if defined(_WIN32) || defined(_WIN64) +#if defined(OS_WINDOWS) *pid = GetCurrentProcessId(); - #else +#else *pid = getpid(); - #endif - #endif -#if !_TEN_LOG_MESSAGE_FORMAT_CONTAINS(TID, TEN_LOG_MESSAGE_CTX_FORMAT) - VAR_UNUSED(tid); -#else - - #if defined(_WIN32) || defined(_WIN64) +#if defined(OS_WINDOWS) *tid = GetCurrentThreadId(); - #elif defined(__ANDROID__) - *tid = gettid(); - #elif defined(__linux__) +#elif defined(OS_LINUX) *tid = syscall(SYS_gettid); - #elif defined(__MACH__) +#elif defined(OS_MACOS) *tid = (int)pthread_mach_thread_np(pthread_self()); - #else - #define Platform not supported - #endif - +#else +#error Platform not supported #endif } diff --git a/core/src/ten_utils/log/platform/BUILD.gn b/core/src/ten_utils/log/platform/BUILD.gn deleted file mode 100644 index abd7339792..0000000000 --- a/core/src/ten_utils/log/platform/BUILD.gn +++ /dev/null @@ -1,14 +0,0 @@ -# -# This file is part of the TEN Framework project. -# See https://github.com/TEN-framework/ten_framework/LICENSE for license -# information. -# -import("//build/ten_utils/utils.gni") - -ten_utils_glob("platform") { - deps = [ - "general", - "mac", - "win", - ] -} diff --git a/core/src/ten_utils/log/platform/general/BUILD.gn b/core/src/ten_utils/log/platform/general/BUILD.gn deleted file mode 100644 index bd1f2e0d87..0000000000 --- a/core/src/ten_utils/log/platform/general/BUILD.gn +++ /dev/null @@ -1,9 +0,0 @@ -# -# This file is part of the TEN Framework project. -# See https://github.com/TEN-framework/ten_framework/LICENSE for license -# information. -# -import("//build/ten_utils/utils.gni") - -ten_utils_glob("general") { -} diff --git a/core/src/ten_utils/log/platform/general/log.c b/core/src/ten_utils/log/platform/general/log.c deleted file mode 100644 index 78a3cd602e..0000000000 --- a/core/src/ten_utils/log/platform/general/log.c +++ /dev/null @@ -1,72 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#include "include_internal/ten_utils/log/platform/general/log.h" - -#if defined(_WIN32) || defined(_WIN64) - #include -#else - #include -#endif - -#include - -#include "include_internal/ten_utils/log/eol.h" -#include "ten_utils/macro/check.h" -#include "ten_utils/macro/mark.h" - -void ten_log_out_stderr_cb(const ten_log_message_t *msg, void *arg) { - TEN_ASSERT(msg, "Invalid argument."); - - VAR_UNUSED(arg); - - const size_t eol_len = sizeof(TEN_LOG_EOL) - 1; - memcpy(msg->buf_content_end, TEN_LOG_EOL, eol_len); - -#if defined(_WIN32) || defined(_WIN64) - // WriteFile() is atomic for local files opened with FILE_APPEND_DATA and - // without FILE_WRITE_DATA - DWORD written; - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg->buf_start, - (DWORD)(msg->buf_content_end - msg->buf_start + eol_len), &written, - 0); -#else - // write() is atomic for buffers less than or equal to PIPE_BUF. - RETVAL_UNUSED( - write(STDERR_FILENO, msg->buf_start, - (size_t)(msg->buf_content_end - msg->buf_start) + eol_len)); -#endif -} - -void ten_log_out_file_cb(const ten_log_message_t *msg, void *arg) { - TEN_ASSERT(msg, "Invalid argument."); - - if (!arg) { - return; - } - - const size_t eol_len = sizeof(TEN_LOG_EOL) - 1; - memcpy(msg->buf_content_end, TEN_LOG_EOL, eol_len); - -#if defined(_WIN32) || defined(_WIN64) - HANDLE handle = *(HANDLE *)arg; - - // WriteFile() is atomic for local files opened with - // FILE_APPEND_DATA and without FILE_WRITE_DATA - DWORD written; - WriteFile(handle, msg->buf_start, - (DWORD)(msg->buf_content_end - msg->buf_start + eol_len), &written, - 0); -#else - int fd = *(int *)arg; - - // write() is atomic for buffers less than or equal to PIPE_BUF. - RETVAL_UNUSED( - write(fd, msg->buf_start, - (size_t)(msg->buf_content_end - msg->buf_start) + eol_len)); -#endif -} diff --git a/core/src/ten_utils/log/platform/log.c b/core/src/ten_utils/log/platform/log.c deleted file mode 100644 index af85d807b0..0000000000 --- a/core/src/ten_utils/log/platform/log.c +++ /dev/null @@ -1,23 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -/** - * @brief When defined, ten_log library will not contain definition of global - * output variable. In that case it must be defined elsewhere using - * TEN_LOG_DEFINE_GLOBAL_OUTPUT macro, for example: - * - * TEN_LOG_DEFINE_GLOBAL_OUTPUT = {TEN_LOG_PUT_STD, custom_output_callback}; - * - * This allows to specify custom value for static initialization and avoid - * overhead of setting this value in runtime. - */ -#ifdef TEN_LOG_EXTERN_GLOBAL_OUTPUT - #undef TEN_LOG_EXTERN_GLOBAL_OUTPUT - #define TEN_LOG_EXTERN_GLOBAL_OUTPUT 1 -#else - #define TEN_LOG_EXTERN_GLOBAL_OUTPUT 0 -#endif diff --git a/core/src/ten_utils/log/platform/mac/BUILD.gn b/core/src/ten_utils/log/platform/mac/BUILD.gn deleted file mode 100644 index 9a49dd2025..0000000000 --- a/core/src/ten_utils/log/platform/mac/BUILD.gn +++ /dev/null @@ -1,9 +0,0 @@ -# -# This file is part of the TEN Framework project. -# See https://github.com/TEN-framework/ten_framework/LICENSE for license -# information. -# -import("//build/ten_utils/utils.gni") - -ten_utils_glob("mac") { -} diff --git a/core/src/ten_utils/log/platform/mac/log.c b/core/src/ten_utils/log/platform/mac/log.c deleted file mode 100644 index 27b9c5aa4b..0000000000 --- a/core/src/ten_utils/log/platform/mac/log.c +++ /dev/null @@ -1,52 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#include "include_internal/ten_utils/log/platform/mac/log.h" - -#include "ten_utils/macro/check.h" -#include "ten_utils/macro/mark.h" - -#if TEN_LOG_USE_NSLOG - - #include - -CF_EXPORT void CFLog(int32_t level, CFStringRef format, ...); - -static int apple_level(const int level) { - switch (level) { - case TEN_LOG_VERBOSE: - return 7; /* ASL_LEVEL_DEBUG / kCFLogLevelDebug */ - - case TEN_LOG_DEBUG: - return 7; /* ASL_LEVEL_DEBUG / kCFLogLevelDebug */ - - case TEN_LOG_INFO: - return 6; /* ASL_LEVEL_INFO / kCFLogLevelInfo */ - - case TEN_LOG_WARN: - return 4; /* ASL_LEVEL_WARNING / kCFLogLevelWarning */ - - case TEN_LOG_ERROR: - return 3; /* ASL_LEVEL_ERR / kCFLogLevelError */ - - case TEN_LOG_FATAL: - return 0; /* ASL_LEVEL_EMERG / kCFLogLevelEmergency */ - - default: - TEN_ASSERT(0, "Bad log level"); - return 0; /* ASL_LEVEL_EMERG / kCFLogLevelEmergency */ - } -} - -void out_nslog_cb(const ten_log_message_t *msg, void *arg) { - VAR_UNUSED(arg); - - *msg->buf_content_end = 0; - CFLog(apple_lvl(msg->level), CFSTR("%s"), msg->tag_start); -} - -#endif diff --git a/core/src/ten_utils/log/platform/win/BUILD.gn b/core/src/ten_utils/log/platform/win/BUILD.gn deleted file mode 100644 index 5b35589c5f..0000000000 --- a/core/src/ten_utils/log/platform/win/BUILD.gn +++ /dev/null @@ -1,9 +0,0 @@ -# -# This file is part of the TEN Framework project. -# See https://github.com/TEN-framework/ten_framework/LICENSE for license -# information. -# -import("//build/ten_utils/utils.gni") - -ten_utils_glob("win") { -} diff --git a/core/src/ten_utils/log/platform/win/log.c b/core/src/ten_utils/log/platform/win/log.c deleted file mode 100644 index 54a2d53d4f..0000000000 --- a/core/src/ten_utils/log/platform/win/log.c +++ /dev/null @@ -1,28 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#include "include_internal/ten_utils/log/platform/win/log.h" - -#include "ten_utils/macro/check.h" -#include "ten_utils/macro/mark.h" - -#if TEN_LOG_USE_DEBUGSTRING - - #include - -void out_debugstring_cb(const ten_log_message_t *msg, void *arg) { - TEN_ASSERT(msg, "Invalid argument."); - - VAR_UNUSED(arg); - - msg->buf_content_end[0] = '\n'; - msg->buf_content_end[1] = '\0'; - - OutputDebugStringA(msg->buf_start); -} - -#endif diff --git a/core/src/ten_utils/log/spec.c b/core/src/ten_utils/log/spec.c deleted file mode 100644 index a49756f40b..0000000000 --- a/core/src/ten_utils/log/spec.c +++ /dev/null @@ -1,12 +0,0 @@ -// -// This file is part of the TEN Framework project. -// See https://github.com/TEN-framework/ten_framework/LICENSE for license -// information. -// -#include "ten_utils/ten_config.h" - -#include "include_internal/ten_utils/log/spec.h" - -#include "ten_utils/log/log.h" - -const ten_log_t *ten_log_get_global_spec(void) { return &global_spec; } diff --git a/core/src/ten_utils/log/time.c b/core/src/ten_utils/log/time.c index e75f42bd9c..8d6145707d 100644 --- a/core/src/ten_utils/log/time.c +++ b/core/src/ten_utils/log/time.c @@ -10,35 +10,32 @@ #include #include -#include "include_internal/ten_utils/log/format.h" #include "include_internal/ten_utils/log/time_cache.h" +#include "ten_utils/lib/string.h" -#if defined(_WIN32) || defined(_WIN64) - #include +#if defined(OS_WINDOWS) +#include #else - #include - #include - - #if defined(__linux__) - #include - #elif defined(__MACH__) - #include - #endif +#include +#include +#if defined(OS_LINUX) +#include +#elif defined(OS_MACOS) +#include #endif -ten_log_get_time_func_t g_ten_log_get_time = ten_log_get_time; +#endif -void ten_log_get_time(struct tm *tm, size_t *msec) { - assert(tm && msec && "Invalid argument."); +// Maximum length of "MM-DD HH:MM:SS.XXX" +// 212 1 212 12 1 3 = 18 +#define TIME_LOG_SIZE (size_t)(18 * 2) -#if !_TEN_LOG_MESSAGE_FORMAT_DATETIME_USED - VAR_UNUSED(tm); - VAR_UNUSED(msec); -#else +void ten_log_get_time(struct tm *time_info, size_t *msec) { + assert(time_info && msec && "Invalid argument."); - #if defined(_WIN32) || defined(_WIN64) +#if defined(OS_WINDOWS) SYSTEMTIME st; GetLocalTime(&st); tm->tm_year = st.wYear; @@ -49,17 +46,32 @@ void ten_log_get_time(struct tm *tm, size_t *msec) { tm->tm_min = st.wMinute; tm->tm_sec = st.wSecond; *msec = st.wMilliseconds; - #else +#else struct timeval tv; gettimeofday(&tv, 0); - if (!ten_log_time_cache_get(&tv, tm)) { - localtime_r(&tv.tv_sec, tm); - ten_log_time_cache_set(&tv, tm); + if (!ten_log_time_cache_get(&tv, time_info)) { + (void)localtime_r(&tv.tv_sec, time_info); + ten_log_time_cache_set(&tv, time_info); } *msec = (unsigned)tv.tv_usec / 1000; - #endif - #endif } + +void ten_log_add_time_string(ten_string_t *buf, struct tm *time_info, + size_t msec) { + assert(buf && "Invalid argument."); + + ten_string_reserve(buf, TIME_LOG_SIZE); + + // Format the date and time into the buffer, excluding milliseconds. + size_t written = strftime(&buf->buf[buf->first_unused_idx], + buf->buf_size - buf->first_unused_idx, + "%m-%d %H:%M:%S", time_info); + assert(written && "Should not happen."); + + buf->first_unused_idx = strlen(buf->buf); + + ten_string_append_formatted(buf, ".%03zu", msec); +} diff --git a/core/src/ten_utils/log/time_cache.c b/core/src/ten_utils/log/time_cache.c index e2e1bacacf..a993fa9d6f 100644 --- a/core/src/ten_utils/log/time_cache.c +++ b/core/src/ten_utils/log/time_cache.c @@ -3,36 +3,48 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // +#include "ten_utils/ten_config.h" + +#include "include_internal/ten_utils/log/time_cache.h" + +#include #include #include #include "ten_utils/lib/atomic.h" -#include "ten_utils/macro/check.h" -#include "ten_utils/ten_config.h" // There is no 'struct timeval' in Windows. -#if !defined(_WIN32) && !defined(_WIN64) +#if !defined(OS_WINDOWS) - #define TIME_CACHE_STALE (0x40000000) +// Indicates that the time cache is outdated. +#define TIME_CACHE_STALE (0x40000000) - // Indicate the time is updating. - #define TIME_CACHE_FLUID (0x40000000 | 0x80000000) +// Indicate the time is updating. +#define TIME_CACHE_UPDATING (0x40000000 | 0x80000000) +// The initial value is `TIME_CACHE_STALE`, indicating that the cache is +// outdated. static ten_atomic_t g_time_cache_mode = TIME_CACHE_STALE; +// Store the values of the time cache. g_time_cache_tv stores seconds and +// microseconds. static struct timeval g_time_cache_tv = {0, 0}; + +// Store the values of the time cache. g_time_cache_tm stores the decomposed +// time structure. static struct tm g_time_cache_tm; bool ten_log_time_cache_get(const struct timeval *tv, struct tm *tm) { - TEN_ASSERT(tv && tm, "Invalid argument."); + assert(tv && tm && "Invalid argument."); int64_t mode = ten_atomic_load(&g_time_cache_mode); - if (0 == (mode & TIME_CACHE_FLUID)) { - // The time cache is up-to-date, so the reader can use 'tm' directly. And - // add 1 to indicate that there is one more 'reader', and this operation + if (0 == (mode & TIME_CACHE_UPDATING)) { + // The time cache is up-to-date, so the reader can use 'tm' directly. + // + // And add 1 to indicate that there is one more 'reader', and this operation // will prevent the 'writer' to update the time. mode = ten_atomic_fetch_add(&g_time_cache_mode, 1); - if (0 == (mode & TIME_CACHE_FLUID)) { + if (0 == (mode & TIME_CACHE_UPDATING)) { // The time cache is up-to-date, so the reader can use 'tm' directly. if (g_time_cache_tv.tv_sec == tv->tv_sec) { @@ -59,20 +71,20 @@ bool ten_log_time_cache_get(const struct timeval *tv, struct tm *tm) { } void ten_log_time_cache_set(const struct timeval *tv, struct tm *tm) { - TEN_ASSERT(tv && tm, "Invalid argument."); + assert(tv && tm && "Invalid argument."); // Only update the time when the time cache is outdated. int64_t stale = TIME_CACHE_STALE; - // Mark the time is updating (fluid), and create a critical section for the - // updating operation. + // Mark the time is updating, and create a critical section for the updating + // operation. if (ten_atomic_bool_compare_swap(&g_time_cache_mode, stale, - TIME_CACHE_FLUID)) { + TIME_CACHE_UPDATING)) { g_time_cache_tv = *tv; g_time_cache_tm = *tm; // Mark the time cache is up-to-date. - ten_atomic_and_fetch(&g_time_cache_mode, ~TIME_CACHE_FLUID); + ten_atomic_and_fetch(&g_time_cache_mode, ~TIME_CACHE_UPDATING); } } diff --git a/core/src/ten_utils/sanitizer/memory_check.c b/core/src/ten_utils/sanitizer/memory_check.c index 90a79e7c48..e7a969eb4e 100644 --- a/core/src/ten_utils/sanitizer/memory_check.c +++ b/core/src/ten_utils/sanitizer/memory_check.c @@ -8,18 +8,18 @@ #include "include_internal/ten_utils/lib/alloc.h" #if defined(TEN_USE_ASAN) - #include +#include #endif #include #include +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/sanitizer/memory_check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static ten_sanitizer_memory_records_t g_memory_records = {NULL, @@ -175,19 +175,19 @@ void ten_sanitizer_memory_record_dump(void) { g_memory_records.total_size); } - #if defined(TEN_USE_ASAN) +#if defined(TEN_USE_ASAN) __asan_unpoison_memory_region(&g_memory_records.records.front, sizeof(ten_listnode_t *)); __asan_unpoison_memory_region(&g_memory_records.records.back, sizeof(ten_listnode_t *)); - #endif +#endif size_t idx = 0; ten_list_foreach (&g_memory_records.records, iter) { - #if defined(TEN_USE_ASAN) +#if defined(TEN_USE_ASAN) __asan_unpoison_memory_region((((ten_ptr_listnode_t *)(iter.node))->ptr), sizeof(ten_sanitizer_memory_record_t *)); - #endif +#endif ten_sanitizer_memory_record_t *info = ten_ptr_listnode_get(iter.node); @@ -197,18 +197,18 @@ void ten_sanitizer_memory_record_dump(void) { idx++; - #if defined(TEN_USE_ASAN) +#if defined(TEN_USE_ASAN) __asan_poison_memory_region((((ten_ptr_listnode_t *)(iter.node))->ptr), sizeof(ten_sanitizer_memory_record_t *)); - #endif +#endif } - #if defined(TEN_USE_ASAN) +#if defined(TEN_USE_ASAN) __asan_poison_memory_region(&g_memory_records.records.front, sizeof(ten_listnode_t *)); __asan_poison_memory_region(&g_memory_records.records.back, sizeof(ten_listnode_t *)); - #endif +#endif size_t total_size = g_memory_records.total_size; diff --git a/core/src/ten_utils/sanitizer/thread_check.c b/core/src/ten_utils/sanitizer/thread_check.c index f66c43ceff..204b30bb70 100644 --- a/core/src/ten_utils/sanitizer/thread_check.c +++ b/core/src/ten_utils/sanitizer/thread_check.c @@ -7,10 +7,10 @@ #include +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/sanitizer/thread_check.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" bool ten_sanitizer_thread_check_check_integrity( ten_sanitizer_thread_check_t *self) { diff --git a/core/src/ten_utils/schema/bindings/rust/schema.c b/core/src/ten_utils/schema/bindings/rust/schema.c index 098cfdb8e6..a89da388cb 100644 --- a/core/src/ten_utils/schema/bindings/rust/schema.c +++ b/core/src/ten_utils/schema/bindings/rust/schema.c @@ -5,10 +5,10 @@ // #include "include_internal/ten_utils/schema/bindings/rust/schema.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/schema.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" ten_schema_t *ten_schema_create_from_json_string_proxy(const char *json_string, const char **err_msg) { diff --git a/core/src/ten_utils/schema/keywords/keyword.c b/core/src/ten_utils/schema/keywords/keyword.c index 05c0b00c2f..b04d465cb6 100644 --- a/core/src/ten_utils/schema/keywords/keyword.c +++ b/core/src/ten_utils/schema/keywords/keyword.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_utils/schema/keywords/keyword.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" bool ten_schema_keyword_check_integrity(ten_schema_keyword_t *self) { TEN_ASSERT(self, "Invalid argument."); diff --git a/core/src/ten_utils/schema/keywords/keyword_items.c b/core/src/ten_utils/schema/keywords/keyword_items.c index 3df69b5165..075c4520c5 100644 --- a/core/src/ten_utils/schema/keywords/keyword_items.c +++ b/core/src/ten_utils/schema/keywords/keyword_items.c @@ -5,12 +5,12 @@ // #include "include_internal/ten_utils/schema/keywords/keyword_items.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/schema.h" #include "include_internal/ten_utils/schema/types/schema_array.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/type_operation.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_utils/schema/keywords/keyword_properties.c b/core/src/ten_utils/schema/keywords/keyword_properties.c index 548a26bc99..fa5ecf116c 100644 --- a/core/src/ten_utils/schema/keywords/keyword_properties.c +++ b/core/src/ten_utils/schema/keywords/keyword_properties.c @@ -5,6 +5,7 @@ // #include "include_internal/ten_utils/schema/keywords/keyword_properties.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/schema.h" #include "include_internal/ten_utils/schema/types/schema_object.h" @@ -13,7 +14,6 @@ #include "ten_utils/lib/error.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/type_operation.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_utils/schema/keywords/keyword_required.c b/core/src/ten_utils/schema/keywords/keyword_required.c index b9fe17d371..102e927c6c 100644 --- a/core/src/ten_utils/schema/keywords/keyword_required.c +++ b/core/src/ten_utils/schema/keywords/keyword_required.c @@ -5,6 +5,7 @@ // #include "include_internal/ten_utils/schema/keywords/keyword_required.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/schema.h" #include "include_internal/ten_utils/schema/types/schema_object.h" @@ -15,7 +16,6 @@ #include "ten_utils/lib/error.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_is.h" diff --git a/core/src/ten_utils/schema/keywords/keyword_type.c b/core/src/ten_utils/schema/keywords/keyword_type.c index 567148d89b..b20051393e 100644 --- a/core/src/ten_utils/schema/keywords/keyword_type.c +++ b/core/src/ten_utils/schema/keywords/keyword_type.c @@ -7,13 +7,13 @@ #include +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/schema.h" #include "include_internal/ten_utils/value/value_convert.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/signature.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/type.h" #include "ten_utils/value/type_operation.h" diff --git a/core/src/ten_utils/schema/schema.c b/core/src/ten_utils/schema/schema.c index 9583b3a872..0f93c48fd2 100644 --- a/core/src/ten_utils/schema/schema.c +++ b/core/src/ten_utils/schema/schema.c @@ -5,6 +5,7 @@ // #include "include_internal/ten_utils/schema/schema.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/keywords/keyword_type.h" #include "include_internal/ten_utils/schema/keywords/keywords_info.h" @@ -18,7 +19,6 @@ #include "ten_utils/lib/json.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/type.h" diff --git a/core/src/ten_utils/schema/types/schema_array.c b/core/src/ten_utils/schema/types/schema_array.c index 6c5b441694..46f5d82b2f 100644 --- a/core/src/ten_utils/schema/types/schema_array.c +++ b/core/src/ten_utils/schema/types/schema_array.c @@ -5,8 +5,8 @@ // #include "include_internal/ten_utils/schema/types/schema_array.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/schema.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" bool ten_schema_array_check_integrity(ten_schema_array_t *self) { diff --git a/core/src/ten_utils/schema/types/schema_object.c b/core/src/ten_utils/schema/types/schema_object.c index 76c653c5ad..35935446d1 100644 --- a/core/src/ten_utils/schema/types/schema_object.c +++ b/core/src/ten_utils/schema/types/schema_object.c @@ -5,9 +5,9 @@ // #include "include_internal/ten_utils/schema/types/schema_object.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/keywords/keyword_properties.h" #include "include_internal/ten_utils/schema/schema.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" bool ten_schema_object_check_integrity(ten_schema_object_t *self) { diff --git a/core/src/ten_utils/schema/types/schema_primitive.c b/core/src/ten_utils/schema/types/schema_primitive.c index fbe51ce432..656ffc2f2b 100644 --- a/core/src/ten_utils/schema/types/schema_primitive.c +++ b/core/src/ten_utils/schema/types/schema_primitive.c @@ -5,9 +5,9 @@ // #include "include_internal/ten_utils/schema/types/schema_primitive.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/schema.h" #include "ten_utils/lib/signature.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" bool ten_schema_primitive_check_integrity(ten_schema_primitive_t *self) { diff --git a/core/src/ten_utils/value/type.c b/core/src/ten_utils/value/type.c index 7a3ba523c2..fd5b75dee6 100644 --- a/core/src/ten_utils/value/type.c +++ b/core/src/ten_utils/value/type.c @@ -8,10 +8,10 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/type_info.h" TEN_TYPE ten_type_from_string(const char *type_str) { diff --git a/core/src/ten_utils/value/value.c b/core/src/ten_utils/value/value.c index 84c431e78e..6e72151a32 100644 --- a/core/src/ten_utils/value/value.c +++ b/core/src/ten_utils/value/value.c @@ -13,6 +13,7 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" @@ -20,7 +21,7 @@ #include "ten_utils/lib/buf.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/type.h" #include "ten_utils/value/value_kv.h" diff --git a/core/src/ten_utils/value/value_convert.c b/core/src/ten_utils/value/value_convert.c index 5db5e7b9ce..868c4a7f07 100644 --- a/core/src/ten_utils/value/value_convert.c +++ b/core/src/ten_utils/value/value_convert.c @@ -8,10 +8,10 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_can_convert.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/type.h" #include "ten_utils/value/type_operation.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_utils/value/value_get.c b/core/src/ten_utils/value/value_get.c index daa49ff03e..f519f11132 100644 --- a/core/src/ten_utils/value/value_get.c +++ b/core/src/ten_utils/value/value_get.c @@ -7,12 +7,12 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/type.h" #include "ten_utils/value/type_operation.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_utils/value/value_is.c b/core/src/ten_utils/value/value_is.c index fbd59e2b92..3236cf30b9 100644 --- a/core/src/ten_utils/value/value_is.c +++ b/core/src/ten_utils/value/value_is.c @@ -9,7 +9,7 @@ #include #include -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/value/type.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_kv.h" diff --git a/core/src/ten_utils/value/value_json.c b/core/src/ten_utils/value/value_json.c index faec35be9e..49b99afbdc 100644 --- a/core/src/ten_utils/value/value_json.c +++ b/core/src/ten_utils/value/value_json.c @@ -6,10 +6,10 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/type.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" diff --git a/core/src/ten_utils/value/value_kv.c b/core/src/ten_utils/value/value_kv.c index fd0f956fa7..1054f4b37b 100644 --- a/core/src/ten_utils/value/value_kv.c +++ b/core/src/ten_utils/value/value_kv.c @@ -8,9 +8,9 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value.h" bool ten_value_kv_check_integrity(ten_value_kv_t *self) { diff --git a/core/src/ten_utils/value/value_path.c b/core/src/ten_utils/value/value_path.c index 5993e99935..f1045d2005 100644 --- a/core/src/ten_utils/value/value_path.c +++ b/core/src/ten_utils/value/value_path.c @@ -7,6 +7,7 @@ #include +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/constant_str.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" @@ -14,7 +15,7 @@ #include "ten_utils/container/list_node_ptr.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/value/type.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_kv.h" diff --git a/core/src/ten_utils/value/value_smart_ptr.c b/core/src/ten_utils/value/value_smart_ptr.c index 333a8d219a..c67d900c40 100644 --- a/core/src/ten_utils/value/value_smart_ptr.c +++ b/core/src/ten_utils/value/value_smart_ptr.c @@ -7,9 +7,9 @@ #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/type.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_kv.h" diff --git a/core/src/ten_utils/value/value_string.c b/core/src/ten_utils/value/value_string.c index c92e78d882..bbf5e7b802 100644 --- a/core/src/ten_utils/value/value_string.c +++ b/core/src/ten_utils/value/value_string.c @@ -8,12 +8,12 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/constant_str.h" #include "include_internal/ten_utils/value/value_convert.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/type.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_is.h" diff --git a/packages/core_extension_groups/default_extension_group/src/default_extension_group.c b/packages/core_extension_groups/default_extension_group/src/default_extension_group.c index c310dd1396..302b13124b 100644 --- a/packages/core_extension_groups/default_extension_group/src/default_extension_group.c +++ b/packages/core_extension_groups/default_extension_group/src/default_extension_group.c @@ -11,13 +11,14 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/ten_env/metadata.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/addon/extension_group/extension_group.h" #include "ten_runtime/extension_group/extension_group.h" #include "ten_runtime/ten.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/container/list_ptr.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" static void on_addon_create_instance_done(ten_env_t *ten_env, ten_extension_t *extension, diff --git a/packages/core_extensions/py_init_extension_cpp/src/main.cc b/packages/core_extensions/py_init_extension_cpp/src/main.cc index 6529f3485c..86b92bc498 100644 --- a/packages/core_extensions/py_init_extension_cpp/src/main.cc +++ b/packages/core_extensions/py_init_extension_cpp/src/main.cc @@ -7,14 +7,14 @@ #include #include "include_internal/ten_runtime/app/base_dir.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_runtime/binding/python/common.h" #include "ten_utils/container/list_str.h" #include "ten_utils/lib/module.h" #include "ten_utils/lib/path.h" #include "ten_utils/lib/string.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" static void foo() {} diff --git a/packages/core_protocols/msgpack/common/parser.c b/packages/core_protocols/msgpack/common/parser.c index c196120f09..c3c49ab008 100644 --- a/packages/core_protocols/msgpack/common/parser.c +++ b/packages/core_protocols/msgpack/common/parser.c @@ -9,9 +9,10 @@ #include "core_protocols/msgpack/common/common.h" #include "core_protocols/msgpack/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "msgpack.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" void ten_msgpack_parser_init(ten_msgpack_parser_t *self) { TEN_ASSERT(self, "Invalid argument."); diff --git a/packages/core_protocols/msgpack/common/value.c b/packages/core_protocols/msgpack/common/value.c index d8559561d8..0862cde865 100644 --- a/packages/core_protocols/msgpack/common/value.c +++ b/packages/core_protocols/msgpack/common/value.c @@ -7,6 +7,7 @@ #include "core_protocols/msgpack/common/common.h" #include "core_protocols/msgpack/common/value.h" +#include "include_internal/ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_kv.h" #include "msgpack/object.h" #include "msgpack/pack.h" @@ -14,7 +15,6 @@ #include "ten_utils/container/list.h" #include "ten_utils/container/list_ptr.h" #include "ten_utils/lib/error.h" -#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/type.h" #include "ten_utils/value/value_get.h" diff --git a/packages/core_protocols/msgpack/msg/cmd/custom/cmd.c b/packages/core_protocols/msgpack/msg/cmd/custom/cmd.c index 41462d7693..4ea47084cc 100644 --- a/packages/core_protocols/msgpack/msg/cmd/custom/cmd.c +++ b/packages/core_protocols/msgpack/msg/cmd/custom/cmd.c @@ -8,8 +8,8 @@ #include "core_protocols/msgpack/msg/cmd/custom/cmd.h" #include "core_protocols/msgpack/msg/cmd/custom/field/field_info.h" #include "core_protocols/msgpack/msg/field/field_info.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/cmd/custom/cmd.h" -#include "ten_utils/macro/check.h" static ten_cmd_t *get_raw_cmd(ten_shared_ptr_t *self) { TEN_ASSERT(self && ten_cmd_base_check_integrity(self), "Invalid argument."); diff --git a/packages/core_protocols/msgpack/msg/cmd/field/cmd_id.c b/packages/core_protocols/msgpack/msg/cmd/field/cmd_id.c index 4880bada43..48abd2746e 100644 --- a/packages/core_protocols/msgpack/msg/cmd/field/cmd_id.c +++ b/packages/core_protocols/msgpack/msg/cmd/field/cmd_id.c @@ -8,8 +8,8 @@ #include #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" void ten_msgpack_cmd_id_serialize(ten_msg_t *self, msgpack_packer *pck) { TEN_ASSERT(self && ten_raw_msg_check_integrity(self) && pck, diff --git a/packages/core_protocols/msgpack/msg/cmd/field/seq_id.c b/packages/core_protocols/msgpack/msg/cmd/field/seq_id.c index 4429c58ab9..4188ee3793 100644 --- a/packages/core_protocols/msgpack/msg/cmd/field/seq_id.c +++ b/packages/core_protocols/msgpack/msg/cmd/field/seq_id.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" void ten_msgpack_cmd_seq_id_serialize(ten_msg_t *self, msgpack_packer *pck) { TEN_ASSERT(self && ten_raw_msg_check_integrity(self) && pck, diff --git a/packages/core_protocols/msgpack/msg/data/field/buf.c b/packages/core_protocols/msgpack/msg/data/field/buf.c index 4dc57809ea..62b578486a 100644 --- a/packages/core_protocols/msgpack/msg/data/field/buf.c +++ b/packages/core_protocols/msgpack/msg/data/field/buf.c @@ -10,9 +10,9 @@ #include "core_protocols/msgpack/common/value.h" #include "include_internal/ten_runtime/msg/data/data.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/data/data.h" #include "ten_utils/lib/buf.h" -#include "ten_utils/macro/check.h" void ten_msgpack_data_buf_serialize(ten_msg_t *self, msgpack_packer *pck) { TEN_ASSERT(self && ten_raw_msg_check_integrity(self) && pck, diff --git a/packages/core_protocols/msgpack/msg/field/dest.c b/packages/core_protocols/msgpack/msg/field/dest.c index 1a52bfd58f..d6d3631e06 100644 --- a/packages/core_protocols/msgpack/msg/field/dest.c +++ b/packages/core_protocols/msgpack/msg/field/dest.c @@ -8,9 +8,9 @@ #include #include "core_protocols/msgpack/msg/loc.h" -#include "core_protocols/msgpack/msg/msg.h" +#include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" void ten_msgpack_msg_dest_serialize(ten_msg_t *self, msgpack_packer *pck) { TEN_ASSERT(self && ten_raw_msg_check_integrity(self) && pck, diff --git a/packages/core_protocols/msgpack/msg/field/name.c b/packages/core_protocols/msgpack/msg/field/name.c index 69ed814c48..42ad4035d7 100644 --- a/packages/core_protocols/msgpack/msg/field/name.c +++ b/packages/core_protocols/msgpack/msg/field/name.c @@ -5,8 +5,8 @@ // #include "core_protocols/msgpack/msg/cmd/field/cmd_id.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "msgpack/object.h" -#include "ten_utils/macro/check.h" void ten_msgpack_msg_name_serialize(ten_msg_t *self, msgpack_packer *pck) { TEN_ASSERT(self && ten_raw_msg_check_integrity(self) && pck, diff --git a/packages/core_protocols/msgpack/msg/field/properties.c b/packages/core_protocols/msgpack/msg/field/properties.c index bf23317de3..c86dc184f8 100644 --- a/packages/core_protocols/msgpack/msg/field/properties.c +++ b/packages/core_protocols/msgpack/msg/field/properties.c @@ -11,10 +11,10 @@ #include "core_protocols/msgpack/common/common.h" #include "core_protocols/msgpack/common/value.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "msgpack/object.h" #include "msgpack/pack.h" #include "ten_utils/container/list_ptr.h" -#include "ten_utils/macro/check.h" #include "ten_utils/value/value_kv.h" void ten_msgpack_msg_properties_serialize(ten_msg_t *self, diff --git a/packages/core_protocols/msgpack/msg/field/src.c b/packages/core_protocols/msgpack/msg/field/src.c index ae64ffe191..e16aea1045 100644 --- a/packages/core_protocols/msgpack/msg/field/src.c +++ b/packages/core_protocols/msgpack/msg/field/src.c @@ -9,7 +9,7 @@ #include "core_protocols/msgpack/msg/field/dest.h" #include "core_protocols/msgpack/msg/loc.h" #include "core_protocols/msgpack/msg/msg.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" void ten_msgpack_msg_src_serialize(ten_msg_t *self, msgpack_packer *pck) { TEN_ASSERT(self && ten_raw_msg_check_integrity(self) && pck, diff --git a/packages/core_protocols/msgpack/msg/field/type.c b/packages/core_protocols/msgpack/msg/field/type.c index e34b48233e..793546e273 100644 --- a/packages/core_protocols/msgpack/msg/field/type.c +++ b/packages/core_protocols/msgpack/msg/field/type.c @@ -8,7 +8,7 @@ #include #include "include_internal/ten_runtime/msg/msg.h" -#include "ten_utils/macro/check.h" +#include "include_internal/ten_utils/macro/check.h" void ten_msgpack_msg_type_serialize(ten_msg_t *self, msgpack_packer *pck) { TEN_ASSERT(self && ten_raw_msg_check_integrity(self) && pck, diff --git a/packages/core_protocols/msgpack/msg/loc.c b/packages/core_protocols/msgpack/msg/loc.c index 065e486e7d..1141338f41 100644 --- a/packages/core_protocols/msgpack/msg/loc.c +++ b/packages/core_protocols/msgpack/msg/loc.c @@ -8,6 +8,7 @@ #include #include "core_protocols/msgpack/common/common.h" +#include "include_internal/ten_utils/macro/check.h" #include "msgpack/object.h" #include "msgpack/pack.h" #include "msgpack/unpack.h" @@ -15,7 +16,6 @@ #include "ten_utils/container/list_node.h" #include "ten_utils/container/list_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" void ten_msgpack_loc_serialize(ten_loc_t *self, msgpack_packer *pck) { TEN_ASSERT(self && pck, "Invalid argument."); diff --git a/packages/core_protocols/msgpack/msg/msg.c b/packages/core_protocols/msgpack/msg/msg.c index ed0af027fe..a06abc19f2 100644 --- a/packages/core_protocols/msgpack/msg/msg.c +++ b/packages/core_protocols/msgpack/msg/msg.c @@ -12,8 +12,8 @@ #include "core_protocols/msgpack/msg/field/field_info.h" #include "core_protocols/msgpack/msg/msg.h" #include "core_protocols/msgpack/msg/msg_info.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/smart_ptr.h" -#include "ten_utils/macro/check.h" void ten_msgpack_msghdr_serialize(ten_msg_t *self, msgpack_packer *pck) { TEN_ASSERT(self && ten_raw_msg_check_integrity(self) && pck, diff --git a/packages/core_protocols/msgpack/protocol.c b/packages/core_protocols/msgpack/protocol.c index d657d8ce48..da6d04a877 100644 --- a/packages/core_protocols/msgpack/protocol.c +++ b/packages/core_protocols/msgpack/protocol.c @@ -13,11 +13,12 @@ #include "include_internal/ten_runtime/metadata/metadata.h" #include "include_internal/ten_runtime/protocol/integrated/protocol_integrated.h" #include "include_internal/ten_runtime/ten_env/metadata.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/addon/addon.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/macro/check.h" +#include "ten_utils/macro/mark.h" typedef struct ten_protocol_msgpack_t { ten_protocol_integrated_t base; diff --git a/packages/example_extensions/ffmpeg_demuxer/src/demuxer.cc b/packages/example_extensions/ffmpeg_demuxer/src/demuxer.cc index 28c83f8a23..00065c18f7 100644 --- a/packages/example_extensions/ffmpeg_demuxer/src/demuxer.cc +++ b/packages/example_extensions/ffmpeg_demuxer/src/demuxer.cc @@ -14,12 +14,12 @@ #include #include +#include "include_internal/ten_utils/macro/check.h" #include "libavcodec/packet.h" #include "libavutil/channel_layout.h" #include "libswresample/swresample.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_runtime/msg/video_frame/video_frame.h" -#include "ten_utils/macro/check.h" #ifdef __cplusplus extern "C" { @@ -46,10 +46,10 @@ extern "C" { #endif #include "demuxer_thread.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/lib/alloc.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #define GET_FFMPEG_ERROR_MESSAGE(err_msg, errnum) \ /* NOLINTNEXTLINE */ \ diff --git a/packages/example_extensions/ffmpeg_demuxer/src/demuxer_thread.cc b/packages/example_extensions/ffmpeg_demuxer/src/demuxer_thread.cc index 925c551db3..f4f32a4a8f 100644 --- a/packages/example_extensions/ffmpeg_demuxer/src/demuxer_thread.cc +++ b/packages/example_extensions/ffmpeg_demuxer/src/demuxer_thread.cc @@ -13,13 +13,13 @@ #include #include "demuxer.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "libavutil/rational.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/event.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" namespace ten { namespace ffmpeg_extension { diff --git a/packages/example_extensions/ffmpeg_muxer/src/muxer.cc b/packages/example_extensions/ffmpeg_muxer/src/muxer.cc index 0c5661b867..c62f457097 100644 --- a/packages/example_extensions/ffmpeg_muxer/src/muxer.cc +++ b/packages/example_extensions/ffmpeg_muxer/src/muxer.cc @@ -9,12 +9,12 @@ #include #include +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/macro/check.h" #include "libavcodec/packet.h" #include "libavutil/channel_layout.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/lang/cpp/lib/buf.h" -#include "ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #define ms2pts(pts, stream) \ av_rescale(pts, (stream)->time_base.den, \ diff --git a/packages/example_extensions/ffmpeg_muxer/src/muxer_thread.cc b/packages/example_extensions/ffmpeg_muxer/src/muxer_thread.cc index f7ac3290c6..a6298c37da 100644 --- a/packages/example_extensions/ffmpeg_muxer/src/muxer_thread.cc +++ b/packages/example_extensions/ffmpeg_muxer/src/muxer_thread.cc @@ -8,13 +8,13 @@ #include #include +#include "include_internal/ten_utils/log/log.h" #include "muxer.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/lib/event.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" -#include "ten_utils/log/log.h" namespace ten { namespace ffmpeg_extension { diff --git a/tests/common/client/cpp/msgpack_tcp.h b/tests/common/client/cpp/msgpack_tcp.h index 3fc39c74f9..bbba63c615 100644 --- a/tests/common/client/cpp/msgpack_tcp.h +++ b/tests/common/client/cpp/msgpack_tcp.h @@ -11,6 +11,7 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" diff --git a/tests/common/client/curl_connect.c b/tests/common/client/curl_connect.c index 560ed7b436..a2d4ab2ecb 100644 --- a/tests/common/client/curl_connect.c +++ b/tests/common/client/curl_connect.c @@ -5,8 +5,8 @@ // #include "tests/common/client/curl_connect.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/time.h" -#include "ten_utils/log/log.h" bool ten_test_curl_connect_with_retry(CURL *curl, uint16_t max_retries, int64_t delay_in_ms) { diff --git a/tests/common/client/http.c b/tests/common/client/http.c index dcbea3c736..0290b3179c 100644 --- a/tests/common/client/http.c +++ b/tests/common/client/http.c @@ -11,8 +11,8 @@ #include #include "include_internal/ten_utils/lib/buf.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/buf.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/curl_connect.h" #include "tests/common/constant.h" diff --git a/tests/common/client/msgpack_tcp.c b/tests/common/client/msgpack_tcp.c index d63e2d0e27..17b71caf88 100644 --- a/tests/common/client/msgpack_tcp.c +++ b/tests/common/client/msgpack_tcp.c @@ -8,13 +8,13 @@ #include "core_protocols/msgpack/common/parser.h" #include "core_protocols/msgpack/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/tcp.h" static ten_buf_t ten_test_msgpack_tcp_client_msgs_to_buf(ten_list_t *msgs) { diff --git a/tests/common/client/tcp.c b/tests/common/client/tcp.c index 1d87b354fe..eb4e3d0471 100644 --- a/tests/common/client/tcp.c +++ b/tests/common/client/tcp.c @@ -9,6 +9,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_result/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/ten.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_str.h" @@ -18,7 +19,6 @@ #include "ten_utils/lib/buf.h" #include "ten_utils/lib/string.h" #include "ten_utils/lib/time.h" -#include "ten_utils/macro/check.h" static void ten_test_tcp_client_dump_socket_info(ten_test_tcp_client_t *self, const char *fmt, ...) { diff --git a/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/property.json b/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/property.json index 43f26a54a0..bdcb52ffb6 100644 --- a/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/property.json +++ b/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/property.json @@ -1,7 +1,7 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/ten_packages/extension/default_extension_cpp/src/main.cc b/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/ten_packages/extension/default_extension_cpp/src/main.cc index 7ba4c479a0..e38c518ddd 100644 --- a/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/ten_packages/extension/default_extension_cpp/src/main.cc +++ b/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/ten_packages/extension/default_extension_cpp/src/main.cc @@ -5,8 +5,8 @@ // #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/cpp/ten.h" -#include "ten_utils/macro/check.h" class ffmpeg_client_extension : public ten::extension_t { public: diff --git a/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/property.json b/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/property.json index c54a3eb371..d7302a316c 100644 --- a/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/property.json +++ b/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/property.json @@ -1,7 +1,7 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/ten_packages/extension/default_extension_cpp/src/main.cc b/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/ten_packages/extension/default_extension_cpp/src/main.cc index 74ebadc297..99fbc243b7 100644 --- a/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/ten_packages/extension/default_extension_cpp/src/main.cc +++ b/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/ten_packages/extension/default_extension_cpp/src/main.cc @@ -5,8 +5,8 @@ // #include +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/binding/cpp/ten.h" -#include "ten_utils/macro/check.h" class ffmpeg_client_extension : public ten::extension_t { public: diff --git a/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/property.json b/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/property.json index 5413eda412..24dd86fc89 100644 --- a/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/property.json +++ b/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/property.json @@ -1,7 +1,7 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8007/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/default_extension.go b/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/default_extension.go index 3e6c554eed..d27f633039 100644 --- a/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/default_extension.go +++ b/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/default_extension.go @@ -18,7 +18,7 @@ type baseExtension struct { } func (ext *baseExtension) OnStart(tenEnv ten.TenEnv) { - tenEnv.Log(ten.LogLevelDebug, "baseExtension OnStart") + fmt.Println("baseExtension OnStart") tenEnv.OnStartDone() } diff --git a/tests/ten_runtime/integration/go/access_property_go/client/client.cc b/tests/ten_runtime/integration/go/access_property_go/client/client.cc index 38e98016e9..ca801fd394 100644 --- a/tests/ten_runtime/integration/go/access_property_go/client/client.cc +++ b/tests/ten_runtime/integration/go/access_property_go/client/client.cc @@ -5,7 +5,7 @@ // #include -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/close_app_go/client/client.cc b/tests/ten_runtime/integration/go/close_app_go/client/client.cc index 0766e6358f..736c4983c5 100644 --- a/tests/ten_runtime/integration/go/close_app_go/client/client.cc +++ b/tests/ten_runtime/integration/go/close_app_go/client/client.cc @@ -6,7 +6,7 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/close_app_go/close_app_go_app/property.json b/tests/ten_runtime/integration/go/close_app_go/close_app_go_app/property.json index 10a6d3f320..f3c0d5a5b9 100644 --- a/tests/ten_runtime/integration/go/close_app_go/close_app_go_app/property.json +++ b/tests/ten_runtime/integration/go/close_app_go/close_app_go_app/property.json @@ -2,7 +2,7 @@ "_ten": { "uri": "msgpack://127.0.0.1:8007/", "long_running_mode": true, - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/go/expired_ten_go/client/client.cc b/tests/ten_runtime/integration/go/expired_ten_go/client/client.cc index 5b58dcf778..05c98e7cd7 100644 --- a/tests/ten_runtime/integration/go/expired_ten_go/client/client.cc +++ b/tests/ten_runtime/integration/go/expired_ten_go/client/client.cc @@ -6,7 +6,7 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/expired_ten_go/expired_ten_go_app/property.json b/tests/ten_runtime/integration/go/expired_ten_go/expired_ten_go_app/property.json index da5f425e1e..20461189d4 100644 --- a/tests/ten_runtime/integration/go/expired_ten_go/expired_ten_go_app/property.json +++ b/tests/ten_runtime/integration/go/expired_ten_go/expired_ten_go_app/property.json @@ -1,7 +1,7 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8007/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/go/frequently_cgo_call_go/client/client.cc b/tests/ten_runtime/integration/go/frequently_cgo_call_go/client/client.cc index 365ac24ba4..2a6850d8c4 100644 --- a/tests/ten_runtime/integration/go/frequently_cgo_call_go/client/client.cc +++ b/tests/ten_runtime/integration/go/frequently_cgo_call_go/client/client.cc @@ -6,7 +6,7 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/frequently_cgo_call_go/frequently_cgo_call_go_app/property.json b/tests/ten_runtime/integration/go/frequently_cgo_call_go/frequently_cgo_call_go_app/property.json index e8e2b93d40..1f29b81a0b 100644 --- a/tests/ten_runtime/integration/go/frequently_cgo_call_go/frequently_cgo_call_go_app/property.json +++ b/tests/ten_runtime/integration/go/frequently_cgo_call_go/frequently_cgo_call_go_app/property.json @@ -1,7 +1,7 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8007/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/go/handle_error_go/client/client.cc b/tests/ten_runtime/integration/go/handle_error_go/client/client.cc index 552bc38938..212adb518c 100644 --- a/tests/ten_runtime/integration/go/handle_error_go/client/client.cc +++ b/tests/ten_runtime/integration/go/handle_error_go/client/client.cc @@ -6,7 +6,7 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/handle_error_go/handle_error_go_app/property.json b/tests/ten_runtime/integration/go/handle_error_go/handle_error_go_app/property.json index da5f425e1e..20461189d4 100644 --- a/tests/ten_runtime/integration/go/handle_error_go/handle_error_go_app/property.json +++ b/tests/ten_runtime/integration/go/handle_error_go/handle_error_go_app/property.json @@ -1,7 +1,7 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8007/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/go/prepare_to_stop_go/client/client.cc b/tests/ten_runtime/integration/go/prepare_to_stop_go/client/client.cc index fe6d220ff4..fb8414b83d 100644 --- a/tests/ten_runtime/integration/go/prepare_to_stop_go/client/client.cc +++ b/tests/ten_runtime/integration/go/prepare_to_stop_go/client/client.cc @@ -6,7 +6,7 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/prepare_to_stop_go/prepare_to_stop_go_app/property.json b/tests/ten_runtime/integration/go/prepare_to_stop_go/prepare_to_stop_go_app/property.json index 7401a02f80..7bbe5e47d0 100644 --- a/tests/ten_runtime/integration/go/prepare_to_stop_go/prepare_to_stop_go_app/property.json +++ b/tests/ten_runtime/integration/go/prepare_to_stop_go/prepare_to_stop_go_app/property.json @@ -1,7 +1,7 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8007/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/go/return_result_go/client/client.cc b/tests/ten_runtime/integration/go/return_result_go/client/client.cc index 9a5810b9ce..48dd501153 100644 --- a/tests/ten_runtime/integration/go/return_result_go/client/client.cc +++ b/tests/ten_runtime/integration/go/return_result_go/client/client.cc @@ -5,7 +5,7 @@ // #include -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/return_result_go/return_result_go_app/property.json b/tests/ten_runtime/integration/go/return_result_go/return_result_go_app/property.json index da5f425e1e..20461189d4 100644 --- a/tests/ten_runtime/integration/go/return_result_go/return_result_go_app/property.json +++ b/tests/ten_runtime/integration/go/return_result_go/return_result_go_app/property.json @@ -1,7 +1,7 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8007/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/go/return_value_go/client/client.cc b/tests/ten_runtime/integration/go/return_value_go/client/client.cc index 5b58dcf778..05c98e7cd7 100644 --- a/tests/ten_runtime/integration/go/return_value_go/client/client.cc +++ b/tests/ten_runtime/integration/go/return_value_go/client/client.cc @@ -6,7 +6,7 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/return_value_go/return_value_go_app/property.json b/tests/ten_runtime/integration/go/return_value_go/return_value_go_app/property.json index da5f425e1e..20461189d4 100644 --- a/tests/ten_runtime/integration/go/return_value_go/return_value_go_app/property.json +++ b/tests/ten_runtime/integration/go/return_value_go/return_value_go_app/property.json @@ -1,7 +1,7 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8007/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/go/send_json_go/client/client.cc b/tests/ten_runtime/integration/go/send_json_go/client/client.cc index 490d0b4165..399c26587b 100644 --- a/tests/ten_runtime/integration/go/send_json_go/client/client.cc +++ b/tests/ten_runtime/integration/go/send_json_go/client/client.cc @@ -6,7 +6,7 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/send_json_go/send_json_go_app/property.json b/tests/ten_runtime/integration/go/send_json_go/send_json_go_app/property.json index 97d2d459cd..095e4eb417 100644 --- a/tests/ten_runtime/integration/go/send_json_go/send_json_go_app/property.json +++ b/tests/ten_runtime/integration/go/send_json_go/send_json_go_app/property.json @@ -1,7 +1,7 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8007/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/go/start_app_sync_go/client/client.cc b/tests/ten_runtime/integration/go/start_app_sync_go/client/client.cc index 0766e6358f..736c4983c5 100644 --- a/tests/ten_runtime/integration/go/start_app_sync_go/client/client.cc +++ b/tests/ten_runtime/integration/go/start_app_sync_go/client/client.cc @@ -6,7 +6,7 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/start_app_sync_go/start_app_sync_go_app/property.json b/tests/ten_runtime/integration/go/start_app_sync_go/start_app_sync_go_app/property.json index 36ddb7d6d9..b1705890aa 100644 --- a/tests/ten_runtime/integration/go/start_app_sync_go/start_app_sync_go_app/property.json +++ b/tests/ten_runtime/integration/go/start_app_sync_go/start_app_sync_go_app/property.json @@ -1,7 +1,7 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8007/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/go/three_extension_cmd_go/client/client.cc b/tests/ten_runtime/integration/go/three_extension_cmd_go/client/client.cc index ca67d7c244..5b8f52c873 100644 --- a/tests/ten_runtime/integration/go/three_extension_cmd_go/client/client.cc +++ b/tests/ten_runtime/integration/go/three_extension_cmd_go/client/client.cc @@ -6,7 +6,7 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/three_extension_cmd_go/three_extension_cmd_go_app/property.json b/tests/ten_runtime/integration/go/three_extension_cmd_go/three_extension_cmd_go_app/property.json index 909f575836..d033da8a2c 100644 --- a/tests/ten_runtime/integration/go/three_extension_cmd_go/three_extension_cmd_go_app/property.json +++ b/tests/ten_runtime/integration/go/three_extension_cmd_go/three_extension_cmd_go_app/property.json @@ -1,6 +1,6 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8007/", - "log_level": 1 + "log_level": 2 } } \ No newline at end of file diff --git a/tests/ten_runtime/integration/go/transfer_pointer_go/client/client.cc b/tests/ten_runtime/integration/go/transfer_pointer_go/client/client.cc index 07d0fcc018..40dc2706cd 100644 --- a/tests/ten_runtime/integration/go/transfer_pointer_go/client/client.cc +++ b/tests/ten_runtime/integration/go/transfer_pointer_go/client/client.cc @@ -5,7 +5,7 @@ // #include -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/transfer_pointer_go/transfer_pointer_go_app/property.json b/tests/ten_runtime/integration/go/transfer_pointer_go/transfer_pointer_go_app/property.json index da5f425e1e..20461189d4 100644 --- a/tests/ten_runtime/integration/go/transfer_pointer_go/transfer_pointer_go_app/property.json +++ b/tests/ten_runtime/integration/go/transfer_pointer_go/transfer_pointer_go_app/property.json @@ -1,7 +1,7 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8007/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/client/client.cc b/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/client/client.cc index 3078ff2418..6556117fe2 100644 --- a/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/client/client.cc +++ b/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/client/client.cc @@ -6,7 +6,7 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/two_extension_one_group_cmd_go_app/property.json b/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/two_extension_one_group_cmd_go_app/property.json index 909f575836..d033da8a2c 100644 --- a/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/two_extension_one_group_cmd_go_app/property.json +++ b/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/two_extension_one_group_cmd_go_app/property.json @@ -1,6 +1,6 @@ { "_ten": { "uri": "msgpack://127.0.0.1:8007/", - "log_level": 1 + "log_level": 2 } } \ No newline at end of file diff --git a/tests/ten_runtime/integration/python/aio_http_server_python/aio_http_server_python_app/property.json b/tests/ten_runtime/integration/python/aio_http_server_python/aio_http_server_python_app/property.json index 97b098163c..e8a8a7bca4 100644 --- a/tests/ten_runtime/integration/python/aio_http_server_python/aio_http_server_python_app/property.json +++ b/tests/ten_runtime/integration/python/aio_http_server_python/aio_http_server_python_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/async_io_basic_python/async_io_basic_python_app/property.json b/tests/ten_runtime/integration/python/async_io_basic_python/async_io_basic_python_app/property.json index 81cc52f182..58ea914da0 100644 --- a/tests/ten_runtime/integration/python/async_io_basic_python/async_io_basic_python_app/property.json +++ b/tests/ten_runtime/integration/python/async_io_basic_python/async_io_basic_python_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/cpp_app_multi_process_python/cpp_app_multi_process_python_app_source/property.json b/tests/ten_runtime/integration/python/cpp_app_multi_process_python/cpp_app_multi_process_python_app_source/property.json index 6b2e32ec6e..b80960edaf 100644 --- a/tests/ten_runtime/integration/python/cpp_app_multi_process_python/cpp_app_multi_process_python_app_source/property.json +++ b/tests/ten_runtime/integration/python/cpp_app_multi_process_python/cpp_app_multi_process_python_app_source/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/cpp_app_python/cpp_app_python_app_source/property.json b/tests/ten_runtime/integration/python/cpp_app_python/cpp_app_python_app_source/property.json index 4eca5f164e..69822632fd 100644 --- a/tests/ten_runtime/integration/python/cpp_app_python/cpp_app_python_app_source/property.json +++ b/tests/ten_runtime/integration/python/cpp_app_python/cpp_app_python_app_source/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/go_app_cythonize/go_app_cythonize_app/property.json b/tests/ten_runtime/integration/python/go_app_cythonize/go_app_cythonize_app/property.json index 3a22c43a38..04953fb603 100644 --- a/tests/ten_runtime/integration/python/go_app_cythonize/go_app_cythonize_app/property.json +++ b/tests/ten_runtime/integration/python/go_app_cythonize/go_app_cythonize_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/go_app_partially_cythonize/go_app_partially_cythonize_app/property.json b/tests/ten_runtime/integration/python/go_app_partially_cythonize/go_app_partially_cythonize_app/property.json index 3a22c43a38..04953fb603 100644 --- a/tests/ten_runtime/integration/python/go_app_partially_cythonize/go_app_partially_cythonize_app/property.json +++ b/tests/ten_runtime/integration/python/go_app_partially_cythonize/go_app_partially_cythonize_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/property.json b/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/property.json index 3a22c43a38..04953fb603 100644 --- a/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/property.json +++ b/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/multi_process_python/multi_process_python_app/property.json b/tests/ten_runtime/integration/python/multi_process_python/multi_process_python_app/property.json index 6b2e32ec6e..b80960edaf 100644 --- a/tests/ten_runtime/integration/python/multi_process_python/multi_process_python_app/property.json +++ b/tests/ten_runtime/integration/python/multi_process_python/multi_process_python_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/multiple_results_python/multiple_results_python_app/property.json b/tests/ten_runtime/integration/python/multiple_results_python/multiple_results_python_app/property.json index df2cc3eed8..d78ececc72 100644 --- a/tests/ten_runtime/integration/python/multiple_results_python/multiple_results_python_app/property.json +++ b/tests/ten_runtime/integration/python/multiple_results_python/multiple_results_python_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/resp_handler_yield_python/resp_handler_yield_python_app/property.json b/tests/ten_runtime/integration/python/resp_handler_yield_python/resp_handler_yield_python_app/property.json index 81cc52f182..58ea914da0 100644 --- a/tests/ten_runtime/integration/python/resp_handler_yield_python/resp_handler_yield_python_app/property.json +++ b/tests/ten_runtime/integration/python/resp_handler_yield_python/resp_handler_yield_python_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/send_cmd_discard_result_python/send_cmd_discard_result_python_app/property.json b/tests/ten_runtime/integration/python/send_cmd_discard_result_python/send_cmd_discard_result_python_app/property.json index 1c2367284c..5e83142939 100644 --- a/tests/ten_runtime/integration/python/send_cmd_discard_result_python/send_cmd_discard_result_python_app/property.json +++ b/tests/ten_runtime/integration/python/send_cmd_discard_result_python/send_cmd_discard_result_python_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/property.json b/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/property.json index 81cc52f182..58ea914da0 100644 --- a/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/property.json +++ b/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/ten_packages/extension/default_extension_python/extension.py b/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/ten_packages/extension/default_extension_python/extension.py index f6a3186c69..938f05429c 100644 --- a/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/ten_packages/extension/default_extension_python/extension.py +++ b/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/ten_packages/extension/default_extension_python/extension.py @@ -12,9 +12,7 @@ def __init__(self, name: str) -> None: self.name = name def on_init(self, ten_env: TenEnv) -> None: - ten_env.log( - TenEnvLogLevel.DEBUG, "DefaultExtension on_init, name", self.name - ) + print("DefaultExtension on_init, name", self.name) assert self.name == "default_extension_python" ten_env.init_property_from_json('{"testKey": "testValue"}') diff --git a/tests/ten_runtime/integration/python/send_data_python/send_data_python_app/property.json b/tests/ten_runtime/integration/python/send_data_python/send_data_python_app/property.json index 3c96fedb2b..2a0bff8c45 100644 --- a/tests/ten_runtime/integration/python/send_data_python/send_data_python_app/property.json +++ b/tests/ten_runtime/integration/python/send_data_python/send_data_python_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/send_json_python/send_json_python_app/property.json b/tests/ten_runtime/integration/python/send_json_python/send_json_python_app/property.json index 81cc52f182..58ea914da0 100644 --- a/tests/ten_runtime/integration/python/send_json_python/send_json_python_app/property.json +++ b/tests/ten_runtime/integration/python/send_json_python/send_json_python_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/send_recv_image_python/send_recv_image_python_app/property.json b/tests/ten_runtime/integration/python/send_recv_image_python/send_recv_image_python_app/property.json index 069d262ce3..6643096d00 100644 --- a/tests/ten_runtime/integration/python/send_recv_image_python/send_recv_image_python_app/property.json +++ b/tests/ten_runtime/integration/python/send_recv_image_python/send_recv_image_python_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/send_recv_pcm_python/send_recv_pcm_python_app/property.json b/tests/ten_runtime/integration/python/send_recv_pcm_python/send_recv_pcm_python_app/property.json index bcbb49ffd3..1a78b50f90 100644 --- a/tests/ten_runtime/integration/python/send_recv_pcm_python/send_recv_pcm_python_app/property.json +++ b/tests/ten_runtime/integration/python/send_recv_pcm_python/send_recv_pcm_python_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/integration/python/unused_addon_python/unused_addon_python_app/property.json b/tests/ten_runtime/integration/python/unused_addon_python/unused_addon_python_app/property.json index e44b8fa71b..9c92d415d8 100644 --- a/tests/ten_runtime/integration/python/unused_addon_python/unused_addon_python_app/property.json +++ b/tests/ten_runtime/integration/python/unused_addon_python/unused_addon_python_app/property.json @@ -1,6 +1,6 @@ { "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [ { "name": "0", diff --git a/tests/ten_runtime/smoke/audio_frame_test/basic.cc b/tests/ten_runtime/smoke/audio_frame_test/basic.cc index 890e421473..4fd57a773f 100644 --- a/tests/ten_runtime/smoke/audio_frame_test/basic.cc +++ b/tests/ten_runtime/smoke/audio_frame_test/basic.cc @@ -57,7 +57,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/audio_frame_test/create_from_json.cc b/tests/ten_runtime/smoke/audio_frame_test/create_from_json.cc index e62d6e7251..a368b3a642 100644 --- a/tests/ten_runtime/smoke/audio_frame_test/create_from_json.cc +++ b/tests/ten_runtime/smoke/audio_frame_test/create_from_json.cc @@ -78,7 +78,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/audio_frame_test/from_json.cc b/tests/ten_runtime/smoke/audio_frame_test/from_json.cc index b869ee4813..ea01924b11 100644 --- a/tests/ten_runtime/smoke/audio_frame_test/from_json.cc +++ b/tests/ten_runtime/smoke/audio_frame_test/from_json.cc @@ -77,7 +77,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/audio_frame_test/multi_dest_pcm_frame.cc b/tests/ten_runtime/smoke/audio_frame_test/multi_dest_pcm_frame.cc index 6020c95848..3c872b5dfb 100644 --- a/tests/ten_runtime/smoke/audio_frame_test/multi_dest_pcm_frame.cc +++ b/tests/ten_runtime/smoke/audio_frame_test/multi_dest_pcm_frame.cc @@ -9,8 +9,8 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -136,7 +136,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_connect_cmd.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_connect_cmd.cc index 4588a1d2e6..03a5a19211 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_connect_cmd.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_connect_cmd.cc @@ -75,7 +75,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_data.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_data.cc index 4430307213..66a7c4a696 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_data.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_data.cc @@ -117,7 +117,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph.cc index b9183ee433..dfeb6e9a99 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph.cc @@ -87,7 +87,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph_default_uri.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph_default_uri.cc index 8f778e0187..48ce4c3997 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph_default_uri.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph_default_uri.cc @@ -86,7 +86,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": true, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path.cc index 12f0dad6fe..8ac99d98e5 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path.cc @@ -64,7 +64,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_1.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_1.cc index 7a3240180c..b9edf74e73 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_1.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_1.cc @@ -64,7 +64,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_2.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_2.cc index 6f7a9578f0..d6b9913d37 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_2.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_2.cc @@ -66,7 +66,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_3.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_3.cc index 27f60d6129..9511669faf 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_3.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_3.cc @@ -66,7 +66,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_4.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_4.cc index f10ddaed85..b4ce46fb22 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_4.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_4.cc @@ -67,7 +67,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_5.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_5.cc index e29fdb28ea..4462e3d50b 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_5.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_5.cc @@ -67,7 +67,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_6.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_6.cc index e5df9757a8..da44fa26a5 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_6.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_6.cc @@ -67,7 +67,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_7.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_7.cc index d00792b1ff..6d6e8e4a0f 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_7.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_7.cc @@ -67,7 +67,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_keep_original.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_keep_original.cc index 775cc54e43..3ff2d02a64 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_keep_original.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_keep_original.cc @@ -66,7 +66,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_1.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_1.cc index e745bf939f..7cba09f575 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_1.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_1.cc @@ -66,7 +66,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_2.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_2.cc index 3ea065ff8f..9f2043da3a 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_2.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_2.cc @@ -66,7 +66,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_3.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_3.cc index b406486c64..1300d554f8 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_3.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_3.cc @@ -66,7 +66,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_4.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_4.cc index a1613f2416..b56cde70ee 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_4.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_4.cc @@ -66,7 +66,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc index fa7b08b82f..29c9490e1c 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc @@ -68,7 +68,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/cmd_result_test/multiple_result.cc b/tests/ten_runtime/smoke/cmd_result_test/multiple_result.cc index 477d9b353d..397929b731 100644 --- a/tests/ten_runtime/smoke/cmd_result_test/multiple_result.cc +++ b/tests/ten_runtime/smoke/cmd_result_test/multiple_result.cc @@ -69,7 +69,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/data_test/basic.cc b/tests/ten_runtime/smoke/data_test/basic.cc index d343bfcaf1..45d2252def 100644 --- a/tests/ten_runtime/smoke/data_test/basic.cc +++ b/tests/ten_runtime/smoke/data_test/basic.cc @@ -78,7 +78,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/data_test/basic_2.cc b/tests/ten_runtime/smoke/data_test/basic_2.cc index c655e04b46..974e6676e6 100644 --- a/tests/ten_runtime/smoke/data_test/basic_2.cc +++ b/tests/ten_runtime/smoke/data_test/basic_2.cc @@ -56,7 +56,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/data_test/create_from_json.cc b/tests/ten_runtime/smoke/data_test/create_from_json.cc index 6bc5a9e701..2c81702e4d 100644 --- a/tests/ten_runtime/smoke/data_test/create_from_json.cc +++ b/tests/ten_runtime/smoke/data_test/create_from_json.cc @@ -67,7 +67,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/data_test/from_json.cc b/tests/ten_runtime/smoke/data_test/from_json.cc index 11fbcd6193..3ad96b90bb 100644 --- a/tests/ten_runtime/smoke/data_test/from_json.cc +++ b/tests/ten_runtime/smoke/data_test/from_json.cc @@ -65,7 +65,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/data_test/multi_dest_data.cc b/tests/ten_runtime/smoke/data_test/multi_dest_data.cc index 686ee91b3b..6c21d89e4b 100644 --- a/tests/ten_runtime/smoke/data_test/multi_dest_data.cc +++ b/tests/ten_runtime/smoke/data_test/multi_dest_data.cc @@ -9,8 +9,8 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -125,7 +125,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_extensions_init_dependency.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_extensions_init_dependency.cc index 93a8d58dc7..68cc25b1ed 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_extensions_init_dependency.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_extensions_init_dependency.cc @@ -152,7 +152,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_1.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_1.cc index 2cfa87d9dd..2fd16b3399 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_1.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_1.cc @@ -36,7 +36,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_2.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_2.cc index 4dc65b0615..16b016fdb6 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_2.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_2.cc @@ -58,7 +58,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_loop.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_loop.cc index c8a28bcdd1..f46e4cd49c 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_loop.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_loop.cc @@ -115,7 +115,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd.cc index a32b70f187..a8086ac8fc 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd.cc @@ -117,7 +117,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd_snap_shot.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd_snap_shot.cc index 17da037cff..008fc9be5e 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd_snap_shot.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd_snap_shot.cc @@ -117,7 +117,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_msg_property_to_prop_store.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_msg_property_to_prop_store.cc index ff81d15323..ceef11c4ab 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_msg_property_to_prop_store.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_msg_property_to_prop_store.cc @@ -8,8 +8,8 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -57,7 +57,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app.cc index ea43c29c60..59f9933019 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app.cc @@ -112,7 +112,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -133,7 +133,7 @@ class test_app_2 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8002/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app_close_through_engine.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app_close_through_engine.cc index b3d1f18946..a65194f1cb 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app_close_through_engine.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app_close_through_engine.cc @@ -111,7 +111,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -132,7 +132,7 @@ class test_app_2 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8002/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension.cc index 07350a1b8c..0bf2a2953c 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension.cc @@ -75,7 +75,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension_group.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension_group.cc index 793161670c..c192e9529c 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension_group.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension_group.cc @@ -92,7 +92,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_no_init_extension_group.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_no_init_extension_group.cc index c7bd177f55..654e60908d 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_no_init_extension_group.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_no_init_extension_group.cc @@ -59,7 +59,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_throw_exception_in_extension.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_throw_exception_in_extension.cc index 9d4376851c..dab3163efc 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_throw_exception_in_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_throw_exception_in_extension.cc @@ -145,7 +145,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -166,7 +166,7 @@ class test_app_2 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8002/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -187,7 +187,7 @@ class test_app_3 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8003/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_two_extensions.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_two_extensions.cc index 48d571c162..2acee1a2a8 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_two_extensions.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_two_extensions.cc @@ -49,7 +49,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_1.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_1.cc index 704e0e39a6..e860e234bb 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_1.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_1.cc @@ -46,7 +46,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_2.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_2.cc index 5123219de6..c8bc60ceee 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_2.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_2.cc @@ -46,7 +46,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/command/command_check_cmd_out.cc b/tests/ten_runtime/smoke/extension_test/command/command_check_cmd_out.cc index 08a8d13249..a87334078e 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_check_cmd_out.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_check_cmd_out.cc @@ -95,7 +95,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension.cc b/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension.cc index 3c6e10ab61..d381902110 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension.cc @@ -59,7 +59,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_2.cc b/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_2.cc index c7cf5f9d0b..1bb6d38a4b 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_2.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_2.cc @@ -89,7 +89,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_group.cc b/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_group.cc index 63d2eaecfe..10ca8a31de 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_group.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_group.cc @@ -59,7 +59,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/command/command_send_enum.cc b/tests/ten_runtime/smoke/extension_test/command/command_send_enum.cc index 6ec037d24f..714774bd21 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_send_enum.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_send_enum.cc @@ -8,8 +8,8 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -79,7 +79,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/command/command_send_ptr.cc b/tests/ten_runtime/smoke/extension_test/command/command_send_ptr.cc index 5adccf118e..c9674d02f1 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_send_ptr.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_send_ptr.cc @@ -71,7 +71,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/command/command_send_ptr_through_cmd.cc b/tests/ten_runtime/smoke/extension_test/command/command_send_ptr_through_cmd.cc index ae626389a5..9b01b72493 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_send_ptr_through_cmd.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_send_ptr_through_cmd.cc @@ -73,7 +73,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively.cc b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively.cc index 9647aa540a..25151aa1ff 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively.cc @@ -158,7 +158,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -179,7 +179,7 @@ class test_app_2 : public ten::app_t { "uri": "msgpack://127.0.0.1:8002/", "one_event_loop_per_engine": true, "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -199,7 +199,7 @@ class test_app_3 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8003/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd.cc b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd.cc index 7bbbab333c..abe9995d5e 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd.cc @@ -157,7 +157,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -178,7 +178,7 @@ class test_app_2 : public ten::app_t { "uri": "msgpack://127.0.0.1:8002/", "one_event_loop_per_engine": true, "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -198,7 +198,7 @@ class test_app_3 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8003/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd_dest.cc b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd_dest.cc index f807009549..c501397f7a 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd_dest.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd_dest.cc @@ -148,7 +148,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -169,7 +169,7 @@ class test_app_2 : public ten::app_t { "uri": "msgpack://127.0.0.1:8002/", "one_event_loop_per_engine": true, "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -189,7 +189,7 @@ class test_app_3 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8003/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_concurrent.cc b/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_concurrent.cc index e4b46ec356..67688b9d20 100644 --- a/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_concurrent.cc +++ b/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_concurrent.cc @@ -111,7 +111,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -131,7 +131,7 @@ class test_app_2 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8002/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_sequential.cc b/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_sequential.cc index 59dfa403d7..a6de591689 100644 --- a/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_sequential.cc +++ b/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_sequential.cc @@ -111,7 +111,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -131,7 +131,7 @@ class test_app_2 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8002/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/concurrent/one_engine_concurrent.cc b/tests/ten_runtime/smoke/extension_test/concurrent/one_engine_concurrent.cc index 30f16da0b1..578cd67df6 100644 --- a/tests/ten_runtime/smoke/extension_test/concurrent/one_engine_concurrent.cc +++ b/tests/ten_runtime/smoke/extension_test/concurrent/one_engine_concurrent.cc @@ -51,7 +51,7 @@ class test_app_a : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -71,7 +71,7 @@ class test_app_b : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8002/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/dest/specify_dest.cc b/tests/ten_runtime/smoke/extension_test/dest/specify_dest.cc index 14666a13e4..ec41188f46 100644 --- a/tests/ten_runtime/smoke/extension_test/dest/specify_dest.cc +++ b/tests/ten_runtime/smoke/extension_test/dest/specify_dest.cc @@ -186,7 +186,7 @@ class business_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": true, diff --git a/tests/ten_runtime/smoke/extension_test/engine/batch_send_msgs_in_migration.cc b/tests/ten_runtime/smoke/extension_test/engine/batch_send_msgs_in_migration.cc index 1f87caf904..2781e9e50f 100644 --- a/tests/ten_runtime/smoke/extension_test/engine/batch_send_msgs_in_migration.cc +++ b/tests/ten_runtime/smoke/extension_test/engine/batch_send_msgs_in_migration.cc @@ -65,7 +65,7 @@ class test_app : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "one_event_loop_per_engine": true, - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": true, diff --git a/tests/ten_runtime/smoke/extension_test/engine/engine_long_running_mode.cc b/tests/ten_runtime/smoke/extension_test/engine/engine_long_running_mode.cc index 79d2af3da5..0fdf3c296e 100644 --- a/tests/ten_runtime/smoke/extension_test/engine/engine_long_running_mode.cc +++ b/tests/ten_runtime/smoke/extension_test/engine/engine_long_running_mode.cc @@ -93,7 +93,7 @@ class test_app_a : public ten::app_t { "uri": "msgpack://127.0.0.1:8001/", "one_event_loop_per_engine": true, "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -126,7 +126,7 @@ class test_app_b : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8002/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/engine/engine_one_loop_per_engine.cc b/tests/ten_runtime/smoke/extension_test/engine/engine_one_loop_per_engine.cc index a8e738db88..ce572fff9f 100644 --- a/tests/ten_runtime/smoke/extension_test/engine/engine_one_loop_per_engine.cc +++ b/tests/ten_runtime/smoke/extension_test/engine/engine_one_loop_per_engine.cc @@ -60,7 +60,7 @@ class test_app : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "one_event_loop_per_engine": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/engine/extension_send_msg_to_incorrect_engine.cc b/tests/ten_runtime/smoke/extension_test/engine/extension_send_msg_to_incorrect_engine.cc index 0c90f93dbe..5024ce472d 100644 --- a/tests/ten_runtime/smoke/extension_test/engine/extension_send_msg_to_incorrect_engine.cc +++ b/tests/ten_runtime/smoke/extension_test/engine/extension_send_msg_to_incorrect_engine.cc @@ -80,7 +80,7 @@ class test_app : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "one_event_loop_per_engine": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/engine/wrong_engine_then_correct_in_migration.cc b/tests/ten_runtime/smoke/extension_test/engine/wrong_engine_then_correct_in_migration.cc index 885d4ee359..79821a2aa8 100644 --- a/tests/ten_runtime/smoke/extension_test/engine/wrong_engine_then_correct_in_migration.cc +++ b/tests/ten_runtime/smoke/extension_test/engine/wrong_engine_then_correct_in_migration.cc @@ -66,7 +66,7 @@ class test_app : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "one_event_loop_per_engine": true, - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": true, diff --git a/tests/ten_runtime/smoke/extension_test/error/failed_to_listen.cc b/tests/ten_runtime/smoke/extension_test/error/failed_to_listen.cc index 13f39dad35..42fa44e78c 100644 --- a/tests/ten_runtime/smoke/extension_test/error/failed_to_listen.cc +++ b/tests/ten_runtime/smoke/extension_test/error/failed_to_listen.cc @@ -22,7 +22,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "error://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/error/invalid_extension_group.cc b/tests/ten_runtime/smoke/extension_test/error/invalid_extension_group.cc index 8b422477d4..3886304342 100644 --- a/tests/ten_runtime/smoke/extension_test/error/invalid_extension_group.cc +++ b/tests/ten_runtime/smoke/extension_test/error/invalid_extension_group.cc @@ -22,7 +22,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension.cc b/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension.cc index a64d9e726b..d4a7ed3ec5 100644 --- a/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension.cc @@ -37,7 +37,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_and_create_group.cc b/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_and_create_group.cc index 79a4744e2e..2d20c38cbd 100644 --- a/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_and_create_group.cc +++ b/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_and_create_group.cc @@ -68,7 +68,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_group.cc b/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_group.cc index fc4885b80a..1e822c3336 100644 --- a/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_group.cc +++ b/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_group.cc @@ -59,7 +59,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/extension/extension_with_same_name.cc b/tests/ten_runtime/smoke/extension_test/extension/extension_with_same_name.cc index 94b3cdc06a..ef42a24d97 100644 --- a/tests/ten_runtime/smoke/extension_test/extension/extension_with_same_name.cc +++ b/tests/ten_runtime/smoke/extension_test/extension/extension_with_same_name.cc @@ -80,7 +80,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name.cc b/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name.cc index a65575231c..4c321baeaf 100644 --- a/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name.cc +++ b/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name.cc @@ -37,7 +37,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name_and_topo_info.cc b/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name_and_topo_info.cc index 6373da12b9..8494115655 100644 --- a/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name_and_topo_info.cc +++ b/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name_and_topo_info.cc @@ -37,7 +37,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_1.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_1.cc index 1b7f34d3c5..1f2b6727ea 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_1.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_1.cc @@ -75,7 +75,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_2.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_2.cc index 8423ad8fb3..867fb7af14 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_2.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_2.cc @@ -75,7 +75,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_3.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_3.cc index d2a26c371d..8c983084e5 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_3.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_3.cc @@ -75,7 +75,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_multi_app.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_multi_app.cc index 6dbca6506e..2c51371ea0 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_multi_app.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_multi_app.cc @@ -148,7 +148,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -169,7 +169,7 @@ class test_app_2 : public ten::app_t { "uri": "msgpack://127.0.0.1:8002/", "one_event_loop_per_engine": true, "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -189,7 +189,7 @@ class test_app_3 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8003/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_one_app.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_one_app.cc index 718d6cd5a1..ccdf3d867f 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_one_app.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_one_app.cc @@ -105,7 +105,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle.cc index bc5f4a23c3..bfbe1bab7a 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle.cc @@ -95,7 +95,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd.cc index 2ef927b4e4..512d58aa25 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd.cc @@ -95,7 +95,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd_with_default.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd_with_default.cc index edecb62d97..5d62ee7a0b 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd_with_default.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd_with_default.cc @@ -91,7 +91,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon.cc index 6065fbd212..700379857b 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon.cc @@ -188,7 +188,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -208,7 +208,7 @@ class test_app_2 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8002/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -228,7 +228,7 @@ class test_app_3 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8003/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon_one_app.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon_one_app.cc index 5fd3ef6953..72bcd4be2d 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon_one_app.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon_one_app.cc @@ -139,7 +139,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_1.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_1.cc index 47e68ab792..7cd6627717 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_1.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_1.cc @@ -46,7 +46,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_2.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_2.cc index 5dbbc9dd7d..f3c2f77141 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_2.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_2.cc @@ -46,7 +46,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all.cc index d7ae802bde..7189745444 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all.cc @@ -114,7 +114,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_multi_app.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_multi_app.cc index 19f3a71485..28330926dc 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_multi_app.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_multi_app.cc @@ -147,7 +147,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -168,7 +168,7 @@ class test_app_2 : public ten::app_t { "uri": "msgpack://127.0.0.1:8002/", "one_event_loop_per_engine": true, "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -188,7 +188,7 @@ class test_app_3 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8003/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_one_app.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_one_app.cc index cbd0dc0dc8..3dca7e678b 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_one_app.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_one_app.cc @@ -104,7 +104,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/graph_name/graph_name_basic.cc b/tests/ten_runtime/smoke/extension_test/graph_name/graph_name_basic.cc index 041af8785c..96a5b2053b 100644 --- a/tests/ten_runtime/smoke/extension_test/graph_name/graph_name_basic.cc +++ b/tests/ten_runtime/smoke/extension_test/graph_name/graph_name_basic.cc @@ -8,9 +8,9 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" -#include "ten_utils/log/log.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/common/constant.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -102,7 +102,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -122,7 +122,7 @@ class test_app_2 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8002/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_close_app.cc b/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_close_app.cc index 3d6fa1d0c7..37538a4c54 100644 --- a/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_close_app.cc +++ b/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_close_app.cc @@ -55,7 +55,7 @@ class test_app : public ten::app_t { // clang-format off R"({ "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": true, diff --git a/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_two_extensions.cc b/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_two_extensions.cc index 2dd745dafc..d260caaafe 100644 --- a/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_two_extensions.cc +++ b/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_two_extensions.cc @@ -54,7 +54,7 @@ class test_app : public ten::app_t { // clang-format off R"({ "_ten": { - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": true, diff --git a/tests/ten_runtime/smoke/extension_test/lock/lock_data_1.cc b/tests/ten_runtime/smoke/extension_test/lock/lock_data_1.cc index 5b65d5ad5c..dad02e2e46 100644 --- a/tests/ten_runtime/smoke/extension_test/lock/lock_data_1.cc +++ b/tests/ten_runtime/smoke/extension_test/lock/lock_data_1.cc @@ -9,8 +9,8 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -130,7 +130,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_c_string.cc b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_c_string.cc index 1482890d34..2f6fbcc8ee 100644 --- a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_c_string.cc +++ b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_c_string.cc @@ -70,7 +70,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_ptr.cc b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_ptr.cc index 3034d9c638..65850b3e89 100644 --- a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_ptr.cc +++ b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_ptr.cc @@ -95,7 +95,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_string.cc b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_string.cc index 8aca911ffc..93ffd7c6ee 100644 --- a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_string.cc +++ b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_string.cc @@ -68,7 +68,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_float_ptr.cc b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_float_ptr.cc index 9788786fdf..758d3fe674 100644 --- a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_float_ptr.cc +++ b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_float_ptr.cc @@ -77,7 +77,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int.cc b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int.cc index eefa342dc0..147a02e977 100644 --- a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int.cc +++ b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int.cc @@ -69,7 +69,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int32_ptr.cc b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int32_ptr.cc index f5e4da9e35..2130ca38e6 100644 --- a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int32_ptr.cc +++ b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int32_ptr.cc @@ -77,7 +77,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_basic.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_basic.cc index 91a96727dc..196a1ed0b3 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_basic.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_basic.cc @@ -66,7 +66,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_one_app.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_one_app.cc index 8e512c43c1..3f7dd6e5d0 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_one_app.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_one_app.cc @@ -198,7 +198,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all.cc index 4e8afa2dd2..e624313618 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all.cc @@ -67,7 +67,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all_in_multi_app.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all_in_multi_app.cc index fba004bef5..c5b811fc47 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all_in_multi_app.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all_in_multi_app.cc @@ -69,7 +69,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -89,7 +89,7 @@ class test_app_2 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8002/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -109,7 +109,7 @@ class test_app_3 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8003/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_send_in_stop_period.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_send_in_stop_period.cc index b8eade1a74..871cadb9e6 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_send_in_stop_period.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_send_in_stop_period.cc @@ -73,7 +73,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_y_topo.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_y_topo.cc index 7f698cb498..b88aa57fc2 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_y_topo.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_y_topo.cc @@ -102,7 +102,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/128_threads_attempt_to_suspend_1.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/128_threads_attempt_to_suspend_1.cc index 7d3073b249..e5512b00dd 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/128_threads_attempt_to_suspend_1.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/128_threads_attempt_to_suspend_1.cc @@ -12,22 +12,22 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" #if defined(__i386__) - #define OUTER_THREAD_FOR_LOOP_CNT 100 - #define FROM_EXTENSION_2_CMD_CNT 500 - #define OUTER_THREAD_CNT 16 +#define OUTER_THREAD_FOR_LOOP_CNT 100 +#define FROM_EXTENSION_2_CMD_CNT 500 +#define OUTER_THREAD_CNT 16 #else - #define OUTER_THREAD_FOR_LOOP_CNT 100 - #define FROM_EXTENSION_2_CMD_CNT 500 - #define OUTER_THREAD_CNT 128 +#define OUTER_THREAD_FOR_LOOP_CNT 100 +#define FROM_EXTENSION_2_CMD_CNT 500 +#define OUTER_THREAD_CNT 128 #endif namespace { @@ -983,7 +983,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/16_threads_attempt_to_suspend_1.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/16_threads_attempt_to_suspend_1.cc index 388292512d..2458352bd9 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/16_threads_attempt_to_suspend_1.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/16_threads_attempt_to_suspend_1.cc @@ -12,10 +12,10 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -262,7 +262,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_1.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_1.cc index 63a4c9f9ed..3a81569b68 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_1.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_1.cc @@ -11,10 +11,10 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -182,7 +182,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_2.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_2.cc index a4f77033fe..1f092e3786 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_2.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_2.cc @@ -11,10 +11,10 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -184,7 +184,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_3.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_3.cc index 3024e1a39a..025cd418e7 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_3.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_3.cc @@ -12,10 +12,10 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -207,7 +207,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_4.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_4.cc index 2e3f114363..c26d963426 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_4.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_4.cc @@ -12,10 +12,10 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -217,7 +217,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_5.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_5.cc index 558c009aaa..f13ebfa68d 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_5.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_5.cc @@ -12,10 +12,10 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -222,7 +222,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_6.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_6.cc index dc890ac0f8..59a31bfb97 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_6.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_6.cc @@ -11,10 +11,10 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -183,7 +183,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_7.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_7.cc index f77ad7d629..0d783dfcb4 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_7.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_7.cc @@ -11,10 +11,10 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -183,7 +183,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_1.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_1.cc index 7c09a9b8ee..b3c8dad4fd 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_1.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_1.cc @@ -12,10 +12,10 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -342,7 +342,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_2.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_2.cc index 1250b5f270..0dde6da4f2 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_2.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_2.cc @@ -12,11 +12,11 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -349,7 +349,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_3.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_3.cc index 796bda37bc..9cacf8eaeb 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_3.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_3.cc @@ -12,11 +12,11 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -344,7 +344,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_4.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_4.cc index 70c4f4b969..a472589e4d 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_4.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_4.cc @@ -12,11 +12,11 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -354,7 +354,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc index a541a9e2d9..517431e1e5 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc @@ -12,12 +12,12 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -439,7 +439,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_6.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_6.cc index 3bf443707e..9aec13ba70 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_6.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_6.cc @@ -12,11 +12,11 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -457,7 +457,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/auto_free_out_of_scope.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/auto_free_out_of_scope.cc index ce97f7a771..19bb2bfb19 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/auto_free_out_of_scope.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/auto_free_out_of_scope.cc @@ -13,11 +13,11 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_runtime/common/status_code.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -169,7 +169,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data.cc index db8114e7b7..b4949c7c3f 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data.cc @@ -11,11 +11,11 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -135,7 +135,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data_resp_handler.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data_resp_handler.cc index ab0e437307..4b2ccf6944 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data_resp_handler.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data_resp_handler.cc @@ -12,11 +12,11 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -160,7 +160,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/path/clean_when_stopped.cc b/tests/ten_runtime/smoke/extension_test/path/clean_when_stopped.cc index 3d2a58975f..3a25abf816 100644 --- a/tests/ten_runtime/smoke/extension_test/path/clean_when_stopped.cc +++ b/tests/ten_runtime/smoke/extension_test/path/clean_when_stopped.cc @@ -65,7 +65,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/path/path_timeout.cc b/tests/ten_runtime/smoke/extension_test/path/path_timeout.cc index 7d8c23ddc7..78bc077159 100644 --- a/tests/ten_runtime/smoke/extension_test/path/path_timeout.cc +++ b/tests/ten_runtime/smoke/extension_test/path/path_timeout.cc @@ -77,7 +77,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/path/path_timeout_2.cc b/tests/ten_runtime/smoke/extension_test/path/path_timeout_2.cc index 0e9243759d..eecbc482ce 100644 --- a/tests/ten_runtime/smoke/extension_test/path/path_timeout_2.cc +++ b/tests/ten_runtime/smoke/extension_test/path/path_timeout_2.cc @@ -80,7 +80,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_1.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_1.cc index a3da9c6832..a79e024e12 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_1.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_1.cc @@ -66,7 +66,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": true, diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_2.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_2.cc index 037759eab3..9416e06b48 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_2.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_2.cc @@ -177,7 +177,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_app.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_app.cc index deacf16fc5..d8d97b3172 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_app.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_app.cc @@ -66,7 +66,7 @@ class test_app_1 : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_1.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_1.cc index 351af85795..63d4249711 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_1.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_1.cc @@ -87,7 +87,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_2.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_2.cc index 58a5f3b609..98457dde97 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_2.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_2.cc @@ -87,7 +87,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": true, diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_3.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_3.cc index 1883d4a094..a74870ed03 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_3.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_3.cc @@ -64,7 +64,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_4.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_4.cc index ac438117c0..c352e1ce26 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_4.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_4.cc @@ -106,7 +106,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_no_auto_start.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_no_auto_start.cc index 6262d572fa..e31e0db6a3 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_no_auto_start.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_no_auto_start.cc @@ -68,7 +68,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_1.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_1.cc index 84cbb57c32..6f49583a7c 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_1.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_1.cc @@ -43,7 +43,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_2.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_2.cc index 75eecd95b5..46ed47ac2b 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_2.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_2.cc @@ -43,7 +43,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": true, diff --git a/tests/ten_runtime/smoke/extension_test/prepare_to_stop/different_thread.cc b/tests/ten_runtime/smoke/extension_test/prepare_to_stop/different_thread.cc index 145d2f4f1f..146ed6a0f9 100644 --- a/tests/ten_runtime/smoke/extension_test/prepare_to_stop/different_thread.cc +++ b/tests/ten_runtime/smoke/extension_test/prepare_to_stop/different_thread.cc @@ -73,7 +73,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/prepare_to_stop/same_thread.cc b/tests/ten_runtime/smoke/extension_test/prepare_to_stop/same_thread.cc index 4e5b09564e..5efc87a477 100644 --- a/tests/ten_runtime/smoke/extension_test/prepare_to_stop/same_thread.cc +++ b/tests/ten_runtime/smoke/extension_test/prepare_to_stop/same_thread.cc @@ -96,7 +96,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/property/property_access_app_store.cc b/tests/ten_runtime/smoke/extension_test/property/property_access_app_store.cc index 15d878fd78..9c74496c75 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_access_app_store.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_access_app_store.cc @@ -59,7 +59,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, @@ -116,7 +116,7 @@ TEST(ExtensionTest, PropertyAccessAppStore) { // NOLINT auto *client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8001/"); // Send a request to test_property_access_app_store_1 to make sure - // it has been inited. + // it has been initted. nlohmann::json resp = client->send_json_and_recv_resp_in_json(R"({ "_ten": { "name": "test", diff --git a/tests/ten_runtime/smoke/extension_test/property/property_access_app_store_async.cc b/tests/ten_runtime/smoke/extension_test/property/property_access_app_store_async.cc index 4d40f55ce5..cad167e57a 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_access_app_store_async.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_access_app_store_async.cc @@ -58,7 +58,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/extension_test/property/property_in_graph_use_env_1.cc b/tests/ten_runtime/smoke/extension_test/property/property_in_graph_use_env_1.cc index 1848074397..230ebf9ea7 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_in_graph_use_env_1.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_in_graph_use_env_1.cc @@ -55,7 +55,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": true, diff --git a/tests/ten_runtime/smoke/extension_test/property/property_in_graph_use_env_2.cc b/tests/ten_runtime/smoke/extension_test/property/property_in_graph_use_env_2.cc index 57764dd00e..dc87304afc 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_in_graph_use_env_2.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_in_graph_use_env_2.cc @@ -55,7 +55,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": true, diff --git a/tests/ten_runtime/smoke/extension_test/property/property_not_exist.cc b/tests/ten_runtime/smoke/extension_test/property/property_not_exist.cc index 82acf7c429..8537abe4d9 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_not_exist.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_not_exist.cc @@ -66,7 +66,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/property/property_prebuilt_graph.cc b/tests/ten_runtime/smoke/extension_test/property/property_prebuilt_graph.cc index 66295726c7..5c5725a506 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_prebuilt_graph.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_prebuilt_graph.cc @@ -55,7 +55,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": true, diff --git a/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_async_basic.cc b/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_async_basic.cc index 70b3dbee1a..dacae0b8ba 100644 --- a/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_async_basic.cc +++ b/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_async_basic.cc @@ -147,7 +147,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic.cc b/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic.cc index 6970c6766b..f72327ea6a 100644 --- a/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic.cc +++ b/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic.cc @@ -154,7 +154,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic_wait_in_on_start.cc b/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic_wait_in_on_start.cc index dce77c7783..9ff0d952f9 100644 --- a/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic_wait_in_on_start.cc +++ b/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic_wait_in_on_start.cc @@ -160,7 +160,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/return/return_1.cc b/tests/ten_runtime/smoke/extension_test/return/return_1.cc index 40bea7e526..2e2fcd8d83 100644 --- a/tests/ten_runtime/smoke/extension_test/return/return_1.cc +++ b/tests/ten_runtime/smoke/extension_test/return/return_1.cc @@ -74,7 +74,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/return/return_2.cc b/tests/ten_runtime/smoke/extension_test/return/return_2.cc index edd3d9c42a..17528c7da2 100644 --- a/tests/ten_runtime/smoke/extension_test/return/return_2.cc +++ b/tests/ten_runtime/smoke/extension_test/return/return_2.cc @@ -74,7 +74,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/return/return_3.cc b/tests/ten_runtime/smoke/extension_test/return/return_3.cc index 90c5efe482..b105fb84fa 100644 --- a/tests/ten_runtime/smoke/extension_test/return/return_3.cc +++ b/tests/ten_runtime/smoke/extension_test/return/return_3.cc @@ -102,7 +102,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/return/return_4.cc b/tests/ten_runtime/smoke/extension_test/return/return_4.cc index eb1b8de00f..3b9943d7e6 100644 --- a/tests/ten_runtime/smoke/extension_test/return/return_4.cc +++ b/tests/ten_runtime/smoke/extension_test/return/return_4.cc @@ -102,7 +102,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_data.cc b/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_data.cc index 0c05d8e332..53b7f86a51 100644 --- a/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_data.cc +++ b/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_data.cc @@ -75,7 +75,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_xxx_basic.cc b/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_xxx_basic.cc index d653118730..b66c2351b9 100644 --- a/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_xxx_basic.cc +++ b/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_xxx_basic.cc @@ -83,7 +83,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_and_communicate.cc b/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_and_communicate.cc index ac9627e57c..7964130f1f 100644 --- a/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_and_communicate.cc +++ b/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_and_communicate.cc @@ -175,7 +175,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_from_extension.cc b/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_from_extension.cc index cd615d25fd..3df6572686 100644 --- a/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_from_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_from_extension.cc @@ -144,7 +144,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_1.cc b/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_1.cc index a7390ee420..9f28222cdb 100644 --- a/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_1.cc +++ b/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_1.cc @@ -11,11 +11,11 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -147,7 +147,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_2.cc b/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_2.cc index 81d462535f..b446a73f89 100644 --- a/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_2.cc +++ b/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_2.cc @@ -11,11 +11,11 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -155,7 +155,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/ten_proxy/ten_proxy_1.cc b/tests/ten_runtime/smoke/extension_test/ten_proxy/ten_proxy_1.cc index 4b54c5a684..5d1c3c7d23 100644 --- a/tests/ten_runtime/smoke/extension_test/ten_proxy/ten_proxy_1.cc +++ b/tests/ten_runtime/smoke/extension_test/ten_proxy/ten_proxy_1.cc @@ -102,7 +102,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/timer/timer_one_shot.cc b/tests/ten_runtime/smoke/extension_test/timer/timer_one_shot.cc index 5c23dcdda1..47d384d6ec 100644 --- a/tests/ten_runtime/smoke/extension_test/timer/timer_one_shot.cc +++ b/tests/ten_runtime/smoke/extension_test/timer/timer_one_shot.cc @@ -84,7 +84,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/timer/timer_ten_shot.cc b/tests/ten_runtime/smoke/extension_test/timer/timer_ten_shot.cc index 2be4e9ba83..cede053f90 100644 --- a/tests/ten_runtime/smoke/extension_test/timer/timer_ten_shot.cc +++ b/tests/ten_runtime/smoke/extension_test/timer/timer_ten_shot.cc @@ -88,7 +88,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/extension_test/timer/timer_two_shot.cc b/tests/ten_runtime/smoke/extension_test/timer/timer_two_shot.cc index 83cead2072..3c604b0bfb 100644 --- a/tests/ten_runtime/smoke/extension_test/timer/timer_two_shot.cc +++ b/tests/ten_runtime/smoke/extension_test/timer/timer_two_shot.cc @@ -87,7 +87,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/graph_test/group_node_missing.cc b/tests/ten_runtime/smoke/graph_test/group_node_missing.cc index 47f2cbaba6..4f0b8a6fc4 100644 --- a/tests/ten_runtime/smoke/graph_test/group_node_missing.cc +++ b/tests/ten_runtime/smoke/graph_test/group_node_missing.cc @@ -36,7 +36,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/graph_test/group_node_missing_2_apps.cc b/tests/ten_runtime/smoke/graph_test/group_node_missing_2_apps.cc index 1b8e8fe3ca..c084a6ffef 100644 --- a/tests/ten_runtime/smoke/graph_test/group_node_missing_2_apps.cc +++ b/tests/ten_runtime/smoke/graph_test/group_node_missing_2_apps.cc @@ -69,7 +69,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on @@ -89,7 +89,7 @@ class test_app_2 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8002/", "long_running_mode": true, - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/interface_test/interface_out_cmd_in_schema.cc b/tests/ten_runtime/smoke/interface_test/interface_out_cmd_in_schema.cc index 8377877fe4..072a8b5a48 100644 --- a/tests/ten_runtime/smoke/interface_test/interface_out_cmd_in_schema.cc +++ b/tests/ten_runtime/smoke/interface_test/interface_out_cmd_in_schema.cc @@ -81,7 +81,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/interface_test/interface_out_cmd_not_in_schema.cc b/tests/ten_runtime/smoke/interface_test/interface_out_cmd_not_in_schema.cc index 40852f4b82..1d69063fc2 100644 --- a/tests/ten_runtime/smoke/interface_test/interface_out_cmd_not_in_schema.cc +++ b/tests/ten_runtime/smoke/interface_test/interface_out_cmd_not_in_schema.cc @@ -81,7 +81,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/interface_test/interface_out_result_error.cc b/tests/ten_runtime/smoke/interface_test/interface_out_result_error.cc index 5741ff80ff..905454a6d1 100644 --- a/tests/ten_runtime/smoke/interface_test/interface_out_result_error.cc +++ b/tests/ten_runtime/smoke/interface_test/interface_out_result_error.cc @@ -123,7 +123,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/msg_test/msg_1.cc b/tests/ten_runtime/smoke/msg_test/msg_1.cc index 41b844b40c..fd99120b72 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_1.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_1.cc @@ -84,7 +84,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/msg_test/msg_10.cc b/tests/ten_runtime/smoke/msg_test/msg_10.cc index c626a33d6a..7add4f9892 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_10.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_10.cc @@ -97,7 +97,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/msg_test/msg_11.cc b/tests/ten_runtime/smoke/msg_test/msg_11.cc index c93f0d1589..ba32814e59 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_11.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_11.cc @@ -84,7 +84,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })"); ten_env.on_init_done(); diff --git a/tests/ten_runtime/smoke/msg_test/msg_12.cc b/tests/ten_runtime/smoke/msg_test/msg_12.cc index 919f2c988f..7a50eff3f8 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_12.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_12.cc @@ -105,7 +105,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/msg_test/msg_13.cc b/tests/ten_runtime/smoke/msg_test/msg_13.cc index 331e990ded..932d41d3a1 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_13.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_13.cc @@ -104,7 +104,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/msg_test/msg_2.cc b/tests/ten_runtime/smoke/msg_test/msg_2.cc index 84b6e59a3a..e0d3e76976 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_2.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_2.cc @@ -84,7 +84,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })"); ten_env.on_init_done(); diff --git a/tests/ten_runtime/smoke/msg_test/msg_3.cc b/tests/ten_runtime/smoke/msg_test/msg_3.cc index 08f923b68e..d9a01114aa 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_3.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_3.cc @@ -76,7 +76,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })"); ten_env.on_init_done(); diff --git a/tests/ten_runtime/smoke/msg_test/msg_4.cc b/tests/ten_runtime/smoke/msg_test/msg_4.cc index 659a7c266f..b8b6143714 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_4.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_4.cc @@ -84,7 +84,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })"); ten_env.on_init_done(); diff --git a/tests/ten_runtime/smoke/msg_test/msg_5.cc b/tests/ten_runtime/smoke/msg_test/msg_5.cc index 504cf009f4..89d67e568a 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_5.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_5.cc @@ -86,7 +86,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })"); ten_env.on_init_done(); diff --git a/tests/ten_runtime/smoke/msg_test/msg_6.cc b/tests/ten_runtime/smoke/msg_test/msg_6.cc index be35ca0819..8f0c5bc83e 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_6.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_6.cc @@ -84,7 +84,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })"); ten_env.on_init_done(); diff --git a/tests/ten_runtime/smoke/msg_test/msg_7.cc b/tests/ten_runtime/smoke/msg_test/msg_7.cc index 7f410f9f61..647300b304 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_7.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_7.cc @@ -83,7 +83,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })"); ten_env.on_init_done(); diff --git a/tests/ten_runtime/smoke/msg_test/msg_8.cc b/tests/ten_runtime/smoke/msg_test/msg_8.cc index 8e81dc3c99..054fb256fd 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_8.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_8.cc @@ -69,7 +69,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/msg_test/msg_9.cc b/tests/ten_runtime/smoke/msg_test/msg_9.cc index 8847e37ee4..072bc68a1c 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_9.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_9.cc @@ -106,7 +106,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/msg_test/msg_fail_1.cc b/tests/ten_runtime/smoke/msg_test/msg_fail_1.cc index 98128f4b2f..5dddcab6be 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_fail_1.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_fail_1.cc @@ -102,7 +102,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })"); ten_env.on_init_done(); diff --git a/tests/ten_runtime/smoke/msg_test/msg_fail_2.cc b/tests/ten_runtime/smoke/msg_test/msg_fail_2.cc index 1853cb8693..4c982095d8 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_fail_2.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_fail_2.cc @@ -100,7 +100,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })"); ten_env.on_init_done(); diff --git a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_1.cc b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_1.cc index ebebd53398..5a551a27cb 100644 --- a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_1.cc +++ b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_1.cc @@ -86,7 +86,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_2.cc b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_2.cc index b3a94c3d9b..79102fe1f8 100644 --- a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_2.cc +++ b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_2.cc @@ -94,7 +94,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_3.cc b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_3.cc index c849d7315c..f8828fea85 100644 --- a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_3.cc +++ b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_3.cc @@ -96,7 +96,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/notify_test/normal_func.cc b/tests/ten_runtime/smoke/notify_test/normal_func.cc index 52d95cd87c..4cc309d97d 100644 --- a/tests/ten_runtime/smoke/notify_test/normal_func.cc +++ b/tests/ten_runtime/smoke/notify_test/normal_func.cc @@ -88,7 +88,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/notify_test/normal_func_in_lambda.cc b/tests/ten_runtime/smoke/notify_test/normal_func_in_lambda.cc index f996e1afb7..9c679891e6 100644 --- a/tests/ten_runtime/smoke/notify_test/normal_func_in_lambda.cc +++ b/tests/ten_runtime/smoke/notify_test/normal_func_in_lambda.cc @@ -92,7 +92,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/notify_test/normal_func_with_user_data.cc b/tests/ten_runtime/smoke/notify_test/normal_func_with_user_data.cc index c6d725e58e..8e790f0db3 100644 --- a/tests/ten_runtime/smoke/notify_test/normal_func_with_user_data.cc +++ b/tests/ten_runtime/smoke/notify_test/normal_func_with_user_data.cc @@ -96,7 +96,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/result_conversion/result_conversion_1.cc b/tests/ten_runtime/smoke/result_conversion/result_conversion_1.cc index b952c46201..60a5620b55 100644 --- a/tests/ten_runtime/smoke/result_conversion/result_conversion_1.cc +++ b/tests/ten_runtime/smoke/result_conversion/result_conversion_1.cc @@ -72,7 +72,7 @@ class test_app : public ten::app_t { R"###({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1, + "log_level": 2, "predefined_graphs": [{ "name": "0", "auto_start": false, diff --git a/tests/ten_runtime/smoke/schema_test/schema_cmd_property_required.cc b/tests/ten_runtime/smoke/schema_test/schema_cmd_property_required.cc index ebed0fc78e..e1e411c658 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_cmd_property_required.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_cmd_property_required.cc @@ -165,7 +165,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc b/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc index 3cea85fec5..a076d14bc1 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc @@ -110,7 +110,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/schema_test/schema_cmd_result_error.cc b/tests/ten_runtime/smoke/schema_test/schema_cmd_result_error.cc index 52c0cca8e7..ad4f90eb19 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_cmd_result_error.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_cmd_result_error.cc @@ -110,7 +110,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc b/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc index fb0292df79..422b72ebc0 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc @@ -145,7 +145,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc b/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc index 133e1ce51b..8f09a3c38e 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc @@ -99,7 +99,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc b/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc index cee9eaec74..1614070e7d 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc @@ -96,7 +96,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/schema_test/schema_set_extension_property.cc b/tests/ten_runtime/smoke/schema_test/schema_set_extension_property.cc index 86f1300db1..74ee0942d5 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_set_extension_property.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_set_extension_property.cc @@ -152,7 +152,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/schema_test/schema_set_property_buf.cc b/tests/ten_runtime/smoke/schema_test/schema_set_property_buf.cc index d67f909cb3..68991514b3 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_set_property_buf.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_set_property_buf.cc @@ -97,7 +97,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/schema_test/schema_set_property_ptr.cc b/tests/ten_runtime/smoke/schema_test/schema_set_property_ptr.cc index 56526a8159..e4d1b40a2c 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_set_property_ptr.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_set_property_ptr.cc @@ -99,7 +99,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/video_frame_test/basic.cc b/tests/ten_runtime/smoke/video_frame_test/basic.cc index 611744d702..49f8f2a7bc 100644 --- a/tests/ten_runtime/smoke/video_frame_test/basic.cc +++ b/tests/ten_runtime/smoke/video_frame_test/basic.cc @@ -57,7 +57,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/video_frame_test/create_from_json.cc b/tests/ten_runtime/smoke/video_frame_test/create_from_json.cc index e52c6370d7..90e7657de3 100644 --- a/tests/ten_runtime/smoke/video_frame_test/create_from_json.cc +++ b/tests/ten_runtime/smoke/video_frame_test/create_from_json.cc @@ -74,7 +74,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/video_frame_test/from_json.cc b/tests/ten_runtime/smoke/video_frame_test/from_json.cc index 146e2fa2c3..a838a7344c 100644 --- a/tests/ten_runtime/smoke/video_frame_test/from_json.cc +++ b/tests/ten_runtime/smoke/video_frame_test/from_json.cc @@ -73,7 +73,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_runtime/smoke/video_frame_test/multi_dest_video_frame.cc b/tests/ten_runtime/smoke/video_frame_test/multi_dest_video_frame.cc index aea5e0201c..f1bb03db9f 100644 --- a/tests/ten_runtime/smoke/video_frame_test/multi_dest_video_frame.cc +++ b/tests/ten_runtime/smoke/video_frame_test/multi_dest_video_frame.cc @@ -9,8 +9,8 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" +#include "include_internal/ten_utils/macro/check.h" #include "ten_utils/lib/thread.h" -#include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" @@ -132,7 +132,7 @@ class test_app : public ten::app_t { R"({ "_ten": { "uri": "msgpack://127.0.0.1:8001/", - "log_level": 1 + "log_level": 2 } })" // clang-format on diff --git a/tests/ten_utils/unit/ten_log_test.cc b/tests/ten_utils/unit/ten_log_test.cc index dec7aae1e0..1680277ecb 100644 --- a/tests/ten_utils/unit/ten_log_test.cc +++ b/tests/ten_utils/unit/ten_log_test.cc @@ -3,32 +3,19 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include - #include "gtest/gtest.h" -#include "ten_utils/lib/alloc.h" -#include "ten_utils/log/log.h" +#include "include_internal/ten_utils/log/level.h" +#include "include_internal/ten_utils/log/log.h" +#include "include_internal/ten_utils/log/output.h" TEST(LogTest, FileOutput1) { // NOLINT - ten_log_output_t save; - ten_log_output_init(&save, 0, nullptr, nullptr, nullptr); - - ten_log_save_output_spec(&save); - - ten_log_set_output_to_file("test1.log"); - - TEN_LOGE("test %s test", "hello"); - - ten_log_close(); - ten_log_restore_output_spec(&save); -} + ten_log_t log; + ten_log_init(&log); -TEST(LogTest, FileOutput2) { // NOLINT - ten_log_t *log = ten_log_create(); - ten_log_set_output_to_file_aux(log, "test2.log"); + ten_log_set_output_level(&log, TEN_LOG_LEVEL_ERROR); + ten_log_set_output_to_file(&log, "test1.log"); - TEN_LOGE_AUX(log, "test %s test", "hello"); + TEN_LOGE_AUX(&log, "test %s test", "hello"); - ten_log_close_aux(log); - ten_log_destroy(log); + ten_log_deinit(&log); } From f316d7f25564c98a06a4fad1c372caead1b18b86 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Mon, 16 Sep 2024 18:21:29 +0800 Subject: [PATCH 03/13] feat: new log mechanism --- core/src/ten_runtime/binding/python/native/addon/addon.c | 1 + core/src/ten_runtime/binding/python/native/addon/decorator.c | 1 + core/src/ten_runtime/binding/python/native/app/app.c | 1 + core/src/ten_runtime/binding/python/native/extension/extension.c | 1 + core/src/ten_runtime/binding/python/native/msg/audio_frame.c | 1 + core/src/ten_runtime/binding/python/native/msg/data.c | 1 + core/src/ten_runtime/binding/python/native/msg/msg.c | 1 + core/src/ten_runtime/binding/python/native/msg/video_frame.c | 1 + .../python/native/ten_env/ten_env_on_create_instance_done.c | 1 + .../binding/python/native/ten_env/ten_env_on_deinit_done.c | 1 + .../binding/python/native/ten_env/ten_env_on_start_done.c | 1 + .../binding/python/native/ten_env/ten_env_on_stop_done.c | 1 + .../ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c | 1 + .../binding/python/native/ten_env/ten_env_send_json.c | 1 + 14 files changed, 14 insertions(+) diff --git a/core/src/ten_runtime/binding/python/native/addon/addon.c b/core/src/ten_runtime/binding/python/native/addon/addon.c index 258d1c08f5..01ca204c78 100644 --- a/core/src/ten_runtime/binding/python/native/addon/addon.c +++ b/core/src/ten_runtime/binding/python/native/addon/addon.c @@ -20,6 +20,7 @@ #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/mark.h" static bool ten_py_addon_check_integrity(ten_py_addon_t *self) { TEN_ASSERT(self, "Should not happen."); diff --git a/core/src/ten_runtime/binding/python/native/addon/decorator.c b/core/src/ten_runtime/binding/python/native/addon/decorator.c index facf6cb412..c46699df92 100644 --- a/core/src/ten_runtime/binding/python/native/addon/decorator.c +++ b/core/src/ten_runtime/binding/python/native/addon/decorator.c @@ -11,6 +11,7 @@ #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/addon/extension_group/extension_group.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/mark.h" static PyObject *ten_py_decorator_register_addon_create( PyTypeObject *ty, PyObject *args, TEN_UNUSED PyObject *kwds) { diff --git a/core/src/ten_runtime/binding/python/native/app/app.c b/core/src/ten_runtime/binding/python/native/app/app.c index 8c2f6bc0bc..b04cdfd341 100644 --- a/core/src/ten_runtime/binding/python/native/app/app.c +++ b/core/src/ten_runtime/binding/python/native/app/app.c @@ -17,6 +17,7 @@ #include "ten_runtime/ten_env/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/signature.h" +#include "ten_utils/macro/mark.h" static bool ten_py_app_check_integrity(ten_py_app_t *self, bool check_thread) { TEN_ASSERT(self, "Should not happen."); diff --git a/core/src/ten_runtime/binding/python/native/extension/extension.c b/core/src/ten_runtime/binding/python/native/extension/extension.c index 012794c7f5..0f1fb4cf74 100644 --- a/core/src/ten_runtime/binding/python/native/extension/extension.c +++ b/core/src/ten_runtime/binding/python/native/extension/extension.c @@ -22,6 +22,7 @@ #include "ten_runtime/ten_env/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/smart_ptr.h" +#include "ten_utils/macro/mark.h" static bool ten_py_extension_check_integrity(ten_py_extension_t *self, bool check_thread) { diff --git a/core/src/ten_runtime/binding/python/native/msg/audio_frame.c b/core/src/ten_runtime/binding/python/native/msg/audio_frame.c index 8e274f703c..861f24b331 100644 --- a/core/src/ten_runtime/binding/python/native/msg/audio_frame.c +++ b/core/src/ten_runtime/binding/python/native/msg/audio_frame.c @@ -13,6 +13,7 @@ #include "object.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" +#include "ten_utils/macro/mark.h" static ten_py_audio_frame_t *ten_py_audio_frame_create_internal( PyTypeObject *py_type) { diff --git a/core/src/ten_runtime/binding/python/native/msg/data.c b/core/src/ten_runtime/binding/python/native/msg/data.c index 0ff9af17c8..69ba7b6124 100644 --- a/core/src/ten_runtime/binding/python/native/msg/data.c +++ b/core/src/ten_runtime/binding/python/native/msg/data.c @@ -13,6 +13,7 @@ #include "ten_runtime/msg/data/data.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/buf.h" +#include "ten_utils/macro/mark.h" static ten_py_data_t *ten_py_data_create_internal(PyTypeObject *py_type) { if (!py_type) { diff --git a/core/src/ten_runtime/binding/python/native/msg/msg.c b/core/src/ten_runtime/binding/python/native/msg/msg.c index d71fd201ba..df4670737f 100644 --- a/core/src/ten_runtime/binding/python/native/msg/msg.c +++ b/core/src/ten_runtime/binding/python/native/msg/msg.c @@ -12,6 +12,7 @@ #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" diff --git a/core/src/ten_runtime/binding/python/native/msg/video_frame.c b/core/src/ten_runtime/binding/python/native/msg/video_frame.c index 158eb6e60a..c14ccb6d13 100644 --- a/core/src/ten_runtime/binding/python/native/msg/video_frame.c +++ b/core/src/ten_runtime/binding/python/native/msg/video_frame.c @@ -11,6 +11,7 @@ #include "include_internal/ten_utils/macro/check.h" #include "memoryobject.h" #include "ten_runtime/msg/video_frame/video_frame.h" +#include "ten_utils/macro/mark.h" static ten_py_video_frame_t *ten_py_video_frame_create_internal( PyTypeObject *py_type) { diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_create_instance_done.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_create_instance_done.c index 10e22410ae..935edb05d1 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_create_instance_done.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_create_instance_done.c @@ -10,6 +10,7 @@ #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" #include "object.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" +#include "ten_utils/macro/mark.h" PyObject *ten_py_ten_env_on_create_instance_done(PyObject *self, TEN_UNUSED PyObject *args) { diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_deinit_done.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_deinit_done.c index debd7cecc5..4b59371057 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_deinit_done.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_deinit_done.c @@ -11,6 +11,7 @@ #include "ten_runtime/binding/python/common.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" +#include "ten_utils/macro/mark.h" static void ten_env_notify_on_deinit_done(ten_env_t *ten_env, void *user_data) { TEN_ASSERT( diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_start_done.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_start_done.c index 70026b11ee..a633a395ef 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_start_done.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_start_done.c @@ -9,6 +9,7 @@ #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" +#include "ten_utils/macro/mark.h" static void ten_env_notify_on_start_done(ten_env_t *ten_env, TEN_UNUSED void *user_data) { diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_stop_done.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_stop_done.c index bd701f9629..1bbec3c1d0 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_stop_done.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_stop_done.c @@ -9,6 +9,7 @@ #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "ten_runtime/msg/msg.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" +#include "ten_utils/macro/mark.h" static void ten_env_notify_on_stop_done(ten_env_t *ten_env, TEN_UNUSED void *user_data) { diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c index ccdb9f8ae1..e4a65ed530 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c @@ -14,6 +14,7 @@ #include "ten_runtime/extension/extension.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" typedef struct ten_env_notify_send_cmd_info_t { diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_json.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_json.c index eb9d515901..346ed98db9 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_json.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_json.c @@ -12,6 +12,7 @@ #include "ten_runtime/extension/extension.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/lib/json.h" +#include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" typedef struct ten_env_notify_send_json_info_t { From a5131cfe410bada63e5f8105d6d7c1af19415c6f Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Mon, 16 Sep 2024 18:51:00 +0800 Subject: [PATCH 04/13] feat: new log mechanism --- .../ten_runtime/binding/cpp/internal/app.h | 3 +- .../binding/cpp/internal/extension.h | 3 +- .../binding/cpp/internal/extension_group.h | 2 +- .../binding/cpp/internal/msg/cmd/cmd.h | 2 +- .../binding/cpp/internal/msg/msg.h | 2 +- .../binding/cpp/internal/ten_env.h | 2 +- core/include/ten_utils/backtrace/backtrace.h | 24 +++ core/include/ten_utils/lang/cpp/lib/value.h | 2 +- core/include/ten_utils/lib/mutex.h | 2 +- core/include/ten_utils/lib/string.h | 2 +- core/include/ten_utils/lib/typed_list_node.h | 2 +- core/include/ten_utils/log/log.h | 146 ++++++++++++++++++ .../ten_utils/macro/check.h | 4 +- core/include_internal/ten_runtime/msg/msg.h | 2 +- .../ten_runtime/ten_env/ten_env.h | 2 +- .../ten_utils/backtrace/backtrace.h | 2 - core/include_internal/ten_utils/log/log.h | 129 +--------------- .../ten_utils/schema/keywords/keywords_info.h | 2 +- .../ten_utils/value/type_info.h | 7 +- core/src/ten_runtime/addon/addon.c | 2 +- core/src/ten_runtime/addon/common/store.c | 2 +- .../ten_runtime/addon/extension/extension.c | 2 +- .../addon/extension_group/extension_group.c | 2 +- .../src/ten_runtime/addon/protocol/protocol.c | 2 +- core/src/ten_runtime/addon/ten_env/on_xxx.c | 2 +- core/src/ten_runtime/app/app.c | 2 +- core/src/ten_runtime/app/base_dir.c | 2 +- core/src/ten_runtime/app/close.c | 2 +- core/src/ten_runtime/app/endpoint.c | 2 +- core/src/ten_runtime/app/engine_interface.c | 2 +- core/src/ten_runtime/app/internal.c | 2 +- core/src/ten_runtime/app/metadata.c | 2 +- core/src/ten_runtime/app/migration.c | 2 +- .../ten_runtime/app/msg_interface/common.c | 2 +- .../app/msg_interface/start_graph.c | 2 +- core/src/ten_runtime/app/predefined_graph.c | 2 +- core/src/ten_runtime/app/ten_env/metadata.c | 2 +- core/src/ten_runtime/app/ten_env/on_xxx.c | 2 +- core/src/ten_runtime/binding/common.c | 2 +- .../binding/go/native/addon/addon.c | 2 +- .../binding/go/native/extension/extension.c | 2 +- .../native/extension_group/extension_group.c | 2 +- .../binding/go/native/internal/common.c | 2 +- .../binding/go/native/internal/json.c | 2 +- .../go/native/msg/audio_frame/audio_frame.c | 2 +- .../binding/go/native/msg/cmd/cmd.c | 2 +- .../binding/go/native/msg/data/data.c | 2 +- .../ten_runtime/binding/go/native/msg/msg.c | 2 +- .../go/native/msg/video_frame/video_frame.c | 2 +- .../binding/go/native/ten_env/ten_env.c | 2 +- .../ten_env/ten_env_addon_create_extension.c | 2 +- .../ten_env/ten_env_addon_destroy_extension.c | 2 +- .../ten_env/ten_env_create_instance_done.c | 2 +- .../go/native/ten_env/ten_env_get_property.c | 2 +- .../ten_env/ten_env_get_property_async.c | 2 +- .../go/native/ten_env/ten_env_init_property.c | 2 +- .../go/native/ten_env/ten_env_internal.c | 2 +- .../native/ten_env/ten_env_is_cmd_connected.c | 2 +- .../binding/go/native/ten_env/ten_env_log.c | 2 +- .../ten_env_on_create_extension_done.c | 2 +- .../native/ten_env/ten_env_on_deinit_done.c | 2 +- .../ten_env_on_delete_extension_done.c | 2 +- .../go/native/ten_env/ten_env_on_init_done.c | 2 +- .../go/native/ten_env/ten_env_on_start_done.c | 2 +- .../go/native/ten_env/ten_env_on_stop_done.c | 2 +- .../go/native/ten_env/ten_env_return_result.c | 2 +- .../go/native/ten_env/ten_env_return_value.c | 2 +- .../native/ten_env/ten_env_send_audio_frame.c | 2 +- .../go/native/ten_env/ten_env_send_cmd.c | 2 +- .../go/native/ten_env/ten_env_send_data.c | 2 +- .../go/native/ten_env/ten_env_send_json.c | 2 +- .../native/ten_env/ten_env_send_video_frame.c | 2 +- .../go/native/ten_env/ten_env_set_property.c | 2 +- .../ten_env/ten_env_set_property_async.c | 2 +- .../binding/go/native/value/value.c | 2 +- .../binding/python/native/common/common.c | 2 +- .../binding/python/native/msg/audio_frame.c | 2 +- .../binding/python/native/msg/data.c | 2 +- .../binding/python/native/msg/video_frame.c | 2 +- .../binding/python/native/ten_env/ten_env.c | 2 +- .../native/ten_env/ten_env_get_property.c | 2 +- .../python/native/ten_env/ten_env_log.c | 2 +- .../native/ten_env/ten_env_on_init_done.c | 2 +- .../python/native/ten_env/ten_env_send_cmd.c | 2 +- core/src/ten_runtime/common/binding.c | 2 +- core/src/ten_runtime/common/closeable.c | 2 +- core/src/ten_runtime/common/loc.c | 2 +- core/src/ten_runtime/connection/connection.c | 2 +- core/src/ten_runtime/connection/migration.c | 2 +- core/src/ten_runtime/engine/engine.c | 2 +- core/src/ten_runtime/engine/internal/close.c | 2 +- .../engine/internal/extension_interface.c | 2 +- .../ten_runtime/engine/internal/migration.c | 2 +- .../engine/internal/remote_interface.c | 2 +- core/src/ten_runtime/engine/internal/thread.c | 2 +- .../engine/msg_interface/close_app.c | 2 +- .../engine/msg_interface/close_engine.c | 2 +- .../engine/msg_interface/cmd_result.c | 2 +- .../ten_runtime/engine/msg_interface/common.c | 2 +- .../engine/msg_interface/start_graph.c | 2 +- .../ten_runtime/engine/msg_interface/timer.c | 2 +- core/src/ten_runtime/engine/on_xxx.c | 2 +- core/src/ten_runtime/extension/extension.c | 2 +- .../src/ten_runtime/extension/extension_hdr.c | 2 +- .../extension/extension_info/extension_info.c | 2 +- .../extension/extension_info/json.c | 2 +- .../extension/extension_info/value.c | 2 +- .../extension/internal/extension_cb_default.c | 2 +- .../ten_runtime/extension/internal/metadata.c | 2 +- .../msg_dest_info/all_msg_type_dest_info.c | 2 +- .../extension/msg_dest_info/json.c | 2 +- .../extension/msg_dest_info/msg_dest_info.c | 2 +- .../extension/msg_dest_info/value.c | 2 +- core/src/ten_runtime/extension/msg_handling.c | 2 +- .../ten_runtime/extension/ten_env/metadata.c | 2 +- .../ten_runtime/extension/ten_env/on_xxx.c | 2 +- ...n_extension_addon_and_instance_name_pair.c | 2 +- .../extension_context/extension_context.c | 2 +- .../internal/add_extension.c | 2 +- .../internal/del_extension.c | 2 +- .../internal/extension_group_is_inited.c | 2 +- .../internal/extension_group_is_stopped.c | 2 +- .../internal/extension_thread_is_closing.c | 2 +- .../extension_context/ten_env/on_xxx.c | 2 +- .../extension_group/extension_group.c | 2 +- .../extension_group_info.c | 2 +- .../extension_group_info/json.c | 2 +- .../extension_group_info/value.c | 2 +- .../extension_group/internal/metadata.c | 2 +- .../extension_group/ten_env/metadata.c | 2 +- .../extension_group/ten_env/on_xxx.c | 2 +- .../extension_store/extension_store.c | 2 +- .../extension_thread/extension_thread.c | 2 +- .../extension_thread/msg_interface/common.c | 2 +- .../src/ten_runtime/extension_thread/on_xxx.c | 2 +- core/src/ten_runtime/global/signal.c | 2 +- core/src/ten_runtime/metadata/metadata.c | 2 +- core/src/ten_runtime/metadata/metadata_info.c | 2 +- .../msg/audio_frame/field/bytes_per_sample.c | 2 +- .../msg/audio_frame/field/channel_layout.c | 2 +- .../msg/audio_frame/field/data_fmt.c | 2 +- .../msg/audio_frame/field/line_size.c | 2 +- .../msg/audio_frame/field/number_of_channel.c | 2 +- .../msg/audio_frame/field/sample_rate.c | 2 +- .../audio_frame/field/samples_per_channel.c | 2 +- .../msg/audio_frame/field/timestamp.c | 2 +- .../ten_runtime/msg/audio_frame/pcm_frame.c | 2 +- .../msg/cmd_base/cmd/close_app/cmd.c | 2 +- core/src/ten_runtime/msg/cmd_base/cmd/cmd.c | 2 +- .../ten_runtime/msg/cmd_base/cmd/custom/cmd.c | 2 +- .../msg/cmd_base/cmd/start_graph/cmd.c | 2 +- .../cmd/start_graph/field/extension_info.c | 2 +- .../cmd/start_graph/field/long_running_mode.c | 2 +- .../start_graph/field/predefined_graph_name.c | 2 +- .../msg/cmd_base/cmd/stop_graph/cmd.c | 2 +- .../cmd/stop_graph/field/graph_name.c | 2 +- .../msg/cmd_base/cmd/timeout/cmd.c | 2 +- .../msg/cmd_base/cmd/timeout/field/timer_id.c | 2 +- .../ten_runtime/msg/cmd_base/cmd/timer/cmd.c | 2 +- .../cmd_base/cmd/timer/field/timeout_in_us.c | 2 +- .../msg/cmd_base/cmd/timer/field/timer_id.c | 2 +- .../msg/cmd_base/cmd/timer/field/times.c | 2 +- core/src/ten_runtime/msg/cmd_base/cmd_base.c | 2 +- .../ten_runtime/msg/cmd_base/cmd_result/cmd.c | 2 +- .../cmd_result/field/original_cmd_type.c | 2 +- .../cmd_base/cmd_result/field/status_code.c | 2 +- .../ten_runtime/msg/cmd_base/field/cmd_id.c | 2 +- .../msg/cmd_base/field/original_connection.c | 2 +- .../msg/cmd_base/field/response_handler.c | 2 +- .../cmd_base/field/response_handler_data.c | 2 +- .../ten_runtime/msg/cmd_base/field/seq_id.c | 2 +- core/src/ten_runtime/msg/data/data.c | 2 +- core/src/ten_runtime/msg/field/dest.c | 2 +- core/src/ten_runtime/msg/field/name.c | 2 +- core/src/ten_runtime/msg/field/properties.c | 2 +- core/src/ten_runtime/msg/field/src.c | 2 +- core/src/ten_runtime/msg/field/type.c | 2 +- core/src/ten_runtime/msg/locked_res.c | 2 +- core/src/ten_runtime/msg/msg.c | 2 +- .../msg/video_frame/field/height.c | 2 +- .../msg/video_frame/field/pixel_fmt.c | 2 +- .../msg/video_frame/field/timestamp.c | 2 +- .../ten_runtime/msg/video_frame/field/width.c | 2 +- .../ten_runtime/msg/video_frame/video_frame.c | 2 +- .../msg_and_result_conversion.c | 2 +- .../msg_and_result_conversion_operation.c | 2 +- .../msg_conversion/msg_conversion.c | 2 +- .../msg_conversion_operation/base.c | 2 +- .../per_property/fixed_value.c | 2 +- .../per_property/from_original.c | 2 +- .../per_property/per_property.c | 2 +- .../per_property/rule.c | 2 +- .../per_property/rules.c | 2 +- core/src/ten_runtime/path/path.c | 2 +- core/src/ten_runtime/path/path_group.c | 2 +- core/src/ten_runtime/path/path_in.c | 2 +- core/src/ten_runtime/path/path_out.c | 2 +- core/src/ten_runtime/path/path_table.c | 2 +- .../ten_runtime/protocol/asynced/external.c | 2 +- .../ten_runtime/protocol/asynced/internal.c | 2 +- .../protocol/asynced/protocol_asynced.c | 2 +- core/src/ten_runtime/protocol/close.c | 2 +- core/src/ten_runtime/protocol/context.c | 2 +- core/src/ten_runtime/protocol/context_store.c | 2 +- .../ten_runtime/protocol/integrated/close.c | 2 +- .../protocol/integrated/protocol_integrated.c | 2 +- core/src/ten_runtime/protocol/protocol.c | 2 +- core/src/ten_runtime/remote/remote.c | 2 +- core/src/ten_runtime/schema_store/interface.c | 2 +- .../ten_runtime/schema_store/interface_info.c | 2 +- core/src/ten_runtime/schema_store/property.c | 2 +- core/src/ten_runtime/schema_store/store.c | 2 +- .../ten_env/internal/get_property.c | 2 +- .../ten_env/internal/is_cmd_connected.c | 2 +- .../ten_runtime/ten_env/internal/metadata.c | 2 +- .../ten_env/internal/on_xxx_done.c | 2 +- .../src/ten_runtime/ten_env/internal/return.c | 2 +- core/src/ten_runtime/ten_env/internal/send.c | 2 +- .../ten_env/internal/set_property.c | 2 +- core/src/ten_runtime/ten_env/ten_env.c | 2 +- core/src/ten_runtime/ten_env/ten_proxy.c | 2 +- .../internal/acquire_lock_mode.c | 2 +- .../ten_env_proxy/internal/notify.c | 2 +- .../internal/release_lock_mode.c | 2 +- .../ten_runtime/ten_env_proxy/ten_env_proxy.c | 2 +- core/src/ten_runtime/timer/timer.c | 2 +- .../backtrace/platform/posix/darwin/macho.c | 2 +- .../platform/posix/linux/debugfile.c | 2 +- .../backtrace/platform/posix/linux/view.c | 2 +- core/src/ten_utils/container/list.c | 2 +- core/src/ten_utils/container/list_int32.c | 2 +- core/src/ten_utils/container/list_node.c | 2 +- .../src/ten_utils/container/list_node_int32.c | 2 +- core/src/ten_utils/container/list_node_ptr.c | 2 +- .../ten_utils/container/list_node_smart_ptr.c | 2 +- core/src/ten_utils/container/list_node_str.c | 2 +- core/src/ten_utils/container/list_ptr.c | 2 +- core/src/ten_utils/container/list_smart_ptr.c | 2 +- core/src/ten_utils/container/list_str.c | 2 +- core/src/ten_utils/container/vector.c | 2 +- .../ten_utils/io/general/loops/bare/runloop.c | 2 +- core/src/ten_utils/io/general/loops/runloop.c | 2 +- .../ten_utils/io/general/loops/uv/runloop.c | 2 +- core/src/ten_utils/io/general/socket.c | 2 +- .../transport/backend/uv/stream/migrate.c | 2 +- .../ten_utils/io/general/transport/stream.c | 2 +- .../io/general/transport/transport.c | 2 +- core/src/ten_utils/io/posix/mmap.c | 2 +- core/src/ten_utils/io/posix/socket.c | 2 +- core/src/ten_utils/lib/sys/general/buf.c | 2 +- core/src/ten_utils/lib/sys/general/error.c | 2 +- core/src/ten_utils/lib/sys/general/file.c | 2 +- core/src/ten_utils/lib/sys/general/json.c | 2 +- core/src/ten_utils/lib/sys/general/path.c | 2 +- .../ten_utils/lib/sys/general/placeholder.c | 2 +- core/src/ten_utils/lib/sys/general/ref.c | 2 +- .../src/ten_utils/lib/sys/general/signature.c | 2 +- .../src/ten_utils/lib/sys/general/smart_ptr.c | 2 +- core/src/ten_utils/lib/sys/general/string.c | 2 +- core/src/ten_utils/lib/sys/general/thread.c | 2 +- core/src/ten_utils/lib/sys/general/uuid.c | 2 +- core/src/ten_utils/lib/sys/posix/cond.c | 2 +- .../ten_utils/lib/sys/posix/darwin/pc/path.c | 2 +- core/src/ten_utils/lib/sys/posix/event.c | 2 +- core/src/ten_utils/lib/sys/posix/linux/uuid.c | 2 +- core/src/ten_utils/lib/sys/posix/path.c | 2 +- .../ten_utils/lib/sys/posix/process_mutex.c | 2 +- core/src/ten_utils/lib/sys/posix/thread.c | 2 +- .../src/ten_utils/lib/sys/posix/thread_once.c | 2 +- core/src/ten_utils/lib/sys/win/atomic.c | 2 +- core/src/ten_utils/lib/sys/win/cond.c | 2 +- core/src/ten_utils/lib/sys/win/path.c | 2 +- core/src/ten_utils/lib/sys/win/thread.c | 2 +- core/src/ten_utils/lib/sys/win/uuid.c | 2 +- core/src/ten_utils/log/output.c | 2 +- core/src/ten_utils/sanitizer/memory_check.c | 2 +- core/src/ten_utils/sanitizer/thread_check.c | 2 +- .../ten_utils/schema/bindings/rust/schema.c | 2 +- core/src/ten_utils/schema/keywords/keyword.c | 2 +- .../ten_utils/schema/keywords/keyword_items.c | 2 +- .../schema/keywords/keyword_properties.c | 2 +- .../schema/keywords/keyword_required.c | 2 +- .../ten_utils/schema/keywords/keyword_type.c | 2 +- core/src/ten_utils/schema/schema.c | 2 +- .../src/ten_utils/schema/types/schema_array.c | 2 +- .../ten_utils/schema/types/schema_object.c | 2 +- .../ten_utils/schema/types/schema_primitive.c | 2 +- core/src/ten_utils/value/type.c | 4 +- core/src/ten_utils/value/value.c | 2 +- core/src/ten_utils/value/value_convert.c | 2 +- core/src/ten_utils/value/value_get.c | 2 +- core/src/ten_utils/value/value_is.c | 2 +- core/src/ten_utils/value/value_json.c | 2 +- core/src/ten_utils/value/value_kv.c | 2 +- core/src/ten_utils/value/value_path.c | 2 +- core/src/ten_utils/value/value_smart_ptr.c | 2 +- core/src/ten_utils/value/value_string.c | 2 +- .../src/default_extension_group.c | 2 +- .../py_init_extension_cpp/src/main.cc | 2 +- .../core_protocols/msgpack/common/parser.c | 2 +- .../core_protocols/msgpack/common/value.c | 2 +- .../msgpack/msg/cmd/custom/cmd.c | 2 +- .../msgpack/msg/cmd/field/cmd_id.c | 2 +- .../msgpack/msg/cmd/field/seq_id.c | 2 +- .../msgpack/msg/data/field/buf.c | 2 +- .../core_protocols/msgpack/msg/field/dest.c | 2 +- .../core_protocols/msgpack/msg/field/name.c | 2 +- .../msgpack/msg/field/properties.c | 2 +- .../core_protocols/msgpack/msg/field/src.c | 2 +- .../core_protocols/msgpack/msg/field/type.c | 2 +- packages/core_protocols/msgpack/msg/loc.c | 2 +- packages/core_protocols/msgpack/msg/msg.c | 2 +- packages/core_protocols/msgpack/protocol.c | 2 +- .../ffmpeg_demuxer/src/demuxer.cc | 4 +- .../ffmpeg_demuxer/src/demuxer_thread.cc | 2 +- .../ffmpeg_muxer/src/muxer.cc | 2 +- tests/common/client/http.c | 2 +- tests/common/client/msgpack_tcp.c | 2 +- tests/common/client/tcp.c | 2 +- .../default_extension_cpp/src/main.cc | 2 +- .../default_extension_cpp/src/main.cc | 2 +- .../audio_frame_test/multi_dest_pcm_frame.cc | 2 +- .../smoke/data_test/multi_dest_data.cc | 2 +- .../basic/basic_msg_property_to_prop_store.cc | 2 +- .../command/command_send_enum.cc | 2 +- .../smoke/extension_test/lock/lock_data_1.cc | 2 +- .../128_threads_attempt_to_suspend_1.cc | 2 +- .../16_threads_attempt_to_suspend_1.cc | 2 +- .../2_threads_attempt_to_suspend_1.cc | 2 +- .../2_threads_attempt_to_suspend_2.cc | 2 +- .../2_threads_attempt_to_suspend_3.cc | 2 +- .../2_threads_attempt_to_suspend_4.cc | 2 +- .../2_threads_attempt_to_suspend_5.cc | 2 +- .../2_threads_attempt_to_suspend_6.cc | 2 +- .../2_threads_attempt_to_suspend_7.cc | 2 +- .../32_threads_attempt_to_suspend_1.cc | 2 +- .../32_threads_attempt_to_suspend_2.cc | 2 +- .../32_threads_attempt_to_suspend_3.cc | 2 +- .../32_threads_attempt_to_suspend_4.cc | 2 +- .../32_threads_attempt_to_suspend_5.cc | 2 +- .../32_threads_attempt_to_suspend_6.cc | 2 +- .../outer_thread/auto_free_out_of_scope.cc | 2 +- .../outer_thread/outer_thread_send_data.cc | 2 +- .../outer_thread_send_data_resp_handler.cc | 2 +- .../suspend_resume/suspend_resume_1.cc | 2 +- .../suspend_resume/suspend_resume_2.cc | 2 +- .../multi_dest_video_frame.cc | 2 +- 347 files changed, 520 insertions(+), 480 deletions(-) create mode 100644 core/include/ten_utils/backtrace/backtrace.h create mode 100644 core/include/ten_utils/log/log.h rename core/{include_internal => include}/ten_utils/macro/check.h (92%) rename core/{include => include_internal}/ten_utils/value/type_info.h (90%) diff --git a/core/include/ten_runtime/binding/cpp/internal/app.h b/core/include/ten_runtime/binding/cpp/internal/app.h index 9803e887a9..a458ae929c 100644 --- a/core/include/ten_runtime/binding/cpp/internal/app.h +++ b/core/include/ten_runtime/binding/cpp/internal/app.h @@ -8,8 +8,7 @@ #include #include -#include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/cpp/internal/common.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/extension.h b/core/include/ten_runtime/binding/cpp/internal/extension.h index cbce3783c4..983b7152df 100644 --- a/core/include/ten_runtime/binding/cpp/internal/extension.h +++ b/core/include/ten_runtime/binding/cpp/internal/extension.h @@ -12,8 +12,7 @@ #include #include -#include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/cpp/internal/common.h" #include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/extension_group.h b/core/include/ten_runtime/binding/cpp/internal/extension_group.h index 33b27ac6dd..10a136c373 100644 --- a/core/include/ten_runtime/binding/cpp/internal/extension_group.h +++ b/core/include/ten_runtime/binding/cpp/internal/extension_group.h @@ -7,7 +7,7 @@ #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/cpp/internal/ten_env.h" #include "ten_runtime/extension_group/extension_group.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/cmd.h b/core/include/ten_runtime/binding/cpp/internal/msg/cmd/cmd.h index ee41f00e64..ec2cecdf03 100644 --- a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/cmd.h +++ b/core/include/ten_runtime/binding/cpp/internal/msg/cmd/cmd.h @@ -9,7 +9,7 @@ #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/cpp/internal/msg/msg.h" #include "ten_runtime/msg/cmd/cmd.h" #include "ten_runtime/msg/msg.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/msg.h b/core/include/ten_runtime/binding/cpp/internal/msg/msg.h index 405f1ecbdc..926d619758 100644 --- a/core/include/ten_runtime/binding/cpp/internal/msg/msg.h +++ b/core/include/ten_runtime/binding/cpp/internal/msg/msg.h @@ -9,7 +9,7 @@ #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lang/cpp/lib/error.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/ten_env.h b/core/include/ten_runtime/binding/cpp/internal/ten_env.h index 267b79ce22..e67403b549 100644 --- a/core/include/ten_runtime/binding/cpp/internal/ten_env.h +++ b/core/include/ten_runtime/binding/cpp/internal/ten_env.h @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" #include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" diff --git a/core/include/ten_utils/backtrace/backtrace.h b/core/include/ten_utils/backtrace/backtrace.h new file mode 100644 index 0000000000..a103831a89 --- /dev/null +++ b/core/include/ten_utils/backtrace/backtrace.h @@ -0,0 +1,24 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +// This file is modified from +// https://github.com/ianlancetaylor/libbacktrace [BSD license] +// +#pragma once + +#include "ten_utils/ten_config.h" + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +TEN_UTILS_API void ten_backtrace_dump_global(size_t skip); + +#ifdef __cplusplus +} /* End extern "C". */ +#endif diff --git a/core/include/ten_utils/lang/cpp/lib/value.h b/core/include/ten_utils/lang/cpp/lib/value.h index 7668ab0c46..0cf5bdf4a5 100644 --- a/core/include/ten_utils/lang/cpp/lib/value.h +++ b/core/include/ten_utils/lang/cpp/lib/value.h @@ -15,7 +15,7 @@ #include #include "buf.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/buf.h" diff --git a/core/include/ten_utils/lib/mutex.h b/core/include/ten_utils/lib/mutex.h index 3709004000..8e63f07e7c 100644 --- a/core/include/ten_utils/lib/mutex.h +++ b/core/include/ten_utils/lib/mutex.h @@ -7,7 +7,7 @@ #include "ten_utils/ten_config.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #define TEN_DO_WITH_MUTEX_LOCK(lock, blocks) \ do { \ diff --git a/core/include/ten_utils/lib/string.h b/core/include/ten_utils/lib/string.h index ea4bb1137a..5c2de5e33c 100644 --- a/core/include/ten_utils/lib/string.h +++ b/core/include/ten_utils/lib/string.h @@ -11,7 +11,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/buf.h" #include "ten_utils/lib/signature.h" diff --git a/core/include/ten_utils/lib/typed_list_node.h b/core/include/ten_utils/lib/typed_list_node.h index 9ed0eb1a86..57a03eec85 100644 --- a/core/include/ten_utils/lib/typed_list_node.h +++ b/core/include/ten_utils/lib/typed_list_node.h @@ -7,7 +7,7 @@ #include "ten_utils/ten_config.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #define TEN_TYPED_LIST_NODE_SIGNATURE 0x3CE1EAC77F72D345U diff --git a/core/include/ten_utils/log/log.h b/core/include/ten_utils/log/log.h new file mode 100644 index 0000000000..9f132aabfa --- /dev/null +++ b/core/include/ten_utils/log/log.h @@ -0,0 +1,146 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#pragma once + +#include "ten_utils/ten_config.h" + +#include +#include +#include + +#include "ten_utils/lib/signature.h" + +#define TEN_LOGV(...) \ + do { \ + if (ten_global_log.output_level <= TEN_LOG_LEVEL_VERBOSE) { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_VERBOSE, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGD(...) \ + do { \ + if (ten_global_log.output_level <= TEN_LOG_LEVEL_DEBUG) { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_DEBUG, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGI(...) \ + do { \ + if (ten_global_log.output_level <= TEN_LOG_LEVEL_INFO) { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_INFO, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGW(...) \ + do { \ + if (ten_global_log.output_level <= TEN_LOG_LEVEL_WARN) { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_WARN, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGE(...) \ + do { \ + if (ten_global_log.output_level <= TEN_LOG_LEVEL_ERROR) { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_ERROR, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGF(...) \ + do { \ + if (ten_global_log.output_level <= TEN_LOG_LEVEL_FATAL) { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_FATAL, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGV_AUX(log, ...) \ + do { \ + if ((log)->output_level <= TEN_LOG_LEVEL_VERBOSE) { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_VERBOSE, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGD_AUX(log, ...) \ + do { \ + if ((log)->output_level <= TEN_LOG_LEVEL_DEBUG) { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_DEBUG, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGI_AUX(log, ...) \ + do { \ + if ((log)->output_level <= TEN_LOG_LEVEL_INFO) { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_INFO, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGW_AUX(log, ...) \ + do { \ + if ((log)->output_level <= TEN_LOG_LEVEL_WARN) { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_WARN, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGE_AUX(log, ...) \ + do { \ + if ((log)->output_level <= TEN_LOG_LEVEL_ERROR) { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_ERROR, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +#define TEN_LOGF_AUX(log, ...) \ + do { \ + if ((log)->output_level <= TEN_LOG_LEVEL_FATAL) { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_FATAL, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ + } \ + } while (0) + +typedef enum TEN_LOG_LEVEL { + TEN_LOG_LEVEL_INVALID, + + TEN_LOG_LEVEL_VERBOSE, + TEN_LOG_LEVEL_DEBUG, + TEN_LOG_LEVEL_INFO, + TEN_LOG_LEVEL_WARN, + TEN_LOG_LEVEL_ERROR, + TEN_LOG_LEVEL_FATAL, +} TEN_LOG_LEVEL; + +typedef struct ten_string_t ten_string_t; + +typedef void (*ten_log_output_func_t)(ten_string_t *msg, void *user_data); +typedef void (*ten_log_close_func_t)(void *user_data); + +typedef struct ten_log_output_t { + ten_log_output_func_t output_cb; + ten_log_close_func_t close_cb; + void *user_data; +} ten_log_output_t; + +typedef struct ten_log_t { + ten_signature_t signature; + + TEN_LOG_LEVEL output_level; + ten_log_output_t output; +} ten_log_t; + +TEN_UTILS_API ten_log_t ten_global_log; + +TEN_UTILS_API void ten_log_log_formatted(ten_log_t *self, TEN_LOG_LEVEL level, + const char *func_name, + const char *file_name, size_t line_no, + const char *fmt, ...); diff --git a/core/include_internal/ten_utils/macro/check.h b/core/include/ten_utils/macro/check.h similarity index 92% rename from core/include_internal/ten_utils/macro/check.h rename to core/include/ten_utils/macro/check.h index 032d978680..5815ba0c17 100644 --- a/core/include_internal/ten_utils/macro/check.h +++ b/core/include/ten_utils/macro/check.h @@ -11,8 +11,8 @@ #include // IWYU pragma: keep #include // IWYU pragma: keep -#include "include_internal/ten_utils/backtrace/backtrace.h" // IWYU pragma: keep -#include "include_internal/ten_utils/log/log.h" +#include "ten_utils/backtrace/backtrace.h" // IWYU pragma: keep +#include "ten_utils/log/log.h" #if defined(__has_feature) #if __has_feature(address_sanitizer) diff --git a/core/include_internal/ten_runtime/msg/msg.h b/core/include_internal/ten_runtime/msg/msg.h index 5f1c6b4809..4e8cd279d0 100644 --- a/core/include_internal/ten_runtime/msg/msg.h +++ b/core/include_internal/ten_runtime/msg/msg.h @@ -8,7 +8,7 @@ #include "ten_runtime/ten_config.h" #include "include_internal/ten_runtime/common/loc.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/container/list.h" #include "ten_utils/value/value.h" diff --git a/core/include_internal/ten_runtime/ten_env/ten_env.h b/core/include_internal/ten_runtime/ten_env/ten_env.h index e9fe101c1f..0c53f8783f 100644 --- a/core/include_internal/ten_runtime/ten_env/ten_env.h +++ b/core/include_internal/ten_runtime/ten_env/ten_env.h @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/addon/addon.h" #include "include_internal/ten_runtime/binding/common.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/io/runloop.h" diff --git a/core/include_internal/ten_utils/backtrace/backtrace.h b/core/include_internal/ten_utils/backtrace/backtrace.h index d32877f62f..cac5bb06eb 100644 --- a/core/include_internal/ten_utils/backtrace/backtrace.h +++ b/core/include_internal/ten_utils/backtrace/backtrace.h @@ -124,8 +124,6 @@ TEN_UTILS_API void ten_backtrace_destroy_global(void); TEN_UTILS_API void ten_backtrace_destroy(ten_backtrace_t *self); -TEN_UTILS_API void ten_backtrace_dump_global(size_t skip); - /** * @brief Get a full stack backtrace. * diff --git a/core/include_internal/ten_utils/log/log.h b/core/include_internal/ten_utils/log/log.h index 05d6bbf64b..9bd2166aed 100644 --- a/core/include_internal/ten_utils/log/log.h +++ b/core/include_internal/ten_utils/log/log.h @@ -11,137 +11,15 @@ #include #include -#include "ten_utils/lib/signature.h" +#include "ten_utils/log/log.h" #define TEN_LOG_SIGNATURE 0xC0EE0CE92149D61AU -#define TEN_LOGV(...) \ - do { \ - if (ten_global_log.output_level <= TEN_LOG_LEVEL_VERBOSE) { \ - ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_VERBOSE, __func__, \ - __FILE__, __LINE__, __VA_ARGS__); \ - } \ - } while (0) - -#define TEN_LOGD(...) \ - do { \ - if (ten_global_log.output_level <= TEN_LOG_LEVEL_DEBUG) { \ - ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_DEBUG, __func__, \ - __FILE__, __LINE__, __VA_ARGS__); \ - } \ - } while (0) - -#define TEN_LOGI(...) \ - do { \ - if (ten_global_log.output_level <= TEN_LOG_LEVEL_INFO) { \ - ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_INFO, __func__, \ - __FILE__, __LINE__, __VA_ARGS__); \ - } \ - } while (0) - -#define TEN_LOGW(...) \ - do { \ - if (ten_global_log.output_level <= TEN_LOG_LEVEL_WARN) { \ - ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_WARN, __func__, \ - __FILE__, __LINE__, __VA_ARGS__); \ - } \ - } while (0) - -#define TEN_LOGE(...) \ - do { \ - if (ten_global_log.output_level <= TEN_LOG_LEVEL_ERROR) { \ - ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_ERROR, __func__, \ - __FILE__, __LINE__, __VA_ARGS__); \ - } \ - } while (0) - -#define TEN_LOGF(...) \ - do { \ - if (ten_global_log.output_level <= TEN_LOG_LEVEL_FATAL) { \ - ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_FATAL, __func__, \ - __FILE__, __LINE__, __VA_ARGS__); \ - } \ - } while (0) - -#define TEN_LOGV_AUX(log, ...) \ - do { \ - if ((log)->output_level <= TEN_LOG_LEVEL_VERBOSE) { \ - ten_log_log_formatted(log, TEN_LOG_LEVEL_VERBOSE, __func__, __FILE__, \ - __LINE__, __VA_ARGS__); \ - } \ - } while (0) - -#define TEN_LOGD_AUX(log, ...) \ - do { \ - if ((log)->output_level <= TEN_LOG_LEVEL_DEBUG) { \ - ten_log_log_formatted(log, TEN_LOG_LEVEL_DEBUG, __func__, __FILE__, \ - __LINE__, __VA_ARGS__); \ - } \ - } while (0) - -#define TEN_LOGI_AUX(log, ...) \ - do { \ - if ((log)->output_level <= TEN_LOG_LEVEL_INFO) { \ - ten_log_log_formatted(log, TEN_LOG_LEVEL_INFO, __func__, __FILE__, \ - __LINE__, __VA_ARGS__); \ - } \ - } while (0) - -#define TEN_LOGW_AUX(log, ...) \ - do { \ - if ((log)->output_level <= TEN_LOG_LEVEL_WARN) { \ - ten_log_log_formatted(log, TEN_LOG_LEVEL_WARN, __func__, __FILE__, \ - __LINE__, __VA_ARGS__); \ - } \ - } while (0) - -#define TEN_LOGE_AUX(log, ...) \ - do { \ - if ((log)->output_level <= TEN_LOG_LEVEL_ERROR) { \ - ten_log_log_formatted(log, TEN_LOG_LEVEL_ERROR, __func__, __FILE__, \ - __LINE__, __VA_ARGS__); \ - } \ - } while (0) - -#define TEN_LOGF_AUX(log, ...) \ - do { \ - if ((log)->output_level <= TEN_LOG_LEVEL_FATAL) { \ - ten_log_log_formatted(log, TEN_LOG_LEVEL_FATAL, __func__, __FILE__, \ - __LINE__, __VA_ARGS__); \ - } \ - } while (0) - -typedef enum TEN_LOG_LEVEL { - TEN_LOG_LEVEL_INVALID, - - TEN_LOG_LEVEL_VERBOSE, - TEN_LOG_LEVEL_DEBUG, - TEN_LOG_LEVEL_INFO, - TEN_LOG_LEVEL_WARN, - TEN_LOG_LEVEL_ERROR, - TEN_LOG_LEVEL_FATAL, -} TEN_LOG_LEVEL; - typedef struct ten_string_t ten_string_t; typedef void (*ten_log_output_func_t)(ten_string_t *msg, void *user_data); typedef void (*ten_log_close_func_t)(void *user_data); -typedef struct ten_log_output_t { - ten_log_output_func_t output_cb; - ten_log_close_func_t close_cb; - void *user_data; -} ten_log_output_t; - -typedef struct ten_log_t { - ten_signature_t signature; - - TEN_LOG_LEVEL output_level; - ten_log_output_t output; -} ten_log_t; - -TEN_UTILS_API ten_log_t ten_global_log; - TEN_UTILS_PRIVATE_API bool ten_log_check_integrity(ten_log_t *self); TEN_UTILS_API void ten_log_init(ten_log_t *self); @@ -152,11 +30,6 @@ TEN_UTILS_API void ten_log_deinit(ten_log_t *self); TEN_UTILS_PRIVATE_API void ten_log_destroy(ten_log_t *self); -TEN_UTILS_API void ten_log_log_formatted(ten_log_t *self, TEN_LOG_LEVEL level, - const char *func_name, - const char *file_name, size_t line_no, - const char *fmt, ...); - TEN_UTILS_API void ten_log_log_with_size_from_va_list( ten_log_t *self, TEN_LOG_LEVEL level, const char *func_name, size_t func_name_len, const char *file_name, size_t file_name_len, diff --git a/core/include_internal/ten_utils/schema/keywords/keywords_info.h b/core/include_internal/ten_utils/schema/keywords/keywords_info.h index 0bc72014ed..d9fd194862 100644 --- a/core/include_internal/ten_utils/schema/keywords/keywords_info.h +++ b/core/include_internal/ten_utils/schema/keywords/keywords_info.h @@ -5,7 +5,7 @@ // #pragma once -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/constant_str.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/keywords/keyword_items.h" diff --git a/core/include/ten_utils/value/type_info.h b/core/include_internal/ten_utils/value/type_info.h similarity index 90% rename from core/include/ten_utils/value/type_info.h rename to core/include_internal/ten_utils/value/type_info.h index 5ab1ad9354..59e079b2fd 100644 --- a/core/include/ten_utils/value/type_info.h +++ b/core/include_internal/ten_utils/value/type_info.h @@ -5,15 +5,16 @@ // #pragma once +#include "ten_utils/ten_config.h" + #include #include "include_internal/ten_utils/value/constant_str.h" -#include "ten_utils/ten_config.h" #include "ten_utils/value/type.h" #ifdef __cplusplus - #error \ - "This file contains C99 array designated initializer, and Visual Studio C++ compiler can only support up to C89 by default, so we enable this checking to prevent any wrong inclusion of this file." +#error \ + "This file contains C99 array designated initializer, and Visual Studio C++ compiler can only support up to C89 by default, so we enable this checking to prevent any wrong inclusion of this file." #endif typedef struct ten_type_info_t { diff --git a/core/src/ten_runtime/addon/addon.c b/core/src/ten_runtime/addon/addon.c index 2a850a8e64..58c12dc592 100644 --- a/core/src/ten_runtime/addon/addon.c +++ b/core/src/ten_runtime/addon/addon.c @@ -18,7 +18,7 @@ #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/core/src/ten_runtime/addon/common/store.c b/core/src/ten_runtime/addon/common/store.c index e9920f5347..479c0243bc 100644 --- a/core/src/ten_runtime/addon/common/store.c +++ b/core/src/ten_runtime/addon/common/store.c @@ -9,7 +9,7 @@ #include #include "include_internal/ten_runtime/addon/addon.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/mutex.h" diff --git a/core/src/ten_runtime/addon/extension/extension.c b/core/src/ten_runtime/addon/extension/extension.c index ef6a3a9479..9d93fda112 100644 --- a/core/src/ten_runtime/addon/extension/extension.c +++ b/core/src/ten_runtime/addon/extension/extension.c @@ -13,7 +13,7 @@ #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/addon/addon.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/addon/extension_group/extension_group.c b/core/src/ten_runtime/addon/extension_group/extension_group.c index 8c43a217f1..3c815f7d18 100644 --- a/core/src/ten_runtime/addon/extension_group/extension_group.c +++ b/core/src/ten_runtime/addon/extension_group/extension_group.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/addon/extension_group/extension_group.h" static ten_addon_store_t g_extension_group_store = { diff --git a/core/src/ten_runtime/addon/protocol/protocol.c b/core/src/ten_runtime/addon/protocol/protocol.c index 2a72d152ae..a061c413f9 100644 --- a/core/src/ten_runtime/addon/protocol/protocol.c +++ b/core/src/ten_runtime/addon/protocol/protocol.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/addon/common/store.h" #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_runtime/addon/ten_env/on_xxx.c b/core/src/ten_runtime/addon/ten_env/on_xxx.c index 838b255fc6..41a78596aa 100644 --- a/core/src/ten_runtime/addon/ten_env/on_xxx.c +++ b/core/src/ten_runtime/addon/ten_env/on_xxx.c @@ -18,7 +18,7 @@ #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/string.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/app/app.c b/core/src/ten_runtime/app/app.c index 1bb63ed27f..aa44eba6aa 100644 --- a/core/src/ten_runtime/app/app.c +++ b/core/src/ten_runtime/app/app.c @@ -18,7 +18,7 @@ #include "include_internal/ten_runtime/schema_store/store.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/protocol/context_store.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/core/src/ten_runtime/app/base_dir.c b/core/src/ten_runtime/app/base_dir.c index db06262f21..a0108fe1f2 100644 --- a/core/src/ten_runtime/app/base_dir.c +++ b/core/src/ten_runtime/app/base_dir.c @@ -6,7 +6,7 @@ #include "ten_runtime/ten_config.h" #include "include_internal/ten_runtime/common/constant_str.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/file.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/path.h" diff --git a/core/src/ten_runtime/app/close.c b/core/src/ten_runtime/app/close.c index a3f84f635f..51e1ecaa38 100644 --- a/core/src/ten_runtime/app/close.c +++ b/core/src/ten_runtime/app/close.c @@ -16,7 +16,7 @@ #include "include_internal/ten_runtime/protocol/context_store.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/protocol/context_store.h" diff --git a/core/src/ten_runtime/app/endpoint.c b/core/src/ten_runtime/app/endpoint.c index 0665459e23..46b97ed0d4 100644 --- a/core/src/ten_runtime/app/endpoint.c +++ b/core/src/ten_runtime/app/endpoint.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/protocol/context_store.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" static ten_connection_t *create_connection_when_client_accepted( ten_protocol_t *protocol) { diff --git a/core/src/ten_runtime/app/engine_interface.c b/core/src/ten_runtime/app/engine_interface.c index 1aad261bf1..c790ffc88f 100644 --- a/core/src/ten_runtime/app/engine_interface.c +++ b/core/src/ten_runtime/app/engine_interface.c @@ -13,7 +13,7 @@ #include "include_internal/ten_runtime/engine/internal/thread.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/string.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/app/internal.c b/core/src/ten_runtime/app/internal.c index e64f3703c2..d51623b1d9 100644 --- a/core/src/ten_runtime/app/internal.c +++ b/core/src/ten_runtime/app/internal.c @@ -18,7 +18,7 @@ #include "include_internal/ten_runtime/connection/connection.h" #include "include_internal/ten_runtime/engine/engine.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" diff --git a/core/src/ten_runtime/app/metadata.c b/core/src/ten_runtime/app/metadata.c index 3e24b51775..e09ba36052 100644 --- a/core/src/ten_runtime/app/metadata.c +++ b/core/src/ten_runtime/app/metadata.c @@ -14,7 +14,7 @@ #include "include_internal/ten_runtime/extension/extension_info/extension_info.h" #include "include_internal/ten_utils/log/log.h" #include "include_internal/ten_utils/log/output.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" diff --git a/core/src/ten_runtime/app/migration.c b/core/src/ten_runtime/app/migration.c index 25f256cdc3..4194d84241 100644 --- a/core/src/ten_runtime/app/migration.c +++ b/core/src/ten_runtime/app/migration.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/app/close.h" #include "include_internal/ten_runtime/connection/connection.h" #include "include_internal/ten_runtime/engine/engine.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/io/runloop.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/app/msg_interface/common.c b/core/src/ten_runtime/app/msg_interface/common.c index 79ce304ead..9b2e83ef68 100644 --- a/core/src/ten_runtime/app/msg_interface/common.c +++ b/core/src/ten_runtime/app/msg_interface/common.c @@ -21,7 +21,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/msg/msg.h" diff --git a/core/src/ten_runtime/app/msg_interface/start_graph.c b/core/src/ten_runtime/app/msg_interface/start_graph.c index 597e4d6dc1..f839833daf 100644 --- a/core/src/ten_runtime/app/msg_interface/start_graph.c +++ b/core/src/ten_runtime/app/msg_interface/start_graph.c @@ -22,7 +22,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/src/ten_runtime/app/predefined_graph.c b/core/src/ten_runtime/app/predefined_graph.c index 9e39f7e27f..2c00ce921d 100644 --- a/core/src/ten_runtime/app/predefined_graph.c +++ b/core/src/ten_runtime/app/predefined_graph.c @@ -18,7 +18,7 @@ #include "include_internal/ten_runtime/extension_group/extension_group_info/json.h" #include "include_internal/ten_runtime/extension_group/extension_group_info/value.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_runtime/app/ten_env/metadata.c b/core/src/ten_runtime/app/ten_env/metadata.c index c321331eeb..70df241320 100644 --- a/core/src/ten_runtime/app/ten_env/metadata.c +++ b/core/src/ten_runtime/app/ten_env/metadata.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/app/app.h" #include "include_internal/ten_runtime/schema_store/store.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_runtime/app/ten_env/on_xxx.c b/core/src/ten_runtime/app/ten_env/on_xxx.c index 98a9ffe02b..271865f1bc 100644 --- a/core/src/ten_runtime/app/ten_env/on_xxx.c +++ b/core/src/ten_runtime/app/ten_env/on_xxx.c @@ -18,7 +18,7 @@ #include "include_internal/ten_runtime/ten_env/metadata_cb.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/core/src/ten_runtime/binding/common.c b/core/src/ten_runtime/binding/common.c index 4c04e1e28c..641f209e8b 100644 --- a/core/src/ten_runtime/binding/common.c +++ b/core/src/ten_runtime/binding/common.c @@ -6,7 +6,7 @@ #include "ten_runtime/binding/common.h" #include "include_internal/ten_runtime/binding/common.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" void ten_binding_handle_set_me_in_target_lang(ten_binding_handle_t *self, void *me_in_target_lang) { diff --git a/core/src/ten_runtime/binding/go/native/addon/addon.c b/core/src/ten_runtime/binding/go/native/addon/addon.c index 7a966145a9..dd3e7a7b1e 100644 --- a/core/src/ten_runtime/binding/go/native/addon/addon.c +++ b/core/src/ten_runtime/binding/go/native/addon/addon.c @@ -16,7 +16,7 @@ #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/addon/addon.h" #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/addon/extension_group/extension_group.h" diff --git a/core/src/ten_runtime/binding/go/native/extension/extension.c b/core/src/ten_runtime/binding/go/native/extension/extension.c index 4081f9d478..376d09585e 100644 --- a/core/src/ten_runtime/binding/go/native/extension/extension.c +++ b/core/src/ten_runtime/binding/go/native/extension/extension.c @@ -14,7 +14,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" diff --git a/core/src/ten_runtime/binding/go/native/extension_group/extension_group.c b/core/src/ten_runtime/binding/go/native/extension_group/extension_group.c index bf9789e31f..41bfd7cc50 100644 --- a/core/src/ten_runtime/binding/go/native/extension_group/extension_group.c +++ b/core/src/ten_runtime/binding/go/native/extension_group/extension_group.c @@ -14,7 +14,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" diff --git a/core/src/ten_runtime/binding/go/native/internal/common.c b/core/src/ten_runtime/binding/go/native/internal/common.c index 3062e05a0f..49dbdda1e8 100644 --- a/core/src/ten_runtime/binding/go/native/internal/common.c +++ b/core/src/ten_runtime/binding/go/native/internal/common.c @@ -9,7 +9,7 @@ #include #include "include_internal/ten_runtime/binding/go/internal/common.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/src/ten_runtime/binding/go/native/internal/json.c b/core/src/ten_runtime/binding/go/native/internal/json.c index 74071e31b4..2537bfd417 100644 --- a/core/src/ten_runtime/binding/go/native/internal/json.c +++ b/core/src/ten_runtime/binding/go/native/internal/json.c @@ -6,7 +6,7 @@ #include "include_internal/ten_runtime/binding/go/internal/json.h" #include "include_internal/ten_runtime/binding/go/internal/common.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_runtime/binding/go/native/msg/audio_frame/audio_frame.c b/core/src/ten_runtime/binding/go/native/msg/audio_frame/audio_frame.c index 486412cee5..ea28561ff7 100644 --- a/core/src/ten_runtime/binding/go/native/msg/audio_frame/audio_frame.c +++ b/core/src/ten_runtime/binding/go/native/msg/audio_frame/audio_frame.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/go/internal/common.h" #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" diff --git a/core/src/ten_runtime/binding/go/native/msg/cmd/cmd.c b/core/src/ten_runtime/binding/go/native/msg/cmd/cmd.c index 8d01827e2a..4b68a76801 100644 --- a/core/src/ten_runtime/binding/go/native/msg/cmd/cmd.c +++ b/core/src/ten_runtime/binding/go/native/msg/cmd/cmd.c @@ -13,7 +13,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/custom/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/common/status_code.h" diff --git a/core/src/ten_runtime/binding/go/native/msg/data/data.c b/core/src/ten_runtime/binding/go/native/msg/data/data.c index cbf472ef50..bc57a99af3 100644 --- a/core/src/ten_runtime/binding/go/native/msg/data/data.c +++ b/core/src/ten_runtime/binding/go/native/msg/data/data.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/go/internal/common.h" #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/data/data.h" diff --git a/core/src/ten_runtime/binding/go/native/msg/msg.c b/core/src/ten_runtime/binding/go/native/msg/msg.c index 81201991b7..ad40499ae2 100644 --- a/core/src/ten_runtime/binding/go/native/msg/msg.c +++ b/core/src/ten_runtime/binding/go/native/msg/msg.c @@ -14,7 +14,7 @@ #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/binding/go/value/value.h" #include "include_internal/ten_runtime/msg/field/properties.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/value.h" #include "ten_runtime/common/errno.h" diff --git a/core/src/ten_runtime/binding/go/native/msg/video_frame/video_frame.c b/core/src/ten_runtime/binding/go/native/msg/video_frame/video_frame.c index 7d4dd279b8..d92a176476 100644 --- a/core/src/ten_runtime/binding/go/native/msg/video_frame/video_frame.c +++ b/core/src/ten_runtime/binding/go/native/msg/video_frame/video_frame.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/go/internal/common.h" #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/msg.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env.c index 95e455967d..4a3409a66f 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_create_extension.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_create_extension.c index d990a6933e..edbf63ea0a 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_create_extension.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_create_extension.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/go/interface/ten/common.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_destroy_extension.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_destroy_extension.c index 6d45f9c9ac..a8626c62d0 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_destroy_extension.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_addon_destroy_extension.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_create_instance_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_create_instance_done.c index 2979fb28a3..067b814e86 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_create_instance_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_create_instance_done.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/binding/go/extension_group/extension_group.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property.c index 34a9e10acd..fc77de3d12 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/value/value.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/binding/go/interface/ten/value.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property_async.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property_async.c index aa35ba6d09..bb7bb5c009 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property_async.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_get_property_async.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/value/value.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/binding/go/interface/ten/value.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_init_property.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_init_property.c index 0d51c26a1d..eca6af02f6 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_init_property.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_init_property.c @@ -6,7 +6,7 @@ #include "include_internal/ten_runtime/binding/go/internal/common.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/common/errno.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_internal.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_internal.c index 199ba4ef64..95eae82b0a 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_internal.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_internal.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_is_cmd_connected.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_is_cmd_connected.c index 73b26a363b..c41a31c321 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_is_cmd_connected.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_is_cmd_connected.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c index 6b00f793de..09a8891423 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_create_extension_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_create_extension_done.c index 288ab9f8e9..c523d31222 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_create_extension_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_create_extension_done.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_deinit_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_deinit_done.c index 73b7a0ca9b..1c047e9d1b 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_deinit_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_deinit_done.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/rwlock.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_delete_extension_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_delete_extension_done.c index cecf09f15b..a2ccaa7978 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_delete_extension_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_delete_extension_done.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_init_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_init_done.c index e67291f99b..1bc29ef572 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_init_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_init_done.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_start_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_start_done.c index 8e3e4007ba..a4aff463fd 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_start_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_start_done.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_stop_done.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_stop_done.c index 8ceb0ecc79..b4f269eb15 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_stop_done.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_on_stop_done.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_result.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_result.c index 0c3218b570..e2d7ff5af8 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_result.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_result.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_value.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_value.c index 5f13482c23..3c963732f3 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_value.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_return_value.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_return_result.h" #include "include_internal/ten_runtime/binding/go/value/value.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_audio_frame.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_audio_frame.c index 22248aa7cc..2609ad5008 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_audio_frame.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_audio_frame.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_cmd.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_cmd.c index ceeb73acc8..a63b809feb 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_cmd.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_cmd.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/binding/go/msg/msg.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_data.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_data.c index f6424f4622..fa98e0c88d 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_data.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_data.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_json.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_json.c index ef46bc7b18..bbeafd4e0b 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_json.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_json.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/binding/go/internal/json.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/common/errno.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_video_frame.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_video_frame.c index 716876ff37..f4c12cbc80 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_video_frame.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_send_video_frame.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/msg.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property.c index 79fe20ec09..1fbd4f26a2 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/value/value.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/binding/go/interface/ten/value.h" diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property_async.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property_async.c index 531e385fdb..b9dc00e43d 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property_async.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_set_property_async.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/binding/go/value/value.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" #include "ten_runtime/binding/go/interface/ten/value.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" diff --git a/core/src/ten_runtime/binding/go/native/value/value.c b/core/src/ten_runtime/binding/go/native/value/value.c index ba776cb801..fdaf8752f7 100644 --- a/core/src/ten_runtime/binding/go/native/value/value.c +++ b/core/src/ten_runtime/binding/go/native/value/value.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/go/internal/common.h" #include "include_internal/ten_runtime/binding/go/value/value.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_smart_ptr.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/common/errno.h" diff --git a/core/src/ten_runtime/binding/python/native/common/common.c b/core/src/ten_runtime/binding/python/native/common/common.c index 891c4858cc..14319fee38 100644 --- a/core/src/ten_runtime/binding/python/native/common/common.c +++ b/core/src/ten_runtime/binding/python/native/common/common.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/binding/python/common/common.h" #include "include_internal/ten_runtime/binding/python/common/python_stuff.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_str.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_runtime/binding/python/native/msg/audio_frame.c b/core/src/ten_runtime/binding/python/native/msg/audio_frame.c index 861f24b331..879784d6a5 100644 --- a/core/src/ten_runtime/binding/python/native/msg/audio_frame.c +++ b/core/src/ten_runtime/binding/python/native/msg/audio_frame.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/python/common/error.h" #include "include_internal/ten_runtime/binding/python/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "longobject.h" #include "object.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" diff --git a/core/src/ten_runtime/binding/python/native/msg/data.c b/core/src/ten_runtime/binding/python/native/msg/data.c index 69ba7b6124..9c291ee3be 100644 --- a/core/src/ten_runtime/binding/python/native/msg/data.c +++ b/core/src/ten_runtime/binding/python/native/msg/data.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/python/common/error.h" #include "include_internal/ten_runtime/binding/python/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "pyport.h" #include "ten_runtime/msg/data/data.h" #include "ten_runtime/msg/msg.h" diff --git a/core/src/ten_runtime/binding/python/native/msg/video_frame.c b/core/src/ten_runtime/binding/python/native/msg/video_frame.c index c14ccb6d13..80de66cecb 100644 --- a/core/src/ten_runtime/binding/python/native/msg/video_frame.c +++ b/core/src/ten_runtime/binding/python/native/msg/video_frame.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/python/common/error.h" #include "include_internal/ten_runtime/binding/python/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "memoryobject.h" #include "ten_runtime/msg/video_frame/video_frame.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env.c index 13cca648dc..00f57911f0 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/binding/python/common/error.h" #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "object.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_get_property.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_get_property.c index 29a064a8b6..a2e076077e 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_get_property.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_get_property.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/binding/python/common/error.h" #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c index 14c03c9146..13f48a1668 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" #include "include_internal/ten_runtime/ten_env/log.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" typedef struct ten_env_notify_log_info_t { diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_init_done.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_init_done.c index efc004c975..67d5ea9d28 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_init_done.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_on_init_done.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c index e4a65ed530..565ef63707 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_send_cmd.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/binding/python/msg/msg.h" #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" diff --git a/core/src/ten_runtime/common/binding.c b/core/src/ten_runtime/common/binding.c index 52d0f1dbd5..2cd99f2d9c 100644 --- a/core/src/ten_runtime/common/binding.c +++ b/core/src/ten_runtime/common/binding.c @@ -4,7 +4,7 @@ // information. // #include "include_internal/ten_runtime/binding/common.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" void ten_binding_handle_set_me_in_target_lang(ten_binding_handle_t *self, diff --git a/core/src/ten_runtime/common/closeable.c b/core/src/ten_runtime/common/closeable.c index 43fec22597..64c2d168f4 100644 --- a/core/src/ten_runtime/common/closeable.c +++ b/core/src/ten_runtime/common/closeable.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_runtime/common/closeable.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/container/list_node_ptr.h" diff --git a/core/src/ten_runtime/common/loc.c b/core/src/ten_runtime/common/loc.c index 905396ccd7..3194da182b 100644 --- a/core/src/ten_runtime/common/loc.c +++ b/core/src/ten_runtime/common/loc.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/extension/extension.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_runtime/connection/connection.c b/core/src/ten_runtime/connection/connection.c index d84e50d400..6b97f520e8 100644 --- a/core/src/ten_runtime/connection/connection.c +++ b/core/src/ten_runtime/connection/connection.c @@ -19,7 +19,7 @@ #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/remote/remote.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/connection/migration.c b/core/src/ten_runtime/connection/migration.c index 2659c400ae..4ddc70d78f 100644 --- a/core/src/ten_runtime/connection/migration.c +++ b/core/src/ten_runtime/connection/migration.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/engine/engine.h" #include "include_internal/ten_runtime/engine/internal/migration.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/ref.h" diff --git a/core/src/ten_runtime/engine/engine.c b/core/src/ten_runtime/engine/engine.c index 0adcbaa8fe..8cb5ef4707 100644 --- a/core/src/ten_runtime/engine/engine.c +++ b/core/src/ten_runtime/engine/engine.c @@ -18,7 +18,7 @@ #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/remote/remote.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/container/hash_table.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/engine/internal/close.c b/core/src/ten_runtime/engine/internal/close.c index 207fc137a3..2162a08bc7 100644 --- a/core/src/ten_runtime/engine/internal/close.c +++ b/core/src/ten_runtime/engine/internal/close.c @@ -16,7 +16,7 @@ #include "include_internal/ten_runtime/remote/remote.h" #include "include_internal/ten_runtime/timer/timer.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/hash_handle.h" #include "ten_utils/container/hash_table.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/engine/internal/extension_interface.c b/core/src/ten_runtime/engine/internal/extension_interface.c index 08904be03d..e4b71c0b9f 100644 --- a/core/src/ten_runtime/engine/internal/extension_interface.c +++ b/core/src/ten_runtime/engine/internal/extension_interface.c @@ -16,7 +16,7 @@ #include "include_internal/ten_runtime/extension_context/extension_context.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" diff --git a/core/src/ten_runtime/engine/internal/migration.c b/core/src/ten_runtime/engine/internal/migration.c index 9716c0e606..a3a15809d2 100644 --- a/core/src/ten_runtime/engine/internal/migration.c +++ b/core/src/ten_runtime/engine/internal/migration.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/engine/msg_interface/common.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/engine/internal/remote_interface.c b/core/src/ten_runtime/engine/internal/remote_interface.c index 41921e2770..1ff8378f9e 100644 --- a/core/src/ten_runtime/engine/internal/remote_interface.c +++ b/core/src/ten_runtime/engine/internal/remote_interface.c @@ -20,7 +20,7 @@ #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/remote/remote.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" diff --git a/core/src/ten_runtime/engine/internal/thread.c b/core/src/ten_runtime/engine/internal/thread.c index fca3013c31..34fbfb6aa7 100644 --- a/core/src/ten_runtime/engine/internal/thread.c +++ b/core/src/ten_runtime/engine/internal/thread.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/connection/connection.h" #include "include_internal/ten_runtime/engine/engine.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/event.h" diff --git a/core/src/ten_runtime/engine/msg_interface/close_app.c b/core/src/ten_runtime/engine/msg_interface/close_app.c index 48f7e34ea1..f656e89c1b 100644 --- a/core/src/ten_runtime/engine/msg_interface/close_app.c +++ b/core/src/ten_runtime/engine/msg_interface/close_app.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/engine/engine.h" #include "include_internal/ten_runtime/engine/internal/thread.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/engine/msg_interface/close_engine.c b/core/src/ten_runtime/engine/msg_interface/close_engine.c index 641b98a682..b9a647128c 100644 --- a/core/src/ten_runtime/engine/msg_interface/close_engine.c +++ b/core/src/ten_runtime/engine/msg_interface/close_engine.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/stop_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/remote/remote.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/engine/msg_interface/cmd_result.c b/core/src/ten_runtime/engine/msg_interface/cmd_result.c index df3d78558b..afc1a7fd66 100644 --- a/core/src/ten_runtime/engine/msg_interface/cmd_result.c +++ b/core/src/ten_runtime/engine/msg_interface/cmd_result.c @@ -20,7 +20,7 @@ #include "include_internal/ten_runtime/path/path_table.h" #include "include_internal/ten_runtime/remote/remote.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/src/ten_runtime/engine/msg_interface/common.c b/core/src/ten_runtime/engine/msg_interface/common.c index 37d1ba8525..236dc10dde 100644 --- a/core/src/ten_runtime/engine/msg_interface/common.c +++ b/core/src/ten_runtime/engine/msg_interface/common.c @@ -23,7 +23,7 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/msg_info.h" #include "include_internal/ten_runtime/remote/remote.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" diff --git a/core/src/ten_runtime/engine/msg_interface/start_graph.c b/core/src/ten_runtime/engine/msg_interface/start_graph.c index fdb365bf2a..de8b51b9d3 100644 --- a/core/src/ten_runtime/engine/msg_interface/start_graph.c +++ b/core/src/ten_runtime/engine/msg_interface/start_graph.c @@ -18,7 +18,7 @@ #include "include_internal/ten_runtime/path/path_group.h" #include "include_internal/ten_runtime/remote/remote.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/engine/msg_interface/timer.c b/core/src/ten_runtime/engine/msg_interface/timer.c index aaa4884aa7..da27d8e02c 100644 --- a/core/src/ten_runtime/engine/msg_interface/timer.c +++ b/core/src/ten_runtime/engine/msg_interface/timer.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/timer/timer.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/timer/timer.h" diff --git a/core/src/ten_runtime/engine/on_xxx.c b/core/src/ten_runtime/engine/on_xxx.c index 1c90e50d05..72f3a06b4f 100644 --- a/core/src/ten_runtime/engine/on_xxx.c +++ b/core/src/ten_runtime/engine/on_xxx.c @@ -17,7 +17,7 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/extension/extension.c b/core/src/ten_runtime/extension/extension.c index e633632302..d5433c8483 100644 --- a/core/src/ten_runtime/extension/extension.c +++ b/core/src/ten_runtime/extension/extension.c @@ -31,7 +31,7 @@ #include "include_internal/ten_runtime/schema_store/store.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/addon/addon.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" diff --git a/core/src/ten_runtime/extension/extension_hdr.c b/core/src/ten_runtime/extension/extension_hdr.c index 2641b457d1..b422f7ae02 100644 --- a/core/src/ten_runtime/extension/extension_hdr.c +++ b/core/src/ten_runtime/extension/extension_hdr.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_runtime/extension/extension_hdr.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/macro/memory.h" diff --git a/core/src/ten_runtime/extension/extension_info/extension_info.c b/core/src/ten_runtime/extension/extension_info/extension_info.c index c9cd686f13..9e1fb72a0e 100644 --- a/core/src/ten_runtime/extension/extension_info/extension_info.c +++ b/core/src/ten_runtime/extension/extension_info/extension_info.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/extension/msg_dest_info/msg_dest_info.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_conversion.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" diff --git a/core/src/ten_runtime/extension/extension_info/json.c b/core/src/ten_runtime/extension/extension_info/json.c index ceda3c3659..7b93ec614c 100644 --- a/core/src/ten_runtime/extension/extension_info/json.c +++ b/core/src/ten_runtime/extension/extension_info/json.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/extension/msg_dest_info/json.h" #include "include_internal/ten_runtime/extension/msg_dest_info/msg_dest_info.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_conversion.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/extension/extension_info/value.c b/core/src/ten_runtime/extension/extension_info/value.c index c242cc69dd..8aa627fc04 100644 --- a/core/src/ten_runtime/extension/extension_info/value.c +++ b/core/src/ten_runtime/extension/extension_info/value.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/extension/extension_info/json.h" #include "include_internal/ten_runtime/extension/msg_dest_info/value.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_conversion.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/value/value_merge.h" #include "ten_utils/value/value_object.h" diff --git a/core/src/ten_runtime/extension/internal/extension_cb_default.c b/core/src/ten_runtime/extension/internal/extension_cb_default.c index 294c1a01b3..4a7c998eb6 100644 --- a/core/src/ten_runtime/extension/internal/extension_cb_default.c +++ b/core/src/ten_runtime/extension/internal/extension_cb_default.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_runtime/extension/extension_cb_default.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" diff --git a/core/src/ten_runtime/extension/internal/metadata.c b/core/src/ten_runtime/extension/internal/metadata.c index 2ba3969124..191f487efd 100644 --- a/core/src/ten_runtime/extension/internal/metadata.c +++ b/core/src/ten_runtime/extension/internal/metadata.c @@ -15,7 +15,7 @@ #include "include_internal/ten_runtime/extension/ten_env/metadata.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_utils/lib/placeholder.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/string.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" diff --git a/core/src/ten_runtime/extension/msg_dest_info/all_msg_type_dest_info.c b/core/src/ten_runtime/extension/msg_dest_info/all_msg_type_dest_info.c index 85b48f51fb..a1d8e8f402 100644 --- a/core/src/ten_runtime/extension/msg_dest_info/all_msg_type_dest_info.c +++ b/core/src/ten_runtime/extension/msg_dest_info/all_msg_type_dest_info.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/extension/extension_hdr.h" #include "include_internal/ten_runtime/extension/msg_dest_info/msg_dest_info.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_utils/container/list_ptr.h" #include "ten_utils/container/list_smart_ptr.h" diff --git a/core/src/ten_runtime/extension/msg_dest_info/json.c b/core/src/ten_runtime/extension/msg_dest_info/json.c index 1db2f9b4a1..6d72ee0c9a 100644 --- a/core/src/ten_runtime/extension/msg_dest_info/json.c +++ b/core/src/ten_runtime/extension/msg_dest_info/json.c @@ -13,7 +13,7 @@ #include "include_internal/ten_runtime/extension/msg_dest_info/msg_dest_info.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion_operation.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_conversion.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_runtime/extension/msg_dest_info/msg_dest_info.c b/core/src/ten_runtime/extension/msg_dest_info/msg_dest_info.c index 5c3d33c769..8eda7a3d5b 100644 --- a/core/src/ten_runtime/extension/msg_dest_info/msg_dest_info.c +++ b/core/src/ten_runtime/extension/msg_dest_info/msg_dest_info.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/extension/extension_info/extension_info.h" #include "include_internal/ten_runtime/extension/extension_info/json.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list_node_smart_ptr.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/src/ten_runtime/extension/msg_dest_info/value.c b/core/src/ten_runtime/extension/msg_dest_info/value.c index 70b97e446a..511986db96 100644 --- a/core/src/ten_runtime/extension/msg_dest_info/value.c +++ b/core/src/ten_runtime/extension/msg_dest_info/value.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/extension/extension_info/extension_info.h" #include "include_internal/ten_runtime/extension/extension_info/value.h" #include "include_internal/ten_runtime/extension/msg_dest_info/msg_dest_info.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" // Parse the following snippet. // diff --git a/core/src/ten_runtime/extension/msg_handling.c b/core/src/ten_runtime/extension/msg_handling.c index 7ae4ec701e..ee9f38fd7b 100644 --- a/core/src/ten_runtime/extension/msg_handling.c +++ b/core/src/ten_runtime/extension/msg_handling.c @@ -20,7 +20,7 @@ #include "include_internal/ten_runtime/path/path_group.h" #include "include_internal/ten_runtime/path/path_table.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/ten_env/internal/return.h" diff --git a/core/src/ten_runtime/extension/ten_env/metadata.c b/core/src/ten_runtime/extension/ten_env/metadata.c index 1c7c789440..e8712e86ec 100644 --- a/core/src/ten_runtime/extension/ten_env/metadata.c +++ b/core/src/ten_runtime/extension/ten_env/metadata.c @@ -13,7 +13,7 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/schema_store/store.h" #include "include_internal/ten_runtime/ten_env/metadata_cb.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_runtime/extension/ten_env/on_xxx.c b/core/src/ten_runtime/extension/ten_env/on_xxx.c index 6405e9ce6c..25f5e961f8 100644 --- a/core/src/ten_runtime/extension/ten_env/on_xxx.c +++ b/core/src/ten_runtime/extension/ten_env/on_xxx.c @@ -14,7 +14,7 @@ #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" static ten_extension_on_init_done_t *ten_extension_on_init_done_create( diff --git a/core/src/ten_runtime/extension/ten_extension_addon_and_instance_name_pair.c b/core/src/ten_runtime/extension/ten_extension_addon_and_instance_name_pair.c index 629b6c5f76..a2b59d36d4 100644 --- a/core/src/ten_runtime/extension/ten_extension_addon_and_instance_name_pair.c +++ b/core/src/ten_runtime/extension/ten_extension_addon_and_instance_name_pair.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/extension/extension_addon_and_instance_name_pair.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/extension_context/extension_context.c b/core/src/ten_runtime/extension_context/extension_context.c index 8d03f19bcb..349d537e98 100644 --- a/core/src/ten_runtime/extension_context/extension_context.c +++ b/core/src/ten_runtime/extension_context/extension_context.c @@ -26,7 +26,7 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/core/src/ten_runtime/extension_context/internal/add_extension.c b/core/src/ten_runtime/extension_context/internal/add_extension.c index fff9052d52..6710045079 100644 --- a/core/src/ten_runtime/extension_context/internal/add_extension.c +++ b/core/src/ten_runtime/extension_context/internal/add_extension.c @@ -13,7 +13,7 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/extension_context/internal/del_extension.c b/core/src/ten_runtime/extension_context/internal/del_extension.c index d659dfd702..36317894ec 100644 --- a/core/src/ten_runtime/extension_context/internal/del_extension.c +++ b/core/src/ten_runtime/extension_context/internal/del_extension.c @@ -14,7 +14,7 @@ #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" void ten_extension_context_delete_extension(void *self_, void *arg) { diff --git a/core/src/ten_runtime/extension_context/internal/extension_group_is_inited.c b/core/src/ten_runtime/extension_context/internal/extension_group_is_inited.c index 74bdbb0f3b..b58cb22e0c 100644 --- a/core/src/ten_runtime/extension_context/internal/extension_group_is_inited.c +++ b/core/src/ten_runtime/extension_context/internal/extension_group_is_inited.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" diff --git a/core/src/ten_runtime/extension_context/internal/extension_group_is_stopped.c b/core/src/ten_runtime/extension_context/internal/extension_group_is_stopped.c index bfcca304ac..20761c59ec 100644 --- a/core/src/ten_runtime/extension_context/internal/extension_group_is_stopped.c +++ b/core/src/ten_runtime/extension_context/internal/extension_group_is_stopped.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" diff --git a/core/src/ten_runtime/extension_context/internal/extension_thread_is_closing.c b/core/src/ten_runtime/extension_context/internal/extension_thread_is_closing.c index 1dff1115ac..18883c3cc4 100644 --- a/core/src/ten_runtime/extension_context/internal/extension_thread_is_closing.c +++ b/core/src/ten_runtime/extension_context/internal/extension_thread_is_closing.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" diff --git a/core/src/ten_runtime/extension_context/ten_env/on_xxx.c b/core/src/ten_runtime/extension_context/ten_env/on_xxx.c index ea59e0d759..f5e0152340 100644 --- a/core/src/ten_runtime/extension_context/ten_env/on_xxx.c +++ b/core/src/ten_runtime/extension_context/ten_env/on_xxx.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/engine/engine.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" diff --git a/core/src/ten_runtime/extension_group/extension_group.c b/core/src/ten_runtime/extension_group/extension_group.c index 6f81b3ddb8..07c5bd5a16 100644 --- a/core/src/ten_runtime/extension_group/extension_group.c +++ b/core/src/ten_runtime/extension_group/extension_group.c @@ -15,7 +15,7 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" diff --git a/core/src/ten_runtime/extension_group/extension_group_info/extension_group_info.c b/core/src/ten_runtime/extension_group/extension_group_info/extension_group_info.c index 077aab6b56..a7ae5d1a23 100644 --- a/core/src/ten_runtime/extension_group/extension_group_info/extension_group_info.c +++ b/core/src/ten_runtime/extension_group/extension_group_info/extension_group_info.c @@ -8,7 +8,7 @@ #include #include "include_internal/ten_runtime/common/loc.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/signature.h" diff --git a/core/src/ten_runtime/extension_group/extension_group_info/json.c b/core/src/ten_runtime/extension_group/extension_group_info/json.c index 8c159fa8b9..d3d7b98317 100644 --- a/core/src/ten_runtime/extension_group/extension_group_info/json.c +++ b/core/src/ten_runtime/extension_group/extension_group_info/json.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/extension_group/extension_group_info/extension_group_info.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_runtime/extension_group/extension_group_info/value.c b/core/src/ten_runtime/extension_group/extension_group_info/value.c index c293d4251b..34035c893a 100644 --- a/core/src/ten_runtime/extension_group/extension_group_info/value.c +++ b/core/src/ten_runtime/extension_group/extension_group_info/value.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/extension/extension_info/extension_info.h" #include "include_internal/ten_runtime/extension_group/extension_group_info/extension_group_info.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/value/value_merge.h" #include "ten_utils/value/value_object.h" diff --git a/core/src/ten_runtime/extension_group/internal/metadata.c b/core/src/ten_runtime/extension_group/internal/metadata.c index 786b8e89db..561e1699ca 100644 --- a/core/src/ten_runtime/extension_group/internal/metadata.c +++ b/core/src/ten_runtime/extension_group/internal/metadata.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/extension_group/on_xxx.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" void ten_extension_group_load_metadata(ten_extension_group_t *self) { TEN_ASSERT(self && diff --git a/core/src/ten_runtime/extension_group/ten_env/metadata.c b/core/src/ten_runtime/extension_group/ten_env/metadata.c index bdb01c324f..508ec3b8b1 100644 --- a/core/src/ten_runtime/extension_group/ten_env/metadata.c +++ b/core/src/ten_runtime/extension_group/ten_env/metadata.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/app/ten_env/metadata.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" bool ten_extension_group_set_property(ten_extension_group_t *extension_group, diff --git a/core/src/ten_runtime/extension_group/ten_env/on_xxx.c b/core/src/ten_runtime/extension_group/ten_env/on_xxx.c index a62a6c0bca..b9a9bb168c 100644 --- a/core/src/ten_runtime/extension_group/ten_env/on_xxx.c +++ b/core/src/ten_runtime/extension_group/ten_env/on_xxx.c @@ -16,7 +16,7 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/extension_store/extension_store.c b/core/src/ten_runtime/extension_store/extension_store.c index a6290807e3..8641dd8aff 100644 --- a/core/src/ten_runtime/extension_store/extension_store.c +++ b/core/src/ten_runtime/extension_store/extension_store.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/hash_table.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_runtime/extension_thread/extension_thread.c b/core/src/ten_runtime/extension_thread/extension_thread.c index dbffc799d2..14a1e6c38b 100644 --- a/core/src/ten_runtime/extension_thread/extension_thread.c +++ b/core/src/ten_runtime/extension_thread/extension_thread.c @@ -23,7 +23,7 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/sanitizer/thread_check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/core/src/ten_runtime/extension_thread/msg_interface/common.c b/core/src/ten_runtime/extension_thread/msg_interface/common.c index 1b775c4ef0..453504e804 100644 --- a/core/src/ten_runtime/extension_thread/msg_interface/common.c +++ b/core/src/ten_runtime/extension_thread/msg_interface/common.c @@ -20,7 +20,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" diff --git a/core/src/ten_runtime/extension_thread/on_xxx.c b/core/src/ten_runtime/extension_thread/on_xxx.c index 538416feb2..6b83bc1697 100644 --- a/core/src/ten_runtime/extension_thread/on_xxx.c +++ b/core/src/ten_runtime/extension_thread/on_xxx.c @@ -38,7 +38,7 @@ #include "include_internal/ten_runtime/schema_store/store.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/global/signal.c b/core/src/ten_runtime/global/signal.c index 40dbef5246..9b33416d14 100644 --- a/core/src/ten_runtime/global/signal.c +++ b/core/src/ten_runtime/global/signal.c @@ -13,7 +13,7 @@ #include "include_internal/ten_runtime/app/close.h" #include "include_internal/ten_runtime/global/global.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/metadata/metadata.c b/core/src/ten_runtime/metadata/metadata.c index e70aeff971..831c4865f9 100644 --- a/core/src/ten_runtime/metadata/metadata.c +++ b/core/src/ten_runtime/metadata/metadata.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/schema_store/store.h" #include "include_internal/ten_rust/ten_rust.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_runtime/metadata/metadata_info.c b/core/src/ten_runtime/metadata/metadata_info.c index 35820725fb..5651a2f09f 100644 --- a/core/src/ten_runtime/metadata/metadata_info.c +++ b/core/src/ten_runtime/metadata/metadata_info.c @@ -15,7 +15,7 @@ #include "include_internal/ten_runtime/metadata/default/default.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_runtime/msg/audio_frame/field/bytes_per_sample.c b/core/src/ten_runtime/msg/audio_frame/field/bytes_per_sample.c index f13c87ff00..b0115705cd 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/bytes_per_sample.c +++ b/core/src/ten_runtime/msg/audio_frame/field/bytes_per_sample.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/audio_frame/field/channel_layout.c b/core/src/ten_runtime/msg/audio_frame/field/channel_layout.c index 8b2cc10e87..e68979979f 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/channel_layout.c +++ b/core/src/ten_runtime/msg/audio_frame/field/channel_layout.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/audio_frame/field/data_fmt.c b/core/src/ten_runtime/msg/audio_frame/field/data_fmt.c index 7c28cfbae7..85357ca79f 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/data_fmt.c +++ b/core/src/ten_runtime/msg/audio_frame/field/data_fmt.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/audio_frame/field/line_size.c b/core/src/ten_runtime/msg/audio_frame/field/line_size.c index 396dafe776..0d196fbe52 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/line_size.c +++ b/core/src/ten_runtime/msg/audio_frame/field/line_size.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/audio_frame/field/number_of_channel.c b/core/src/ten_runtime/msg/audio_frame/field/number_of_channel.c index 9f6eb4c314..9963c7b4fd 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/number_of_channel.c +++ b/core/src/ten_runtime/msg/audio_frame/field/number_of_channel.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/audio_frame/field/sample_rate.c b/core/src/ten_runtime/msg/audio_frame/field/sample_rate.c index 8f57b54015..149df24a3c 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/sample_rate.c +++ b/core/src/ten_runtime/msg/audio_frame/field/sample_rate.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/audio_frame/field/samples_per_channel.c b/core/src/ten_runtime/msg/audio_frame/field/samples_per_channel.c index e9acac49ea..94bb2ef79b 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/samples_per_channel.c +++ b/core/src/ten_runtime/msg/audio_frame/field/samples_per_channel.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/audio_frame/field/timestamp.c b/core/src/ten_runtime/msg/audio_frame/field/timestamp.c index df4d8a28b4..2cb992996c 100644 --- a/core/src/ten_runtime/msg/audio_frame/field/timestamp.c +++ b/core/src/ten_runtime/msg/audio_frame/field/timestamp.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/audio_frame/pcm_frame.c b/core/src/ten_runtime/msg/audio_frame/pcm_frame.c index 799778c44a..dd745fcb32 100644 --- a/core/src/ten_runtime/msg/audio_frame/pcm_frame.c +++ b/core/src/ten_runtime/msg/audio_frame/pcm_frame.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/msg/audio_frame/audio_frame.h" #include "include_internal/ten_runtime/msg/audio_frame/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "include_internal/ten_utils/value/value_set.h" #include "ten_runtime/common/errno.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/close_app/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/close_app/cmd.c index 92f4a35477..c709696003 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/close_app/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/close_app/cmd.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/close_app/field/field_info.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/cmd.c index 2890b0fdc8..230ea6ba16 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/cmd.c @@ -14,7 +14,7 @@ #include "include_internal/ten_runtime/msg/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/msg_info.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/cmd/cmd.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/custom/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/custom/cmd.c index 0482e36e53..586e1085c5 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/custom/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/custom/cmd.c @@ -14,7 +14,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/custom/field/field_info.h" #include "include_internal/ten_runtime/msg/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.c index 0595f984e6..ae6a82e666 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.c @@ -21,7 +21,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/extension_info.c b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/extension_info.c index 153c8d8eb0..abc7ae7e78 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/extension_info.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/extension_info.c @@ -17,7 +17,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/cmd/start_graph/cmd.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/long_running_mode.c b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/long_running_mode.c index 888bf7d498..2823902dcf 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/long_running_mode.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/long_running_mode.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/cmd/start_graph/cmd.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/predefined_graph_name.c b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/predefined_graph_name.c index ce71f629ac..cf29972783 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/predefined_graph_name.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/predefined_graph_name.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/cmd/start_graph/cmd.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/cmd.c index 9a7440d4e3..c5277eb20c 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/cmd.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/stop_graph/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/cmd/stop_graph/cmd.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/field/graph_name.c b/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/field/graph_name.c index 7919b510d7..8f005cf8f0 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/field/graph_name.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/field/graph_name.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/stop_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timeout/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/timeout/cmd.c index fae2bfbe6f..b418bcf064 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timeout/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timeout/cmd.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timeout/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timeout/field/timer_id.c b/core/src/ten_runtime/msg/cmd_base/cmd/timeout/field/timer_id.c index 0a00be6d22..939ebc6e0e 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timeout/field/timer_id.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timeout/field/timer_id.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timer/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/timer/cmd.c index 29a9e6d5f7..769a1817b8 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timer/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timer/cmd.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timeout_in_us.c b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timeout_in_us.c index e0b95a8147..c1152f4d98 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timeout_in_us.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timeout_in_us.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timer_id.c b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timer_id.c index 33899e3c0e..c1f32e2721 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timer_id.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timer_id.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/times.c b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/times.c index 289c1bc09e..9b77169f63 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/times.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/times.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd_base.c b/core/src/ten_runtime/msg/cmd_base/cmd_base.c index de0fb22e53..7b4ff3a835 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd_base.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd_base.c @@ -14,7 +14,7 @@ #include "include_internal/ten_runtime/msg/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/remote/remote.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd_result/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd_result/cmd.c index e8e6d069db..5a8fa10bd7 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd_result/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd_result/cmd.c @@ -16,7 +16,7 @@ #include "include_internal/ten_runtime/schema_store/cmd.h" #include "include_internal/ten_runtime/schema_store/msg.h" #include "include_internal/ten_runtime/schema_store/store.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd_result/field/original_cmd_type.c b/core/src/ten_runtime/msg/cmd_base/cmd_result/field/original_cmd_type.c index f7df1d20f0..25ac42061d 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd_result/field/original_cmd_type.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd_result/field/original_cmd_type.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_result/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/lib/json.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd_result/field/status_code.c b/core/src/ten_runtime/msg/cmd_base/cmd_result/field/status_code.c index 9da076b2fd..c210776872 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd_result/field/status_code.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd_result/field/status_code.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_result/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/cmd_base/field/cmd_id.c b/core/src/ten_runtime/msg/cmd_base/field/cmd_id.c index a72449e560..32cad4b6e0 100644 --- a/core/src/ten_runtime/msg/cmd_base/field/cmd_id.c +++ b/core/src/ten_runtime/msg/cmd_base/field/cmd_id.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/cmd_base/field/original_connection.c b/core/src/ten_runtime/msg/cmd_base/field/original_connection.c index 72be335ef7..001697ff03 100644 --- a/core/src/ten_runtime/msg/cmd_base/field/original_connection.c +++ b/core/src/ten_runtime/msg/cmd_base/field/original_connection.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/string.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/cmd_base/field/response_handler.c b/core/src/ten_runtime/msg/cmd_base/field/response_handler.c index 516acc285a..058ff2d4c5 100644 --- a/core/src/ten_runtime/msg/cmd_base/field/response_handler.c +++ b/core/src/ten_runtime/msg/cmd_base/field/response_handler.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/string.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/cmd_base/field/response_handler_data.c b/core/src/ten_runtime/msg/cmd_base/field/response_handler_data.c index 1903e10c1d..dbf88fb71a 100644 --- a/core/src/ten_runtime/msg/cmd_base/field/response_handler_data.c +++ b/core/src/ten_runtime/msg/cmd_base/field/response_handler_data.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/string.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/cmd_base/field/seq_id.c b/core/src/ten_runtime/msg/cmd_base/field/seq_id.c index 43f9f7b41a..8f0533dfa2 100644 --- a/core/src/ten_runtime/msg/cmd_base/field/seq_id.c +++ b/core/src/ten_runtime/msg/cmd_base/field/seq_id.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/data/data.c b/core/src/ten_runtime/msg/data/data.c index 1a9604af6f..5235847316 100644 --- a/core/src/ten_runtime/msg/data/data.c +++ b/core/src/ten_runtime/msg/data/data.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/msg/data/field/field_info.h" #include "include_internal/ten_runtime/msg/locked_res.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_runtime/msg/field/dest.c b/core/src/ten_runtime/msg/field/dest.c index 0591fa0e5c..c9d1d95bde 100644 --- a/core/src/ten_runtime/msg/field/dest.c +++ b/core/src/ten_runtime/msg/field/dest.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/common/loc.h" #include "include_internal/ten_runtime/extension/extension_info/extension_info.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/field/name.c b/core/src/ten_runtime/msg/field/name.c index 0b957b0f93..ebc2d5b989 100644 --- a/core/src/ten_runtime/msg/field/name.c +++ b/core/src/ten_runtime/msg/field/name.c @@ -6,7 +6,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/field/properties.c b/core/src/ten_runtime/msg/field/properties.c index 2c370d3e2d..a225f5e109 100644 --- a/core/src/ten_runtime/msg/field/properties.c +++ b/core/src/ten_runtime/msg/field/properties.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" diff --git a/core/src/ten_runtime/msg/field/src.c b/core/src/ten_runtime/msg/field/src.c index c901306419..e8854822f3 100644 --- a/core/src/ten_runtime/msg/field/src.c +++ b/core/src/ten_runtime/msg/field/src.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/common/loc.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/field/type.c b/core/src/ten_runtime/msg/field/type.c index 725463c1cd..e2fbfddc7b 100644 --- a/core/src/ten_runtime/msg/field/type.c +++ b/core/src/ten_runtime/msg/field/type.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/msg/locked_res.c b/core/src/ten_runtime/msg/locked_res.c index 5c148e9f15..2bab2a22ab 100644 --- a/core/src/ten_runtime/msg/locked_res.c +++ b/core/src/ten_runtime/msg/locked_res.c @@ -6,7 +6,7 @@ #include "include_internal/ten_runtime/msg/locked_res.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_ptr.h" diff --git a/core/src/ten_runtime/msg/msg.c b/core/src/ten_runtime/msg/msg.c index 05de597927..c0cda1eed1 100644 --- a/core/src/ten_runtime/msg/msg.c +++ b/core/src/ten_runtime/msg/msg.c @@ -23,7 +23,7 @@ #include "include_internal/ten_runtime/msg/msg_info.h" #include "include_internal/ten_runtime/schema_store/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" diff --git a/core/src/ten_runtime/msg/video_frame/field/height.c b/core/src/ten_runtime/msg/video_frame/field/height.c index 02b4a99002..d716976c41 100644 --- a/core/src/ten_runtime/msg/video_frame/field/height.c +++ b/core/src/ten_runtime/msg/video_frame/field/height.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/video_frame/video_frame.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/msg.h" #include "ten_runtime/msg/video_frame/video_frame.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/video_frame/field/pixel_fmt.c b/core/src/ten_runtime/msg/video_frame/field/pixel_fmt.c index ac67aaa3f8..c7ca7aff90 100644 --- a/core/src/ten_runtime/msg/video_frame/field/pixel_fmt.c +++ b/core/src/ten_runtime/msg/video_frame/field/pixel_fmt.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/video_frame/video_frame.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/msg.h" #include "ten_runtime/msg/video_frame/video_frame.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/video_frame/field/timestamp.c b/core/src/ten_runtime/msg/video_frame/field/timestamp.c index 60c98b385b..813ce257a9 100644 --- a/core/src/ten_runtime/msg/video_frame/field/timestamp.c +++ b/core/src/ten_runtime/msg/video_frame/field/timestamp.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/video_frame/video_frame.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/msg.h" #include "ten_runtime/msg/video_frame/video_frame.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/video_frame/field/width.c b/core/src/ten_runtime/msg/video_frame/field/width.c index 8e21312e88..8d5be94a42 100644 --- a/core/src/ten_runtime/msg/video_frame/field/width.c +++ b/core/src/ten_runtime/msg/video_frame/field/width.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/video_frame/video_frame.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/msg.h" #include "ten_runtime/msg/video_frame/video_frame.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg/video_frame/video_frame.c b/core/src/ten_runtime/msg/video_frame/video_frame.c index b42c819751..dff495decc 100644 --- a/core/src/ten_runtime/msg/video_frame/video_frame.c +++ b/core/src/ten_runtime/msg/video_frame/video_frame.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg/video_frame/field/field_info.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "include_internal/ten_utils/value/value_set.h" #include "ten_runtime/common/errno.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion.c b/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion.c index 729acb8c5d..8be84e1c46 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion.c @@ -6,7 +6,7 @@ #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion_operation.c b/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion_operation.c index 361b2ad550..154b669e21 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion_operation.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion_operation.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/base.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion/msg_conversion.c b/core/src/ten_runtime/msg_conversion/msg_conversion/msg_conversion.c index ad8ae363f2..d3ed3a8b50 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion/msg_conversion.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion/msg_conversion.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion/msg_and_result_conversion_operation.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/base.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/base.c b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/base.c index eeb0607521..ddf48ad38f 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/base.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/base.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/per_property/per_property.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/fixed_value.c b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/fixed_value.c index f154f26bee..2d76ab32fa 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/fixed_value.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/fixed_value.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/field/properties.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_convert.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/from_original.c b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/from_original.c index 26b65c0863..df2281dd91 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/from_original.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/from_original.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/field/properties.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/per_property.c b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/per_property.c index a5e0775771..46f5595a11 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/per_property.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/per_property.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/base.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rules.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/json.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rule.c b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rule.c index 4bd817899b..fe08821ede 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rule.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rule.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/per_property/fixed_value.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rules.c b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rules.c index ff415074da..99df56d4fb 100644 --- a/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rules.c +++ b/core/src/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rules.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/msg/field/field_info.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/per_property/rule.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_runtime/path/path.c b/core/src/ten_runtime/path/path.c index 316ad4e9c6..af6a381153 100644 --- a/core/src/ten_runtime/path/path.c +++ b/core/src/ten_runtime/path/path.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/msg_conversion/msg_conversion_operation/base.h" #include "include_internal/ten_runtime/path/path_group.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_runtime/path/path_group.c b/core/src/ten_runtime/path/path_group.c index 2982ebdfc9..859d5db094 100644 --- a/core/src/ten_runtime/path/path_group.c +++ b/core/src/ten_runtime/path/path_group.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/path/path.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/path/path_in.c b/core/src/ten_runtime/path/path_in.c index a756af302c..947ac68210 100644 --- a/core/src/ten_runtime/path/path_in.c +++ b/core/src/ten_runtime/path/path_in.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/path/path.h" #include "include_internal/ten_runtime/path/path_table.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" ten_path_in_t *ten_path_in_create( diff --git a/core/src/ten_runtime/path/path_out.c b/core/src/ten_runtime/path/path_out.c index ac123aaf08..df23bfbbe4 100644 --- a/core/src/ten_runtime/path/path_out.c +++ b/core/src/ten_runtime/path/path_out.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_runtime/path/path_out.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" ten_path_out_t *ten_path_out_create( diff --git a/core/src/ten_runtime/path/path_table.c b/core/src/ten_runtime/path/path_table.c index c9bca9642d..9afae00763 100644 --- a/core/src/ten_runtime/path/path_table.c +++ b/core/src/ten_runtime/path/path_table.c @@ -21,7 +21,7 @@ #include "include_internal/ten_runtime/path/path_group.h" #include "include_internal/ten_runtime/path/path_in.h" #include "include_internal/ten_runtime/path/path_out.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_runtime/protocol/asynced/external.c b/core/src/ten_runtime/protocol/asynced/external.c index 897e52a462..56fee5e09b 100644 --- a/core/src/ten_runtime/protocol/asynced/external.c +++ b/core/src/ten_runtime/protocol/asynced/external.c @@ -7,7 +7,7 @@ #include "include_internal/ten_runtime/protocol/asynced/internal.h" #include "include_internal/ten_runtime/protocol/asynced/protocol_asynced.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/ref.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/protocol/asynced/internal.c b/core/src/ten_runtime/protocol/asynced/internal.c index 51f5b127df..c061dbb949 100644 --- a/core/src/ten_runtime/protocol/asynced/internal.c +++ b/core/src/ten_runtime/protocol/asynced/internal.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/protocol/asynced/protocol_asynced.h" #include "include_internal/ten_runtime/protocol/close.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/ref.h" #include "ten_utils/macro/field.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/protocol/asynced/protocol_asynced.c b/core/src/ten_runtime/protocol/asynced/protocol_asynced.c index 0858801899..04b56c4ab1 100644 --- a/core/src/ten_runtime/protocol/asynced/protocol_asynced.c +++ b/core/src/ten_runtime/protocol/asynced/protocol_asynced.c @@ -21,7 +21,7 @@ #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/remote/remote.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/protocol/close.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/protocol/close.c b/core/src/ten_runtime/protocol/close.c index 627d6bf12c..6d6782dd82 100644 --- a/core/src/ten_runtime/protocol/close.c +++ b/core/src/ten_runtime/protocol/close.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/closeable.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/protocol/context.c b/core/src/ten_runtime/protocol/context.c index 8e329fd025..75d523e8dd 100644 --- a/core/src/ten_runtime/protocol/context.c +++ b/core/src/ten_runtime/protocol/context.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/protocol/context_store.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/ref.h" diff --git a/core/src/ten_runtime/protocol/context_store.c b/core/src/ten_runtime/protocol/context_store.c index d37c2f4319..f57a31774d 100644 --- a/core/src/ten_runtime/protocol/context_store.c +++ b/core/src/ten_runtime/protocol/context_store.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/protocol/context.h" #include "include_internal/ten_runtime/protocol/context_store.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/protocol/context.h" #include "ten_utils/container/hash_table.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_runtime/protocol/integrated/close.c b/core/src/ten_runtime/protocol/integrated/close.c index ef6855ffed..4233d15b33 100644 --- a/core/src/ten_runtime/protocol/integrated/close.c +++ b/core/src/ten_runtime/protocol/integrated/close.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/protocol/integrated/protocol_integrated.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/io/stream.h" // The principle is very simple. As long as the integrated protocol still has diff --git a/core/src/ten_runtime/protocol/integrated/protocol_integrated.c b/core/src/ten_runtime/protocol/integrated/protocol_integrated.c index 0dcb22c72a..1e5b4320c6 100644 --- a/core/src/ten_runtime/protocol/integrated/protocol_integrated.c +++ b/core/src/ten_runtime/protocol/integrated/protocol_integrated.c @@ -23,7 +23,7 @@ #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/remote/remote.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/protocol/close.h" #include "ten_utils/container/list.h" #include "ten_utils/io/runloop.h" diff --git a/core/src/ten_runtime/protocol/protocol.c b/core/src/ten_runtime/protocol/protocol.c index 6fa229f8ba..684a10ec01 100644 --- a/core/src/ten_runtime/protocol/protocol.c +++ b/core/src/ten_runtime/protocol/protocol.c @@ -18,7 +18,7 @@ #include "include_internal/ten_runtime/protocol/close.h" #include "include_internal/ten_runtime/remote/remote.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/addon/addon.h" #include "ten_runtime/app/app.h" #include "ten_runtime/protocol/close.h" diff --git a/core/src/ten_runtime/remote/remote.c b/core/src/ten_runtime/remote/remote.c index ba947ba327..dc28f9d58b 100644 --- a/core/src/ten_runtime/remote/remote.c +++ b/core/src/ten_runtime/remote/remote.c @@ -15,7 +15,7 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/src/ten_runtime/schema_store/interface.c b/core/src/ten_runtime/schema_store/interface.c index b8756e5eb6..ec947f8cde 100644 --- a/core/src/ten_runtime/schema_store/interface.c +++ b/core/src/ten_runtime/schema_store/interface.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/schema_store/cmd.h" #include "include_internal/ten_runtime/schema_store/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" diff --git a/core/src/ten_runtime/schema_store/interface_info.c b/core/src/ten_runtime/schema_store/interface_info.c index 7b12cb845b..aa62623adb 100644 --- a/core/src/ten_runtime/schema_store/interface_info.c +++ b/core/src/ten_runtime/schema_store/interface_info.c @@ -6,7 +6,7 @@ #include "include_internal/ten_runtime/schema_store/interface.h" #include "include_internal/ten_rust/ten_rust.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" diff --git a/core/src/ten_runtime/schema_store/property.c b/core/src/ten_runtime/schema_store/property.c index 62370c2199..20c0358b39 100644 --- a/core/src/ten_runtime/schema_store/property.c +++ b/core/src/ten_runtime/schema_store/property.c @@ -6,7 +6,7 @@ #include "include_internal/ten_runtime/schema_store/property.h" #include "include_internal/ten_runtime/common/constant_str.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/constant_str.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/schema.h" diff --git a/core/src/ten_runtime/schema_store/store.c b/core/src/ten_runtime/schema_store/store.c index 665c4ec683..7ec55291da 100644 --- a/core/src/ten_runtime/schema_store/store.c +++ b/core/src/ten_runtime/schema_store/store.c @@ -15,7 +15,7 @@ #include "include_internal/ten_runtime/schema_store/msg.h" #include "include_internal/ten_runtime/schema_store/property.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/constant_str.h" #include "include_internal/ten_utils/schema/schema.h" #include "include_internal/ten_utils/schema/types/schema_object.h" diff --git a/core/src/ten_runtime/ten_env/internal/get_property.c b/core/src/ten_runtime/ten_env/internal/get_property.c index c163ca8e64..e1870854fa 100644 --- a/core/src/ten_runtime/ten_env/internal/get_property.c +++ b/core/src/ten_runtime/ten_env/internal/get_property.c @@ -16,7 +16,7 @@ #include "include_internal/ten_runtime/ten_env/metadata.h" #include "include_internal/ten_runtime/ten_env/metadata_cb.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/ten_env/internal/metadata.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/core/src/ten_runtime/ten_env/internal/is_cmd_connected.c b/core/src/ten_runtime/ten_env/internal/is_cmd_connected.c index 86c38e81b1..6aa1abbf46 100644 --- a/core/src/ten_runtime/ten_env/internal/is_cmd_connected.c +++ b/core/src/ten_runtime/ten_env/internal/is_cmd_connected.c @@ -14,7 +14,7 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/ten_env/metadata_cb.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/extension/extension.h" diff --git a/core/src/ten_runtime/ten_env/internal/metadata.c b/core/src/ten_runtime/ten_env/internal/metadata.c index 7f28f8195b..996bde0a95 100644 --- a/core/src/ten_runtime/ten_env/internal/metadata.c +++ b/core/src/ten_runtime/ten_env/internal/metadata.c @@ -17,7 +17,7 @@ #include "include_internal/ten_runtime/ten_env/metadata.h" #include "include_internal/ten_runtime/ten_env/metadata_cb.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_runtime/ten_env/internal/on_xxx_done.c b/core/src/ten_runtime/ten_env/internal/on_xxx_done.c index cd9c0f89d7..c8cc54208d 100644 --- a/core/src/ten_runtime/ten_env/internal/on_xxx_done.c +++ b/core/src/ten_runtime/ten_env/internal/on_xxx_done.c @@ -15,7 +15,7 @@ #include "include_internal/ten_runtime/extension_group/on_xxx.h" #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/ten_env/internal/return.c b/core/src/ten_runtime/ten_env/internal/return.c index c976ba6680..98de6b4b22 100644 --- a/core/src/ten_runtime/ten_env/internal/return.c +++ b/core/src/ten_runtime/ten_env/internal/return.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_runtime/ten_env/internal/send.c b/core/src/ten_runtime/ten_env/internal/send.c index 943c6972bb..294a03d0fc 100644 --- a/core/src/ten_runtime/ten_env/internal/send.c +++ b/core/src/ten_runtime/ten_env/internal/send.c @@ -15,7 +15,7 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/msg.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/core/src/ten_runtime/ten_env/internal/set_property.c b/core/src/ten_runtime/ten_env/internal/set_property.c index 04de57bb18..92d5d31f78 100644 --- a/core/src/ten_runtime/ten_env/internal/set_property.c +++ b/core/src/ten_runtime/ten_env/internal/set_property.c @@ -17,7 +17,7 @@ #include "include_internal/ten_runtime/ten_env/metadata_cb.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/ten_env/internal/metadata.h" diff --git a/core/src/ten_runtime/ten_env/ten_env.c b/core/src/ten_runtime/ten_env/ten_env.c index 53ec70fa44..2f67a7d608 100644 --- a/core/src/ten_runtime/ten_env/ten_env.c +++ b/core/src/ten_runtime/ten_env/ten_env.c @@ -17,7 +17,7 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/extension/extension.h" diff --git a/core/src/ten_runtime/ten_env/ten_proxy.c b/core/src/ten_runtime/ten_env/ten_proxy.c index 6612a3c81d..f1b7a43b50 100644 --- a/core/src/ten_runtime/ten_env/ten_proxy.c +++ b/core/src/ten_runtime/ten_env/ten_proxy.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_runtime/ten_env_proxy/ten_env_proxy.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/core/src/ten_runtime/ten_env_proxy/internal/acquire_lock_mode.c b/core/src/ten_runtime/ten_env_proxy/internal/acquire_lock_mode.c index fd66b4ede4..e0dd50979c 100644 --- a/core/src/ten_runtime/ten_env_proxy/internal/acquire_lock_mode.c +++ b/core/src/ten_runtime/ten_env_proxy/internal/acquire_lock_mode.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_runtime/ten_env/ten_env_proxy.h" #include "include_internal/ten_runtime/ten_env_proxy/ten_env_proxy.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/extension_group/extension_group.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/core/src/ten_runtime/ten_env_proxy/internal/notify.c b/core/src/ten_runtime/ten_env_proxy/internal/notify.c index 885000f8aa..834f13f1e2 100644 --- a/core/src/ten_runtime/ten_env_proxy/internal/notify.c +++ b/core/src/ten_runtime/ten_env_proxy/internal/notify.c @@ -10,7 +10,7 @@ #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_runtime/ten_env/ten_env_proxy.h" #include "include_internal/ten_runtime/ten_env_proxy/ten_env_proxy.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/extension_group/extension_group.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/core/src/ten_runtime/ten_env_proxy/internal/release_lock_mode.c b/core/src/ten_runtime/ten_env_proxy/internal/release_lock_mode.c index 082a6c5ac4..e63790634c 100644 --- a/core/src/ten_runtime/ten_env_proxy/internal/release_lock_mode.c +++ b/core/src/ten_runtime/ten_env_proxy/internal/release_lock_mode.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_runtime/ten_env/ten_env_proxy.h" #include "include_internal/ten_runtime/ten_env_proxy/ten_env_proxy.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/extension_group/extension_group.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/core/src/ten_runtime/ten_env_proxy/ten_env_proxy.c b/core/src/ten_runtime/ten_env_proxy/ten_env_proxy.c index 4a328e6a33..267bce4420 100644 --- a/core/src/ten_runtime/ten_env_proxy/ten_env_proxy.c +++ b/core/src/ten_runtime/ten_env_proxy/ten_env_proxy.c @@ -11,7 +11,7 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_runtime/ten_env_proxy/ten_env_proxy.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/extension_group/extension_group.h" diff --git a/core/src/ten_runtime/timer/timer.c b/core/src/ten_runtime/timer/timer.c index 38ba1eb6fe..7885b5fee2 100644 --- a/core/src/ten_runtime/timer/timer.c +++ b/core/src/ten_runtime/timer/timer.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/timer/timer.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_utils/backtrace/platform/posix/darwin/macho.c b/core/src/ten_utils/backtrace/platform/posix/darwin/macho.c index e2c0eefb3e..80c0067c50 100644 --- a/core/src/ten_utils/backtrace/platform/posix/darwin/macho.c +++ b/core/src/ten_utils/backtrace/platform/posix/darwin/macho.c @@ -17,7 +17,7 @@ #include "include_internal/ten_utils/backtrace/backtrace.h" #include "include_internal/ten_utils/backtrace/platform/posix/internal.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/io/mmap.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/atomic_ptr.h" diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/debugfile.c b/core/src/ten_utils/backtrace/platform/posix/linux/debugfile.c index a0ce9ffdae..1baf86fcc1 100644 --- a/core/src/ten_utils/backtrace/platform/posix/linux/debugfile.c +++ b/core/src/ten_utils/backtrace/platform/posix/linux/debugfile.c @@ -14,7 +14,7 @@ #include #include "include_internal/ten_utils/backtrace/platform/posix/linux/crc32.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/file.h" diff --git a/core/src/ten_utils/backtrace/platform/posix/linux/view.c b/core/src/ten_utils/backtrace/platform/posix/linux/view.c index 8ace230c21..3ec31d044d 100644 --- a/core/src/ten_utils/backtrace/platform/posix/linux/view.c +++ b/core/src/ten_utils/backtrace/platform/posix/linux/view.c @@ -10,7 +10,7 @@ #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" /** diff --git a/core/src/ten_utils/container/list.c b/core/src/ten_utils/container/list.c index 178b0a8c4e..c064bfcd3c 100644 --- a/core/src/ten_utils/container/list.c +++ b/core/src/ten_utils/container/list.c @@ -9,7 +9,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/macro/memory.h" diff --git a/core/src/ten_utils/container/list_int32.c b/core/src/ten_utils/container/list_int32.c index adfe6966f5..ebc3b6a3f3 100644 --- a/core/src/ten_utils/container/list_int32.c +++ b/core/src/ten_utils/container/list_int32.c @@ -7,7 +7,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" diff --git a/core/src/ten_utils/container/list_node.c b/core/src/ten_utils/container/list_node.c index 6268d84785..43c21db783 100644 --- a/core/src/ten_utils/container/list_node.c +++ b/core/src/ten_utils/container/list_node.c @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" bool ten_listnode_check_integrity(ten_listnode_t *self) { diff --git a/core/src/ten_utils/container/list_node_int32.c b/core/src/ten_utils/container/list_node_int32.c index 5fc0dded8a..b5eed7963b 100644 --- a/core/src/ten_utils/container/list_node_int32.c +++ b/core/src/ten_utils/container/list_node_int32.c @@ -3,7 +3,7 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_utils/container/list_node_ptr.c b/core/src/ten_utils/container/list_node_ptr.c index ac4e6856e2..8d9f24bb7e 100644 --- a/core/src/ten_utils/container/list_node_ptr.c +++ b/core/src/ten_utils/container/list_node_ptr.c @@ -3,7 +3,7 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_utils/container/list_node_smart_ptr.c b/core/src/ten_utils/container/list_node_smart_ptr.c index 591c6210a5..499b9f6630 100644 --- a/core/src/ten_utils/container/list_node_smart_ptr.c +++ b/core/src/ten_utils/container/list_node_smart_ptr.c @@ -6,7 +6,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/src/ten_utils/container/list_node_str.c b/core/src/ten_utils/container/list_node_str.c index b7886d8bf3..e00c8ee2f1 100644 --- a/core/src/ten_utils/container/list_node_str.c +++ b/core/src/ten_utils/container/list_node_str.c @@ -6,7 +6,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_utils/container/list_ptr.c b/core/src/ten_utils/container/list_ptr.c index f4fad7f72d..327dedbcd7 100644 --- a/core/src/ten_utils/container/list_ptr.c +++ b/core/src/ten_utils/container/list_ptr.c @@ -7,7 +7,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" diff --git a/core/src/ten_utils/container/list_smart_ptr.c b/core/src/ten_utils/container/list_smart_ptr.c index c2f3943d5b..efbbecb305 100644 --- a/core/src/ten_utils/container/list_smart_ptr.c +++ b/core/src/ten_utils/container/list_smart_ptr.c @@ -7,7 +7,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/container/list_node_smart_ptr.h" diff --git a/core/src/ten_utils/container/list_str.c b/core/src/ten_utils/container/list_str.c index a74cf46d59..f693b2716b 100644 --- a/core/src/ten_utils/container/list_str.c +++ b/core/src/ten_utils/container/list_str.c @@ -7,7 +7,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" diff --git a/core/src/ten_utils/container/vector.c b/core/src/ten_utils/container/vector.c index c998296265..1cc226bd70 100644 --- a/core/src/ten_utils/container/vector.c +++ b/core/src/ten_utils/container/vector.c @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" void ten_vector_init(ten_vector_t *self, size_t capacity) { diff --git a/core/src/ten_utils/io/general/loops/bare/runloop.c b/core/src/ten_utils/io/general/loops/bare/runloop.c index 373bdea546..4c9d0d981f 100644 --- a/core/src/ten_utils/io/general/loops/bare/runloop.c +++ b/core/src/ten_utils/io/general/loops/bare/runloop.c @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/io/general/loops/runloop.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_utils/io/general/loops/runloop.c b/core/src/ten_utils/io/general/loops/runloop.c index 62cc74ac83..62ed09e765 100644 --- a/core/src/ten_utils/io/general/loops/runloop.c +++ b/core/src/ten_utils/io/general/loops/runloop.c @@ -9,7 +9,7 @@ #include #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/io/general/loops/runloop.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_utils/io/general/loops/uv/runloop.c b/core/src/ten_utils/io/general/loops/uv/runloop.c index ffadf9d848..42d6ac573c 100644 --- a/core/src/ten_utils/io/general/loops/uv/runloop.c +++ b/core/src/ten_utils/io/general/loops/uv/runloop.c @@ -10,7 +10,7 @@ #include #include "include_internal/ten_utils/io/general/transport/backend/uv/stream/migrate.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/io/general/loops/runloop.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_utils/io/general/socket.c b/core/src/ten_utils/io/general/socket.c index e67480ddeb..5739780f14 100644 --- a/core/src/ten_utils/io/general/socket.c +++ b/core/src/ten_utils/io/general/socket.c @@ -20,7 +20,7 @@ #include #endif -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" ten_socket_addr_t *ten_socket_addr_create(const char *address, uint16_t port) { diff --git a/core/src/ten_utils/io/general/transport/backend/uv/stream/migrate.c b/core/src/ten_utils/io/general/transport/backend/uv/stream/migrate.c index e1c352a4ab..0aee769f32 100644 --- a/core/src/ten_utils/io/general/transport/backend/uv/stream/migrate.c +++ b/core/src/ten_utils/io/general/transport/backend/uv/stream/migrate.c @@ -9,7 +9,7 @@ #include "include_internal/ten_utils/io/general/transport/backend/uv/stream/tcp.h" #include "include_internal/ten_utils/io/runloop.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/io/general/loops/uv/runloop.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_utils/io/general/transport/stream.c b/core/src/ten_utils/io/general/transport/stream.c index 2a249369ed..873ad548da 100644 --- a/core/src/ten_utils/io/general/transport/stream.c +++ b/core/src/ten_utils/io/general/transport/stream.c @@ -9,7 +9,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/io/general/transport/backend/base.h" #include "ten_utils/lib/signature.h" #include "ten_utils/macro/memory.h" diff --git a/core/src/ten_utils/io/general/transport/transport.c b/core/src/ten_utils/io/general/transport/transport.c index fadf079290..ef2c95ca20 100644 --- a/core/src/ten_utils/io/general/transport/transport.c +++ b/core/src/ten_utils/io/general/transport/transport.c @@ -8,7 +8,7 @@ #include #include "include_internal/ten_utils/io/runloop.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/io/general/transport/backend/base.h" #include "ten_utils/io/general/transport/backend/factory.h" #include "ten_utils/lib/mutex.h" diff --git a/core/src/ten_utils/io/posix/mmap.c b/core/src/ten_utils/io/posix/mmap.c index 2fe8052091..91c0e9c6db 100644 --- a/core/src/ten_utils/io/posix/mmap.c +++ b/core/src/ten_utils/io/posix/mmap.c @@ -13,7 +13,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" /** * @file This file implements file views and memory allocation when mmap is diff --git a/core/src/ten_utils/io/posix/socket.c b/core/src/ten_utils/io/posix/socket.c index 2ac3e9ad68..1ff609b907 100644 --- a/core/src/ten_utils/io/posix/socket.c +++ b/core/src/ten_utils/io/posix/socket.c @@ -12,7 +12,7 @@ #include #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_utils/lib/sys/general/buf.c b/core/src/ten_utils/lib/sys/general/buf.c index 3e730771b3..6ccc43aac8 100644 --- a/core/src/ten_utils/lib/sys/general/buf.c +++ b/core/src/ten_utils/lib/sys/general/buf.c @@ -10,7 +10,7 @@ #include #include "include_internal/ten_utils/lib/buf.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/signature.h" #include "ten_utils/macro/memory.h" diff --git a/core/src/ten_utils/lib/sys/general/error.c b/core/src/ten_utils/lib/sys/general/error.c index e11ff842dd..85303fe11a 100644 --- a/core/src/ten_utils/lib/sys/general/error.c +++ b/core/src/ten_utils/lib/sys/general/error.c @@ -7,7 +7,7 @@ #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" #include "ten_utils/macro/memory.h" diff --git a/core/src/ten_utils/lib/sys/general/file.c b/core/src/ten_utils/lib/sys/general/file.c index 29b7de64ae..6096a2fddb 100644 --- a/core/src/ten_utils/lib/sys/general/file.c +++ b/core/src/ten_utils/lib/sys/general/file.c @@ -15,7 +15,7 @@ #include #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/path.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_utils/lib/sys/general/json.c b/core/src/ten_utils/lib/sys/general/json.c index d3042cb0be..01e21429c1 100644 --- a/core/src/ten_utils/lib/sys/general/json.c +++ b/core/src/ten_utils/lib/sys/general/json.c @@ -7,7 +7,7 @@ #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "jansson.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_utils/lib/sys/general/path.c b/core/src/ten_utils/lib/sys/general/path.c index d52bc77a76..e321bbb7af 100644 --- a/core/src/ten_utils/lib/sys/general/path.c +++ b/core/src/ten_utils/lib/sys/general/path.c @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/file.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_utils/lib/sys/general/placeholder.c b/core/src/ten_utils/lib/sys/general/placeholder.c index 60824c1123..9666ee7e49 100644 --- a/core/src/ten_utils/lib/sys/general/placeholder.c +++ b/core/src/ten_utils/lib/sys/general/placeholder.c @@ -9,7 +9,7 @@ #include #include "include_internal/ten_utils/common/constant_str.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/macro/memory.h" #include "include_internal/ten_utils/value/value.h" #include "include_internal/ten_utils/value/value_set.h" diff --git a/core/src/ten_utils/lib/sys/general/ref.c b/core/src/ten_utils/lib/sys/general/ref.c index 3b2286441c..8579710f8b 100644 --- a/core/src/ten_utils/lib/sys/general/ref.c +++ b/core/src/ten_utils/lib/sys/general/ref.c @@ -6,7 +6,7 @@ #include "ten_utils/lib/ref.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/signature.h" diff --git a/core/src/ten_utils/lib/sys/general/signature.c b/core/src/ten_utils/lib/sys/general/signature.c index 2dd81dd4a4..961df13c1d 100644 --- a/core/src/ten_utils/lib/sys/general/signature.c +++ b/core/src/ten_utils/lib/sys/general/signature.c @@ -5,7 +5,7 @@ // #include "ten_utils/lib/signature.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" void ten_signature_set(ten_signature_t *signature, ten_signature_t value) { TEN_ASSERT(signature, "Invalid argument."); diff --git a/core/src/ten_utils/lib/sys/general/smart_ptr.c b/core/src/ten_utils/lib/sys/general/smart_ptr.c index b8d8629aa9..df0bb6d1f6 100644 --- a/core/src/ten_utils/lib/sys/general/smart_ptr.c +++ b/core/src/ten_utils/lib/sys/general/smart_ptr.c @@ -9,7 +9,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/signature.h" diff --git a/core/src/ten_utils/lib/sys/general/string.c b/core/src/ten_utils/lib/sys/general/string.c index 3df23de37f..1e373b5c28 100644 --- a/core/src/ten_utils/lib/sys/general/string.c +++ b/core/src/ten_utils/lib/sys/general/string.c @@ -11,7 +11,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/signature.h" diff --git a/core/src/ten_utils/lib/sys/general/thread.c b/core/src/ten_utils/lib/sys/general/thread.c index a17363668a..389a8fddd1 100644 --- a/core/src/ten_utils/lib/sys/general/thread.c +++ b/core/src/ten_utils/lib/sys/general/thread.c @@ -16,7 +16,7 @@ #endif #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread_local.h" #include "ten_utils/lib/thread_once.h" diff --git a/core/src/ten_utils/lib/sys/general/uuid.c b/core/src/ten_utils/lib/sys/general/uuid.c index 7b9929f11a..dc3c70aca7 100644 --- a/core/src/ten_utils/lib/sys/general/uuid.c +++ b/core/src/ten_utils/lib/sys/general/uuid.c @@ -10,7 +10,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" /** * http://xoshiro.di.unimi.it/splitmix64.c diff --git a/core/src/ten_utils/lib/sys/posix/cond.c b/core/src/ten_utils/lib/sys/posix/cond.c index 4807d15fe8..2805442655 100644 --- a/core/src/ten_utils/lib/sys/posix/cond.c +++ b/core/src/ten_utils/lib/sys/posix/cond.c @@ -10,7 +10,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/macro/memory.h" diff --git a/core/src/ten_utils/lib/sys/posix/darwin/pc/path.c b/core/src/ten_utils/lib/sys/posix/darwin/pc/path.c index bc0bf113e7..a24c5bde78 100644 --- a/core/src/ten_utils/lib/sys/posix/darwin/pc/path.c +++ b/core/src/ten_utils/lib/sys/posix/darwin/pc/path.c @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/string.h" ten_string_t *ten_path_get_executable_path() { diff --git a/core/src/ten_utils/lib/sys/posix/event.c b/core/src/ten_utils/lib/sys/posix/event.c index 97f7238cce..01bf9f48ce 100644 --- a/core/src/ten_utils/lib/sys/posix/event.c +++ b/core/src/ten_utils/lib/sys/posix/event.c @@ -9,7 +9,7 @@ #include #include "include_internal/ten_utils/lib/mutex.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/cond.h" #include "ten_utils/lib/mutex.h" diff --git a/core/src/ten_utils/lib/sys/posix/linux/uuid.c b/core/src/ten_utils/lib/sys/posix/linux/uuid.c index 387bbb5db1..9fb81f7160 100644 --- a/core/src/ten_utils/lib/sys/posix/linux/uuid.c +++ b/core/src/ten_utils/lib/sys/posix/linux/uuid.c @@ -11,7 +11,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" void ten_uuid4_seed(ten_uuid4_state_t *seed) { static uint64_t state0 = 0; diff --git a/core/src/ten_utils/lib/sys/posix/path.c b/core/src/ten_utils/lib/sys/posix/path.c index e093aa0770..67763eb356 100644 --- a/core/src/ten_utils/lib/sys/posix/path.c +++ b/core/src/ten_utils/lib/sys/posix/path.c @@ -18,7 +18,7 @@ #include #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_utils/lib/sys/posix/process_mutex.c b/core/src/ten_utils/lib/sys/posix/process_mutex.c index 6afceef538..a90719c4cd 100644 --- a/core/src/ten_utils/lib/sys/posix/process_mutex.c +++ b/core/src/ten_utils/lib/sys/posix/process_mutex.c @@ -11,7 +11,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_utils/lib/sys/posix/thread.c b/core/src/ten_utils/lib/sys/posix/thread.c index 922c8be496..82149a69cd 100644 --- a/core/src/ten_utils/lib/sys/posix/thread.c +++ b/core/src/ten_utils/lib/sys/posix/thread.c @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" TEN_UTILS_API ten_thread_t *__get_self(); diff --git a/core/src/ten_utils/lib/sys/posix/thread_once.c b/core/src/ten_utils/lib/sys/posix/thread_once.c index cbccc806c5..c94c130d61 100644 --- a/core/src/ten_utils/lib/sys/posix/thread_once.c +++ b/core/src/ten_utils/lib/sys/posix/thread_once.c @@ -8,7 +8,7 @@ #include #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" int ten_thread_once(ten_thread_once_t *once_control, void (*init_routine)(void)) { diff --git a/core/src/ten_utils/lib/sys/win/atomic.c b/core/src/ten_utils/lib/sys/win/atomic.c index e3572eb49a..b0aa04c796 100644 --- a/core/src/ten_utils/lib/sys/win/atomic.c +++ b/core/src/ten_utils/lib/sys/win/atomic.c @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" int64_t ten_atomic_fetch_add(volatile ten_atomic_t *a, int64_t v) { return InterlockedExchangeAdd64(a, v); diff --git a/core/src/ten_utils/lib/sys/win/cond.c b/core/src/ten_utils/lib/sys/win/cond.c index 21a7497af3..4f549ad339 100644 --- a/core/src/ten_utils/lib/sys/win/cond.c +++ b/core/src/ten_utils/lib/sys/win/cond.c @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/time.h" diff --git a/core/src/ten_utils/lib/sys/win/path.c b/core/src/ten_utils/lib/sys/win/path.c index 001e1a1852..b97bf375be 100644 --- a/core/src/ten_utils/lib/sys/win/path.c +++ b/core/src/ten_utils/lib/sys/win/path.c @@ -12,7 +12,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/string.h" ten_string_t *ten_path_get_cwd() { diff --git a/core/src/ten_utils/lib/sys/win/thread.c b/core/src/ten_utils/lib/sys/win/thread.c index 9cbb164128..8e4913b161 100644 --- a/core/src/ten_utils/lib/sys/win/thread.c +++ b/core/src/ten_utils/lib/sys/win/thread.c @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/thread_local.h" TEN_UTILS_API ten_thread_t *__get_self(); diff --git a/core/src/ten_utils/lib/sys/win/uuid.c b/core/src/ten_utils/lib/sys/win/uuid.c index 693efc8b73..c1f089e740 100644 --- a/core/src/ten_utils/lib/sys/win/uuid.c +++ b/core/src/ten_utils/lib/sys/win/uuid.c @@ -9,7 +9,7 @@ #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" void ten_uuid4_seed(ten_uuid4_state_t *seed) { static uint64_t state0 = 0; diff --git a/core/src/ten_utils/log/output.c b/core/src/ten_utils/log/output.c index 7584e07487..c2aa0250ad 100644 --- a/core/src/ten_utils/log/output.c +++ b/core/src/ten_utils/log/output.c @@ -17,7 +17,7 @@ #include "include_internal/ten_utils/log/log.h" #include "include_internal/ten_utils/log/output.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/file.h" static void ten_log_output_set(ten_log_t *self, diff --git a/core/src/ten_utils/sanitizer/memory_check.c b/core/src/ten_utils/sanitizer/memory_check.c index e7a969eb4e..d484f85c26 100644 --- a/core/src/ten_utils/sanitizer/memory_check.c +++ b/core/src/ten_utils/sanitizer/memory_check.c @@ -14,7 +14,7 @@ #include #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/sanitizer/memory_check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_utils/sanitizer/thread_check.c b/core/src/ten_utils/sanitizer/thread_check.c index 204b30bb70..96b6ce1d01 100644 --- a/core/src/ten_utils/sanitizer/thread_check.c +++ b/core/src/ten_utils/sanitizer/thread_check.c @@ -8,7 +8,7 @@ #include #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/sanitizer/thread_check.h" #include "ten_utils/lib/thread.h" diff --git a/core/src/ten_utils/schema/bindings/rust/schema.c b/core/src/ten_utils/schema/bindings/rust/schema.c index a89da388cb..6f55087e95 100644 --- a/core/src/ten_utils/schema/bindings/rust/schema.c +++ b/core/src/ten_utils/schema/bindings/rust/schema.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_utils/schema/bindings/rust/schema.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/schema.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_utils/schema/keywords/keyword.c b/core/src/ten_utils/schema/keywords/keyword.c index b04d465cb6..05c0b00c2f 100644 --- a/core/src/ten_utils/schema/keywords/keyword.c +++ b/core/src/ten_utils/schema/keywords/keyword.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_utils/schema/keywords/keyword.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" bool ten_schema_keyword_check_integrity(ten_schema_keyword_t *self) { TEN_ASSERT(self, "Invalid argument."); diff --git a/core/src/ten_utils/schema/keywords/keyword_items.c b/core/src/ten_utils/schema/keywords/keyword_items.c index 075c4520c5..00a35c2eda 100644 --- a/core/src/ten_utils/schema/keywords/keyword_items.c +++ b/core/src/ten_utils/schema/keywords/keyword_items.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_utils/schema/keywords/keyword_items.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/schema.h" #include "include_internal/ten_utils/schema/types/schema_array.h" diff --git a/core/src/ten_utils/schema/keywords/keyword_properties.c b/core/src/ten_utils/schema/keywords/keyword_properties.c index fa5ecf116c..13d0be8aab 100644 --- a/core/src/ten_utils/schema/keywords/keyword_properties.c +++ b/core/src/ten_utils/schema/keywords/keyword_properties.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_utils/schema/keywords/keyword_properties.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/schema.h" #include "include_internal/ten_utils/schema/types/schema_object.h" diff --git a/core/src/ten_utils/schema/keywords/keyword_required.c b/core/src/ten_utils/schema/keywords/keyword_required.c index 102e927c6c..013e43f062 100644 --- a/core/src/ten_utils/schema/keywords/keyword_required.c +++ b/core/src/ten_utils/schema/keywords/keyword_required.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_utils/schema/keywords/keyword_required.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/schema.h" #include "include_internal/ten_utils/schema/types/schema_object.h" diff --git a/core/src/ten_utils/schema/keywords/keyword_type.c b/core/src/ten_utils/schema/keywords/keyword_type.c index b20051393e..2d8f122b50 100644 --- a/core/src/ten_utils/schema/keywords/keyword_type.c +++ b/core/src/ten_utils/schema/keywords/keyword_type.c @@ -7,7 +7,7 @@ #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/schema.h" #include "include_internal/ten_utils/value/value_convert.h" diff --git a/core/src/ten_utils/schema/schema.c b/core/src/ten_utils/schema/schema.c index 0f93c48fd2..05af302a57 100644 --- a/core/src/ten_utils/schema/schema.c +++ b/core/src/ten_utils/schema/schema.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_utils/schema/schema.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/keywords/keyword.h" #include "include_internal/ten_utils/schema/keywords/keyword_type.h" #include "include_internal/ten_utils/schema/keywords/keywords_info.h" diff --git a/core/src/ten_utils/schema/types/schema_array.c b/core/src/ten_utils/schema/types/schema_array.c index 46f5d82b2f..c4aa2ed02c 100644 --- a/core/src/ten_utils/schema/types/schema_array.c +++ b/core/src/ten_utils/schema/types/schema_array.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_utils/schema/types/schema_array.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/schema.h" #include "ten_utils/macro/memory.h" diff --git a/core/src/ten_utils/schema/types/schema_object.c b/core/src/ten_utils/schema/types/schema_object.c index 35935446d1..630d1a4fd8 100644 --- a/core/src/ten_utils/schema/types/schema_object.c +++ b/core/src/ten_utils/schema/types/schema_object.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_utils/schema/types/schema_object.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/keywords/keyword_properties.h" #include "include_internal/ten_utils/schema/schema.h" #include "ten_utils/macro/memory.h" diff --git a/core/src/ten_utils/schema/types/schema_primitive.c b/core/src/ten_utils/schema/types/schema_primitive.c index 656ffc2f2b..ab477212e3 100644 --- a/core/src/ten_utils/schema/types/schema_primitive.c +++ b/core/src/ten_utils/schema/types/schema_primitive.c @@ -5,7 +5,7 @@ // #include "include_internal/ten_utils/schema/types/schema_primitive.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/schema.h" #include "ten_utils/lib/signature.h" #include "ten_utils/macro/memory.h" diff --git a/core/src/ten_utils/value/type.c b/core/src/ten_utils/value/type.c index fd5b75dee6..36c16724aa 100644 --- a/core/src/ten_utils/value/type.c +++ b/core/src/ten_utils/value/type.c @@ -8,11 +8,11 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "include_internal/ten_utils/value/type_info.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" -#include "ten_utils/value/type_info.h" +#include "ten_utils/macro/check.h" TEN_TYPE ten_type_from_string(const char *type_str) { TEN_ASSERT(type_str, "Invalid argument."); diff --git a/core/src/ten_utils/value/value.c b/core/src/ten_utils/value/value.c index 6e72151a32..499e35c033 100644 --- a/core/src/ten_utils/value/value.c +++ b/core/src/ten_utils/value/value.c @@ -13,7 +13,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" diff --git a/core/src/ten_utils/value/value_convert.c b/core/src/ten_utils/value/value_convert.c index 868c4a7f07..ea3a19fe17 100644 --- a/core/src/ten_utils/value/value_convert.c +++ b/core/src/ten_utils/value/value_convert.c @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_can_convert.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/error.h" diff --git a/core/src/ten_utils/value/value_get.c b/core/src/ten_utils/value/value_get.c index f519f11132..34da2aa333 100644 --- a/core/src/ten_utils/value/value_get.c +++ b/core/src/ten_utils/value/value_get.c @@ -7,7 +7,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" diff --git a/core/src/ten_utils/value/value_is.c b/core/src/ten_utils/value/value_is.c index 3236cf30b9..fbd59e2b92 100644 --- a/core/src/ten_utils/value/value_is.c +++ b/core/src/ten_utils/value/value_is.c @@ -9,7 +9,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/value/type.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_kv.h" diff --git a/core/src/ten_utils/value/value_json.c b/core/src/ten_utils/value/value_json.c index 49b99afbdc..a6cbd26c08 100644 --- a/core/src/ten_utils/value/value_json.c +++ b/core/src/ten_utils/value/value_json.c @@ -6,7 +6,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" diff --git a/core/src/ten_utils/value/value_kv.c b/core/src/ten_utils/value/value_kv.c index 1054f4b37b..63de5b1af9 100644 --- a/core/src/ten_utils/value/value_kv.c +++ b/core/src/ten_utils/value/value_kv.c @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_utils/value/value_path.c b/core/src/ten_utils/value/value_path.c index f1045d2005..67ed2f7e0e 100644 --- a/core/src/ten_utils/value/value_path.c +++ b/core/src/ten_utils/value/value_path.c @@ -7,7 +7,7 @@ #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/constant_str.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" diff --git a/core/src/ten_utils/value/value_smart_ptr.c b/core/src/ten_utils/value/value_smart_ptr.c index c67d900c40..cd482f2800 100644 --- a/core/src/ten_utils/value/value_smart_ptr.c +++ b/core/src/ten_utils/value/value_smart_ptr.c @@ -7,7 +7,7 @@ #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/value/type.h" diff --git a/core/src/ten_utils/value/value_string.c b/core/src/ten_utils/value/value_string.c index bbf5e7b802..a13ff76270 100644 --- a/core/src/ten_utils/value/value_string.c +++ b/core/src/ten_utils/value/value_string.c @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/constant_str.h" #include "include_internal/ten_utils/value/value_convert.h" #include "ten_utils/container/list.h" diff --git a/packages/core_extension_groups/default_extension_group/src/default_extension_group.c b/packages/core_extension_groups/default_extension_group/src/default_extension_group.c index 302b13124b..2b193d8a44 100644 --- a/packages/core_extension_groups/default_extension_group/src/default_extension_group.c +++ b/packages/core_extension_groups/default_extension_group/src/default_extension_group.c @@ -12,7 +12,7 @@ #include "include_internal/ten_runtime/ten_env/metadata.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/addon/extension_group/extension_group.h" #include "ten_runtime/extension_group/extension_group.h" #include "ten_runtime/ten.h" diff --git a/packages/core_extensions/py_init_extension_cpp/src/main.cc b/packages/core_extensions/py_init_extension_cpp/src/main.cc index 86b92bc498..f6417e2e6b 100644 --- a/packages/core_extensions/py_init_extension_cpp/src/main.cc +++ b/packages/core_extensions/py_init_extension_cpp/src/main.cc @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/app/base_dir.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_runtime/binding/python/common.h" #include "ten_utils/container/list_str.h" diff --git a/packages/core_protocols/msgpack/common/parser.c b/packages/core_protocols/msgpack/common/parser.c index c3c49ab008..7b5dcee84b 100644 --- a/packages/core_protocols/msgpack/common/parser.c +++ b/packages/core_protocols/msgpack/common/parser.c @@ -9,7 +9,7 @@ #include "core_protocols/msgpack/common/common.h" #include "core_protocols/msgpack/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "msgpack.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/macro/mark.h" diff --git a/packages/core_protocols/msgpack/common/value.c b/packages/core_protocols/msgpack/common/value.c index 0862cde865..9d54c31799 100644 --- a/packages/core_protocols/msgpack/common/value.c +++ b/packages/core_protocols/msgpack/common/value.c @@ -7,7 +7,7 @@ #include "core_protocols/msgpack/common/common.h" #include "core_protocols/msgpack/common/value.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_kv.h" #include "msgpack/object.h" #include "msgpack/pack.h" diff --git a/packages/core_protocols/msgpack/msg/cmd/custom/cmd.c b/packages/core_protocols/msgpack/msg/cmd/custom/cmd.c index 4ea47084cc..fdd9f3dfb2 100644 --- a/packages/core_protocols/msgpack/msg/cmd/custom/cmd.c +++ b/packages/core_protocols/msgpack/msg/cmd/custom/cmd.c @@ -8,7 +8,7 @@ #include "core_protocols/msgpack/msg/cmd/custom/cmd.h" #include "core_protocols/msgpack/msg/cmd/custom/field/field_info.h" #include "core_protocols/msgpack/msg/field/field_info.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/cmd/custom/cmd.h" static ten_cmd_t *get_raw_cmd(ten_shared_ptr_t *self) { diff --git a/packages/core_protocols/msgpack/msg/cmd/field/cmd_id.c b/packages/core_protocols/msgpack/msg/cmd/field/cmd_id.c index 48abd2746e..f10f3dff60 100644 --- a/packages/core_protocols/msgpack/msg/cmd/field/cmd_id.c +++ b/packages/core_protocols/msgpack/msg/cmd/field/cmd_id.c @@ -8,7 +8,7 @@ #include #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/string.h" void ten_msgpack_cmd_id_serialize(ten_msg_t *self, msgpack_packer *pck) { diff --git a/packages/core_protocols/msgpack/msg/cmd/field/seq_id.c b/packages/core_protocols/msgpack/msg/cmd/field/seq_id.c index 4188ee3793..4429c58ab9 100644 --- a/packages/core_protocols/msgpack/msg/cmd/field/seq_id.c +++ b/packages/core_protocols/msgpack/msg/cmd/field/seq_id.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" void ten_msgpack_cmd_seq_id_serialize(ten_msg_t *self, msgpack_packer *pck) { TEN_ASSERT(self && ten_raw_msg_check_integrity(self) && pck, diff --git a/packages/core_protocols/msgpack/msg/data/field/buf.c b/packages/core_protocols/msgpack/msg/data/field/buf.c index 62b578486a..1268c41230 100644 --- a/packages/core_protocols/msgpack/msg/data/field/buf.c +++ b/packages/core_protocols/msgpack/msg/data/field/buf.c @@ -10,7 +10,7 @@ #include "core_protocols/msgpack/common/value.h" #include "include_internal/ten_runtime/msg/data/data.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/data/data.h" #include "ten_utils/lib/buf.h" diff --git a/packages/core_protocols/msgpack/msg/field/dest.c b/packages/core_protocols/msgpack/msg/field/dest.c index d6d3631e06..602996f1ac 100644 --- a/packages/core_protocols/msgpack/msg/field/dest.c +++ b/packages/core_protocols/msgpack/msg/field/dest.c @@ -9,7 +9,7 @@ #include "core_protocols/msgpack/msg/loc.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/string.h" void ten_msgpack_msg_dest_serialize(ten_msg_t *self, msgpack_packer *pck) { diff --git a/packages/core_protocols/msgpack/msg/field/name.c b/packages/core_protocols/msgpack/msg/field/name.c index 42ad4035d7..175bed9d37 100644 --- a/packages/core_protocols/msgpack/msg/field/name.c +++ b/packages/core_protocols/msgpack/msg/field/name.c @@ -5,7 +5,7 @@ // #include "core_protocols/msgpack/msg/cmd/field/cmd_id.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "msgpack/object.h" void ten_msgpack_msg_name_serialize(ten_msg_t *self, msgpack_packer *pck) { diff --git a/packages/core_protocols/msgpack/msg/field/properties.c b/packages/core_protocols/msgpack/msg/field/properties.c index c86dc184f8..f70bdbb36c 100644 --- a/packages/core_protocols/msgpack/msg/field/properties.c +++ b/packages/core_protocols/msgpack/msg/field/properties.c @@ -11,7 +11,7 @@ #include "core_protocols/msgpack/common/common.h" #include "core_protocols/msgpack/common/value.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "msgpack/object.h" #include "msgpack/pack.h" #include "ten_utils/container/list_ptr.h" diff --git a/packages/core_protocols/msgpack/msg/field/src.c b/packages/core_protocols/msgpack/msg/field/src.c index e16aea1045..ae64ffe191 100644 --- a/packages/core_protocols/msgpack/msg/field/src.c +++ b/packages/core_protocols/msgpack/msg/field/src.c @@ -9,7 +9,7 @@ #include "core_protocols/msgpack/msg/field/dest.h" #include "core_protocols/msgpack/msg/loc.h" #include "core_protocols/msgpack/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" void ten_msgpack_msg_src_serialize(ten_msg_t *self, msgpack_packer *pck) { TEN_ASSERT(self && ten_raw_msg_check_integrity(self) && pck, diff --git a/packages/core_protocols/msgpack/msg/field/type.c b/packages/core_protocols/msgpack/msg/field/type.c index 793546e273..e34b48233e 100644 --- a/packages/core_protocols/msgpack/msg/field/type.c +++ b/packages/core_protocols/msgpack/msg/field/type.c @@ -8,7 +8,7 @@ #include #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" void ten_msgpack_msg_type_serialize(ten_msg_t *self, msgpack_packer *pck) { TEN_ASSERT(self && ten_raw_msg_check_integrity(self) && pck, diff --git a/packages/core_protocols/msgpack/msg/loc.c b/packages/core_protocols/msgpack/msg/loc.c index 1141338f41..3b32aa7e69 100644 --- a/packages/core_protocols/msgpack/msg/loc.c +++ b/packages/core_protocols/msgpack/msg/loc.c @@ -8,7 +8,7 @@ #include #include "core_protocols/msgpack/common/common.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "msgpack/object.h" #include "msgpack/pack.h" #include "msgpack/unpack.h" diff --git a/packages/core_protocols/msgpack/msg/msg.c b/packages/core_protocols/msgpack/msg/msg.c index a06abc19f2..d866653f8c 100644 --- a/packages/core_protocols/msgpack/msg/msg.c +++ b/packages/core_protocols/msgpack/msg/msg.c @@ -12,7 +12,7 @@ #include "core_protocols/msgpack/msg/field/field_info.h" #include "core_protocols/msgpack/msg/msg.h" #include "core_protocols/msgpack/msg/msg_info.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/smart_ptr.h" void ten_msgpack_msghdr_serialize(ten_msg_t *self, msgpack_packer *pck) { diff --git a/packages/core_protocols/msgpack/protocol.c b/packages/core_protocols/msgpack/protocol.c index da6d04a877..9ccae79ca1 100644 --- a/packages/core_protocols/msgpack/protocol.c +++ b/packages/core_protocols/msgpack/protocol.c @@ -13,7 +13,7 @@ #include "include_internal/ten_runtime/metadata/metadata.h" #include "include_internal/ten_runtime/protocol/integrated/protocol_integrated.h" #include "include_internal/ten_runtime/ten_env/metadata.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/addon/addon.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/packages/example_extensions/ffmpeg_demuxer/src/demuxer.cc b/packages/example_extensions/ffmpeg_demuxer/src/demuxer.cc index 00065c18f7..0ecb96cc92 100644 --- a/packages/example_extensions/ffmpeg_demuxer/src/demuxer.cc +++ b/packages/example_extensions/ffmpeg_demuxer/src/demuxer.cc @@ -14,7 +14,7 @@ #include #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "libavcodec/packet.h" #include "libavutil/channel_layout.h" #include "libswresample/swresample.h" @@ -47,7 +47,7 @@ extern "C" { #include "demuxer_thread.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/lib/alloc.h" diff --git a/packages/example_extensions/ffmpeg_demuxer/src/demuxer_thread.cc b/packages/example_extensions/ffmpeg_demuxer/src/demuxer_thread.cc index f4f32a4a8f..3e2d81924b 100644 --- a/packages/example_extensions/ffmpeg_demuxer/src/demuxer_thread.cc +++ b/packages/example_extensions/ffmpeg_demuxer/src/demuxer_thread.cc @@ -14,7 +14,7 @@ #include "demuxer.h" #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "libavutil/rational.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/lang/cpp/lib/value.h" diff --git a/packages/example_extensions/ffmpeg_muxer/src/muxer.cc b/packages/example_extensions/ffmpeg_muxer/src/muxer.cc index c62f457097..b7e96daeaa 100644 --- a/packages/example_extensions/ffmpeg_muxer/src/muxer.cc +++ b/packages/example_extensions/ffmpeg_muxer/src/muxer.cc @@ -10,7 +10,7 @@ #include #include "include_internal/ten_utils/log/log.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "libavcodec/packet.h" #include "libavutil/channel_layout.h" #include "ten_runtime/binding/cpp/ten.h" diff --git a/tests/common/client/http.c b/tests/common/client/http.c index 0290b3179c..937599b6ff 100644 --- a/tests/common/client/http.c +++ b/tests/common/client/http.c @@ -11,7 +11,7 @@ #include #include "include_internal/ten_utils/lib/buf.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/buf.h" #include "tests/common/client/curl_connect.h" #include "tests/common/constant.h" diff --git a/tests/common/client/msgpack_tcp.c b/tests/common/client/msgpack_tcp.c index 17b71caf88..1f2e6d34e6 100644 --- a/tests/common/client/msgpack_tcp.c +++ b/tests/common/client/msgpack_tcp.c @@ -8,7 +8,7 @@ #include "core_protocols/msgpack/common/parser.h" #include "core_protocols/msgpack/msg/msg.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/alloc.h" diff --git a/tests/common/client/tcp.c b/tests/common/client/tcp.c index eb4e3d0471..54fd7376b9 100644 --- a/tests/common/client/tcp.c +++ b/tests/common/client/tcp.c @@ -9,7 +9,7 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_result/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/ten.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_str.h" diff --git a/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/ten_packages/extension/default_extension_cpp/src/main.cc b/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/ten_packages/extension/default_extension_cpp/src/main.cc index e38c518ddd..f1d0722e8d 100644 --- a/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/ten_packages/extension/default_extension_cpp/src/main.cc +++ b/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/ten_packages/extension/default_extension_cpp/src/main.cc @@ -5,7 +5,7 @@ // #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/cpp/ten.h" class ffmpeg_client_extension : public ten::extension_t { diff --git a/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/ten_packages/extension/default_extension_cpp/src/main.cc b/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/ten_packages/extension/default_extension_cpp/src/main.cc index 99fbc243b7..49a8ea9085 100644 --- a/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/ten_packages/extension/default_extension_cpp/src/main.cc +++ b/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/ten_packages/extension/default_extension_cpp/src/main.cc @@ -5,7 +5,7 @@ // #include -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/binding/cpp/ten.h" class ffmpeg_client_extension : public ten::extension_t { diff --git a/tests/ten_runtime/smoke/audio_frame_test/multi_dest_pcm_frame.cc b/tests/ten_runtime/smoke/audio_frame_test/multi_dest_pcm_frame.cc index 3c872b5dfb..11d6fb5517 100644 --- a/tests/ten_runtime/smoke/audio_frame_test/multi_dest_pcm_frame.cc +++ b/tests/ten_runtime/smoke/audio_frame_test/multi_dest_pcm_frame.cc @@ -9,7 +9,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/data_test/multi_dest_data.cc b/tests/ten_runtime/smoke/data_test/multi_dest_data.cc index 6c21d89e4b..4baa98b2a4 100644 --- a/tests/ten_runtime/smoke/data_test/multi_dest_data.cc +++ b/tests/ten_runtime/smoke/data_test/multi_dest_data.cc @@ -9,7 +9,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_msg_property_to_prop_store.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_msg_property_to_prop_store.cc index ceef11c4ab..84abe0a2fc 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_msg_property_to_prop_store.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_msg_property_to_prop_store.cc @@ -8,7 +8,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/extension_test/command/command_send_enum.cc b/tests/ten_runtime/smoke/extension_test/command/command_send_enum.cc index 714774bd21..f5a72a3ba5 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_send_enum.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_send_enum.cc @@ -8,7 +8,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/extension_test/lock/lock_data_1.cc b/tests/ten_runtime/smoke/extension_test/lock/lock_data_1.cc index dad02e2e46..e9959adfd1 100644 --- a/tests/ten_runtime/smoke/extension_test/lock/lock_data_1.cc +++ b/tests/ten_runtime/smoke/extension_test/lock/lock_data_1.cc @@ -9,7 +9,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/128_threads_attempt_to_suspend_1.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/128_threads_attempt_to_suspend_1.cc index e5512b00dd..0d238f6083 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/128_threads_attempt_to_suspend_1.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/128_threads_attempt_to_suspend_1.cc @@ -12,7 +12,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/16_threads_attempt_to_suspend_1.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/16_threads_attempt_to_suspend_1.cc index 2458352bd9..6e38a92540 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/16_threads_attempt_to_suspend_1.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/16_threads_attempt_to_suspend_1.cc @@ -12,7 +12,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_1.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_1.cc index 3a81569b68..1278b7b0d0 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_1.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_1.cc @@ -11,7 +11,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_2.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_2.cc index 1f092e3786..3223c46fe9 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_2.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_2.cc @@ -11,7 +11,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_3.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_3.cc index 025cd418e7..79ce3989f6 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_3.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_3.cc @@ -12,7 +12,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_4.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_4.cc index c26d963426..d0adc53b9d 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_4.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_4.cc @@ -12,7 +12,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_5.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_5.cc index f13ebfa68d..363a98e2b7 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_5.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_5.cc @@ -12,7 +12,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_6.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_6.cc index 59a31bfb97..65e4333667 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_6.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_6.cc @@ -11,7 +11,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_7.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_7.cc index 0d783dfcb4..7bc46528a2 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_7.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_7.cc @@ -11,7 +11,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_1.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_1.cc index b3c8dad4fd..f9f6c8201c 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_1.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_1.cc @@ -12,7 +12,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_2.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_2.cc index 0dde6da4f2..3d2f094bf0 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_2.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_2.cc @@ -12,7 +12,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_3.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_3.cc index 9cacf8eaeb..499a7b1744 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_3.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_3.cc @@ -12,7 +12,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_4.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_4.cc index a472589e4d..08fbb2cbd7 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_4.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_4.cc @@ -12,7 +12,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc index 517431e1e5..d60b2102e2 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc @@ -12,7 +12,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_6.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_6.cc index 9aec13ba70..f16cdc5d01 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_6.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_6.cc @@ -12,7 +12,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/auto_free_out_of_scope.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/auto_free_out_of_scope.cc index 19bb2bfb19..e836431108 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/auto_free_out_of_scope.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/auto_free_out_of_scope.cc @@ -13,7 +13,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_runtime/common/status_code.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data.cc index b4949c7c3f..22ed9ff79a 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data.cc @@ -11,7 +11,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data_resp_handler.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data_resp_handler.cc index 4b2ccf6944..07aaaf7bf6 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data_resp_handler.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data_resp_handler.cc @@ -12,7 +12,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_1.cc b/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_1.cc index 9f28222cdb..f13fdef4d4 100644 --- a/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_1.cc +++ b/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_1.cc @@ -11,7 +11,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_2.cc b/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_2.cc index b446a73f89..316e2454e8 100644 --- a/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_2.cc +++ b/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_2.cc @@ -11,7 +11,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/video_frame_test/multi_dest_video_frame.cc b/tests/ten_runtime/smoke/video_frame_test/multi_dest_video_frame.cc index f1bb03db9f..6d7c01fa40 100644 --- a/tests/ten_runtime/smoke/video_frame_test/multi_dest_video_frame.cc +++ b/tests/ten_runtime/smoke/video_frame_test/multi_dest_video_frame.cc @@ -9,7 +9,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/macro/check.h" +#include "ten_utils/macro/check.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" From 6b98e3e743d78410c74c784207cc0c451c3a0c95 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Mon, 16 Sep 2024 19:33:14 +0800 Subject: [PATCH 05/13] feat: new log mechanism --- core/src/ten_utils/backtrace/platform/posix/darwin/backtrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/ten_utils/backtrace/platform/posix/darwin/backtrace.c b/core/src/ten_utils/backtrace/platform/posix/darwin/backtrace.c index 213d120616..aa96f855f6 100644 --- a/core/src/ten_utils/backtrace/platform/posix/darwin/backtrace.c +++ b/core/src/ten_utils/backtrace/platform/posix/darwin/backtrace.c @@ -58,7 +58,7 @@ void ten_backtrace_dump(ten_backtrace_t *self, size_t skip) { int frames = backtrace(call_stack, 128); char **strs = backtrace_symbols(call_stack, frames); for (size_t i = skip; i < frames; ++i) { - TEN_LOGE_AUX(((ten_backtrace_common_t *)self)->log, "%s", strs[i]); + TEN_LOGE("%s", strs[i]); } free(strs); } From 3d308d7cedd20bb4f1062ec8ca81adcb35e5f438 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Mon, 16 Sep 2024 19:38:45 +0800 Subject: [PATCH 06/13] feat: new log mechanism --- core/src/ten_utils/log/output.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/ten_utils/log/output.c b/core/src/ten_utils/log/output.c index c2aa0250ad..3bd3ac5684 100644 --- a/core/src/ten_utils/log/output.c +++ b/core/src/ten_utils/log/output.c @@ -17,8 +17,8 @@ #include "include_internal/ten_utils/log/log.h" #include "include_internal/ten_utils/log/output.h" -#include "ten_utils/macro/check.h" #include "ten_utils/lib/file.h" +#include "ten_utils/macro/check.h" static void ten_log_output_set(ten_log_t *self, const ten_log_output_func_t output_cb, @@ -36,7 +36,7 @@ static void ten_log_close_file_cb(void *user_data) { assert(fd && *fd && "Invalid argument."); #if defined(_WIN32) || defined(_WIN64) - arg = NULL; + user_data = NULL; HANDLE handle = (HANDLE)_get_osfhandle(*fd); CloseHandle(handle); #else @@ -66,7 +66,7 @@ static void ten_log_output_file_cb(ten_string_t *msg, void *user_data) { ten_string_append_formatted(msg, "%s", TEN_LOG_EOL); #if defined(_WIN32) || defined(_WIN64) - HANDLE handle = *(HANDLE *)arg; + HANDLE handle = *(HANDLE *)user_data; // WriteFile() is atomic for local files opened with // FILE_APPEND_DATA and without FILE_WRITE_DATA From 7219cfa08563405537b89b6332c5a3c16bfd35d5 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Mon, 16 Sep 2024 21:27:08 +0800 Subject: [PATCH 07/13] feat: new log mechanism --- .../binding/go/interface/ten/ten_env.go | 7 +--- .../interface/ten/libten_runtime_python.pyi | 16 +++---- .../binding/python/interface/ten/ten_env.py | 42 ++++++++----------- core/src/ten_utils/log/output.c | 10 ++--- packages/core_apps/default_app_python/main.py | 4 +- 5 files changed, 34 insertions(+), 45 deletions(-) diff --git a/core/src/ten_runtime/binding/go/interface/ten/ten_env.go b/core/src/ten_runtime/binding/go/interface/ten/ten_env.go index ab5aaa621f..94e84f8d24 100644 --- a/core/src/ten_runtime/binding/go/interface/ten/ten_env.go +++ b/core/src/ten_runtime/binding/go/interface/ten/ten_env.go @@ -90,7 +90,7 @@ type TenEnv interface { InitPropertyFromJSONBytes(value []byte) error - // Log(level LogLevel, msg string, args ...interface{}) error + Log(level LogLevel, msg string, args ...interface{}) error } // Making a compile-time assertion which indicates that if 'ten' type doesn't @@ -536,10 +536,7 @@ func (p *tenEnv) SetPropertyAsync( return nil } -func (p *tenEnv) Log(level LogLevel, msg string, args ...interface{}) error { - // Format the message with the provided arguments - formattedMsg := fmt.Sprintf(msg, args...) - +func (p *tenEnv) Log(level LogLevel, msg string) error { // Get caller info pc, fileName, lineNo, ok := runtime.Caller( 1, // 1 means the caller of this function diff --git a/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi b/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi index 290a979e32..e5c839a219 100644 --- a/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi +++ b/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi @@ -109,14 +109,14 @@ class _TenEnv: def is_property_exist(self, path: str) -> bool: ... def is_cmd_connected(self, msg_name: str) -> bool: ... def init_property_from_json(self, json_str: str) -> None: ... - # def log( - # self, - # level: TenEnvLogLevel, - # func_name: str | None, - # file_name: str | None, - # line_no: int, - # msg: str, - # ) -> None: ... + def log( + self, + level: TenEnvLogLevel, + func_name: str | None, + file_name: str | None, + line_no: int, + msg: str, + ) -> None: ... class _App: def run(self, run_in_background_flag: int) -> None: ... diff --git a/core/src/ten_runtime/binding/python/interface/ten/ten_env.py b/core/src/ten_runtime/binding/python/interface/ten/ten_env.py index ddc30b0509..e95718fc41 100644 --- a/core/src/ten_runtime/binding/python/interface/ten/ten_env.py +++ b/core/src/ten_runtime/binding/python/interface/ten/ten_env.py @@ -112,27 +112,21 @@ def set_property_float(self, path: str, value: float) -> None: def init_property_from_json(self, json_str: str) -> None: return self._internal.init_property_from_json(json_str) - # def log( - # self, - # level: TenEnvLogLevel, - # *args, - # ) -> None: - # msg = " ".join(map(str, args)) - - # # Get the current frame and the caller's frame. - # frame = inspect.currentframe() - # if frame is not None: - # caller_frame = frame.f_back - # if caller_frame is not None: - # # Extract information from the caller's frame - # file_name = caller_frame.f_code.co_filename - # func_name = caller_frame.f_code.co_name - # line_no = caller_frame.f_lineno - - # return self._internal.log( - # level, func_name, file_name, line_no, msg - # ) - # else: - # return self._internal.log(level, None, None, 0, msg) - # else: - # return self._internal.log(level, None, None, 0, msg) + def log(self, level: TenEnvLogLevel, msg: str) -> None: + # Get the current frame and the caller's frame. + frame = inspect.currentframe() + if frame is not None: + caller_frame = frame.f_back + if caller_frame is not None: + # Extract information from the caller's frame + file_name = caller_frame.f_code.co_filename + func_name = caller_frame.f_code.co_name + line_no = caller_frame.f_lineno + + return self._internal.log( + level, func_name, file_name, line_no, msg + ) + else: + return self._internal.log(level, None, None, 0, msg) + else: + return self._internal.log(level, None, None, 0, msg) diff --git a/core/src/ten_utils/log/output.c b/core/src/ten_utils/log/output.c index 3bd3ac5684..0e71f76c4c 100644 --- a/core/src/ten_utils/log/output.c +++ b/core/src/ten_utils/log/output.c @@ -71,9 +71,8 @@ static void ten_log_output_file_cb(ten_string_t *msg, void *user_data) { // WriteFile() is atomic for local files opened with // FILE_APPEND_DATA and without FILE_WRITE_DATA DWORD written; - WriteFile(handle, msg->buf_start, - (DWORD)(msg->buf_content_end - msg->buf_start + eol_len), &written, - 0); + WriteFile(handle, ten_string_get_raw_str(msg), (DWORD)ten_string_len(msg), + &written, 0); #else int fd = *(int *)user_data; @@ -102,9 +101,8 @@ void ten_log_out_stderr_cb(ten_string_t *msg, void *user_data) { // WriteFile() is atomic for local files opened with FILE_APPEND_DATA and // without FILE_WRITE_DATA DWORD written; - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg->buf_start, - (DWORD)(msg->buf_content_end - msg->buf_start + eol_len), &written, - 0); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), ten_string_get_raw_str(msg), + (DWORD)ten_string_len(msg), &written, 0); #else // TODO(Wei): write() is atomic for buffers less than or equal to PIPE_BUF, // therefore we need to have some locking mechanism here to prevent log diff --git a/packages/core_apps/default_app_python/main.py b/packages/core_apps/default_app_python/main.py index 7599bdfc0d..815ae2fbe2 100644 --- a/packages/core_apps/default_app_python/main.py +++ b/packages/core_apps/default_app_python/main.py @@ -3,13 +3,13 @@ # Licensed under the Apache License, Version 2.0. # See the LICENSE file for more information. # -from ten import App, TenEnv +from ten import App, TenEnv, TenEnvLogLevel class DefaultApp(App): def on_init(self, ten_env: TenEnv): - print("app on_init") + ten_env.log(TenEnvLogLevel.DEBUG, "app on_init") ten_env.on_init_done() def on_deinit(self, ten_env: TenEnv) -> None: From df175aa31115094a119c11559f89e8939f6e3fe2 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Mon, 16 Sep 2024 21:30:58 +0800 Subject: [PATCH 08/13] feat: new log mechanism --- core/src/ten_runtime/binding/go/interface/ten/ten_env.go | 6 +++--- .../ten_runtime/binding/python/interface/ten/__init__.py | 4 ++-- .../binding/python/interface/ten/libten_runtime_python.pyi | 4 ++-- .../interface/ten/{ten_env_log_level.py => log_level.py} | 2 +- .../src/ten_runtime/binding/python/interface/ten/ten_env.py | 4 ++-- packages/core_apps/default_app_python/main.py | 4 ++-- .../extension/default_extension_python/extension.py | 6 ++++-- 7 files changed, 16 insertions(+), 14 deletions(-) rename core/src/ten_runtime/binding/python/interface/ten/{ten_env_log_level.py => log_level.py} (89%) diff --git a/core/src/ten_runtime/binding/go/interface/ten/ten_env.go b/core/src/ten_runtime/binding/go/interface/ten/ten_env.go index 94e84f8d24..4390e94a86 100644 --- a/core/src/ten_runtime/binding/go/interface/ten/ten_env.go +++ b/core/src/ten_runtime/binding/go/interface/ten/ten_env.go @@ -90,7 +90,7 @@ type TenEnv interface { InitPropertyFromJSONBytes(value []byte) error - Log(level LogLevel, msg string, args ...interface{}) error + Log(level LogLevel, msg string) error } // Making a compile-time assertion which indicates that if 'ten' type doesn't @@ -566,8 +566,8 @@ func (p *tenEnv) Log(level LogLevel, msg string) error { unsafe.Pointer(unsafe.StringData(fileName)), C.int(len(fileName)), C.int(lineNo), - unsafe.Pointer(unsafe.StringData(formattedMsg)), - C.int(len(formattedMsg)), + unsafe.Pointer(unsafe.StringData(msg)), + C.int(len(msg)), ) return nil diff --git a/core/src/ten_runtime/binding/python/interface/ten/__init__.py b/core/src/ten_runtime/binding/python/interface/ten/__init__.py index 37c3329267..898f5219eb 100644 --- a/core/src/ten_runtime/binding/python/interface/ten/__init__.py +++ b/core/src/ten_runtime/binding/python/interface/ten/__init__.py @@ -16,7 +16,7 @@ from .video_frame import VideoFrame, PixelFmt from .audio_frame import AudioFrame, AudioFrameDataFmt from .data import Data -from .ten_env_log_level import TenEnvLogLevel +from .log_level import LogLevel # Specify what should be imported when a user imports * from the # ten_runtime_python package. @@ -35,5 +35,5 @@ "CmdResult", "PixelFmt", "AudioFrameDataFmt", - "TenEnvLogLevel", + "LogLevel", ] diff --git a/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi b/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi index e5c839a219..e4d8a71df4 100644 --- a/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi +++ b/core/src/ten_runtime/binding/python/interface/ten/libten_runtime_python.pyi @@ -4,7 +4,7 @@ # information. # from .ten_env_attach_to_enum import _TenEnvAttachTo -from .ten_env_log_level import TenEnvLogLevel +from .log_level import LogLevel class _Msg: def to_json(self) -> str: ... @@ -111,7 +111,7 @@ class _TenEnv: def init_property_from_json(self, json_str: str) -> None: ... def log( self, - level: TenEnvLogLevel, + level: LogLevel, func_name: str | None, file_name: str | None, line_no: int, diff --git a/core/src/ten_runtime/binding/python/interface/ten/ten_env_log_level.py b/core/src/ten_runtime/binding/python/interface/ten/log_level.py similarity index 89% rename from core/src/ten_runtime/binding/python/interface/ten/ten_env_log_level.py rename to core/src/ten_runtime/binding/python/interface/ten/log_level.py index 83db269c8b..a7a3d444c3 100644 --- a/core/src/ten_runtime/binding/python/interface/ten/ten_env_log_level.py +++ b/core/src/ten_runtime/binding/python/interface/ten/log_level.py @@ -6,7 +6,7 @@ from enum import IntEnum -class TenEnvLogLevel(IntEnum): +class LogLevel(IntEnum): INVALID = 0 VERBOSE = 1 DEBUG = 2 diff --git a/core/src/ten_runtime/binding/python/interface/ten/ten_env.py b/core/src/ten_runtime/binding/python/interface/ten/ten_env.py index e95718fc41..dd7be92e32 100644 --- a/core/src/ten_runtime/binding/python/interface/ten/ten_env.py +++ b/core/src/ten_runtime/binding/python/interface/ten/ten_env.py @@ -12,7 +12,7 @@ from .video_frame import VideoFrame from .audio_frame import AudioFrame from .data import Data -from .ten_env_log_level import TenEnvLogLevel +from .log_level import LogLevel class TenEnv: ... # type: ignore @@ -112,7 +112,7 @@ def set_property_float(self, path: str, value: float) -> None: def init_property_from_json(self, json_str: str) -> None: return self._internal.init_property_from_json(json_str) - def log(self, level: TenEnvLogLevel, msg: str) -> None: + def log(self, level: LogLevel, msg: str) -> None: # Get the current frame and the caller's frame. frame = inspect.currentframe() if frame is not None: diff --git a/packages/core_apps/default_app_python/main.py b/packages/core_apps/default_app_python/main.py index 815ae2fbe2..823b21a868 100644 --- a/packages/core_apps/default_app_python/main.py +++ b/packages/core_apps/default_app_python/main.py @@ -3,13 +3,13 @@ # Licensed under the Apache License, Version 2.0. # See the LICENSE file for more information. # -from ten import App, TenEnv, TenEnvLogLevel +from ten import App, TenEnv, LogLevel class DefaultApp(App): def on_init(self, ten_env: TenEnv): - ten_env.log(TenEnvLogLevel.DEBUG, "app on_init") + ten_env.log(LogLevel.DEBUG, "app on_init") ten_env.on_init_done() def on_deinit(self, ten_env: TenEnv) -> None: diff --git a/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/ten_packages/extension/default_extension_python/extension.py b/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/ten_packages/extension/default_extension_python/extension.py index 938f05429c..ac3fe9f4bf 100644 --- a/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/ten_packages/extension/default_extension_python/extension.py +++ b/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/ten_packages/extension/default_extension_python/extension.py @@ -3,7 +3,7 @@ # See https://github.com/TEN-framework/ten_framework/LICENSE for license # information. # -from ten import Extension, TenEnv, Cmd, StatusCode, CmdResult, TenEnvLogLevel +from ten import Extension, TenEnv, Cmd, StatusCode, CmdResult, LogLevel class DefaultExtension(Extension): @@ -12,7 +12,9 @@ def __init__(self, name: str) -> None: self.name = name def on_init(self, ten_env: TenEnv) -> None: - print("DefaultExtension on_init, name", self.name) + ten_env.log( + LogLevel.DEBUG, f"DefaultExtension on_init, name: {self.name}" + ) assert self.name == "default_extension_python" ten_env.init_property_from_json('{"testKey": "testValue"}') From 0ad192d23a907cf2c352a02f50b69ed432db1ee3 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 17 Sep 2024 13:43:39 +0800 Subject: [PATCH 09/13] feat: new log mechanism --- .../binding/cpp/internal/ten_env.h | 44 ++++++- .../ten_runtime/ten_env/internal/log.h | 16 +++ core/include/ten_runtime/ten_env/ten_env.h | 1 + core/include/ten_utils/log/log.h | 120 +++++++----------- .../binding/python/extension/extension.h | 4 +- .../ten_runtime/ten_env/log.h | 16 +-- .../ten_runtime/ten_env/ten_env.h | 5 +- core/include_internal/ten_utils/log/log.h | 12 +- .../binding/go/interface/ten/log_level.go | 18 +++ .../binding/go/interface/ten/ten_env.go | 62 ++++++--- .../binding/go/interface/ten/ten_env.h | 8 +- .../binding/go/native/ten_env/ten_env_log.c | 18 +-- .../binding/python/interface/ten/ten_env.py | 61 ++++++--- .../binding/python/native/common/error.c | 14 +- .../python/native/extension/extension.c | 57 +++++---- .../python/native/ten_env/ten_env_log.c | 25 ++-- .../ten_env/internal/attached_loc.c | 35 +++++ core/src/ten_runtime/ten_env/internal/log.c | 53 +++++--- core/src/ten_runtime/timer/timer.c | 14 +- core/src/ten_utils/log/log.c | 25 +++- core/src/ten_utils/sanitizer/memory_check.c | 2 +- packages/core_apps/default_app_go/main.go | 8 +- packages/core_apps/default_app_python/main.py | 4 +- .../src/default_extension_group.c | 5 +- .../default_extension_go/default_extension.go | 6 +- .../default_extension_python/extension.py | 24 ++-- .../extension.py.tent | 24 ++-- .../py_init_extension_cpp/src/main.cc | 58 ++++++--- .../ffmpeg_demuxer/src/demuxer.cc | 6 +- .../ffmpeg_demuxer/src/demuxer_thread.cc | 4 +- .../ffmpeg_muxer/src/muxer.cc | 4 +- .../ffmpeg_muxer/src/muxer_thread.cc | 2 +- .../pil_demo_python/main.py | 21 ++- .../default_extension_go/default_extension.go | 6 +- .../default_extension_python/extension.py | 32 ++--- .../smoke/cmd_result_test/multiple_result.cc | 4 +- .../basic/basic_hello_world_1.cc | 3 + 37 files changed, 520 insertions(+), 301 deletions(-) create mode 100644 core/include/ten_runtime/ten_env/internal/log.h create mode 100644 core/src/ten_runtime/binding/go/interface/ten/log_level.go create mode 100644 core/src/ten_runtime/ten_env/internal/attached_loc.c diff --git a/core/include/ten_runtime/binding/cpp/internal/ten_env.h b/core/include/ten_runtime/binding/cpp/internal/ten_env.h index e67403b549..02f1c0f17c 100644 --- a/core/include/ten_runtime/binding/cpp/internal/ten_env.h +++ b/core/include/ten_runtime/binding/cpp/internal/ten_env.h @@ -8,7 +8,6 @@ #include #include -#include "ten_utils/macro/check.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" #include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" @@ -25,6 +24,8 @@ #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/buf.h" #include "ten_utils/lib/error.h" +#include "ten_utils/log/log.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_json.h" @@ -1032,6 +1033,47 @@ class ten_env_t { void *get_attached_target() { return get_attached_target(nullptr); } +#define TEN_ENV_LOG_VERBOSE(ten_env, msg) \ + do { \ + (ten_env).log(TEN_LOG_LEVEL_VERBOSE, __func__, __FILE__, __LINE__, (msg)); \ + } while (0) + +#define TEN_ENV_LOG_DEBUG(ten_env, msg) \ + do { \ + (ten_env).log(TEN_LOG_LEVEL_DEBUG, __func__, __FILE__, __LINE__, (msg)); \ + } while (0) + +#define TEN_ENV_LOG_INFO(ten_env, msg) \ + do { \ + (ten_env).log(TEN_LOG_LEVEL_INFO, __func__, __FILE__, __LINE__, (msg)); \ + } while (0) + +#define TEN_ENV_LOG_WARN(ten_env, msg) \ + do { \ + (ten_env).log(TEN_LOG_LEVEL_WARN, __func__, __FILE__, __LINE__, (msg)); \ + } while (0) + +#define TEN_ENV_LOG_ERROR(ten_env, msg) \ + do { \ + (ten_env).log(TEN_LOG_LEVEL_ERROR, __func__, __FILE__, __LINE__, (msg)); \ + } while (0) + +#define TEN_ENV_LOG_FATAL(ten_env, msg) \ + do { \ + (ten_env).log(TEN_LOG_LEVEL_FATAL, __func__, __FILE__, __LINE__, (msg)); \ + } while (0) + +#define TEN_ENV_LOG(ten_env, level, msg) \ + do { \ + (ten_env).log((level), __func__, __FILE__, __LINE__, (msg)); \ + } while (0) + + void log(TEN_LOG_LEVEL level, const char *func_name, const char *file_name, + size_t line_no, const char *msg) { + TEN_ASSERT(c_ten_env, "Should not happen."); + ten_env_log(c_ten_env, level, func_name, file_name, line_no, msg); + } + private: friend class ten_env_proxy_t; friend class ten_env_mock_t; diff --git a/core/include/ten_runtime/ten_env/internal/log.h b/core/include/ten_runtime/ten_env/internal/log.h new file mode 100644 index 0000000000..80dcf2fd7d --- /dev/null +++ b/core/include/ten_runtime/ten_env/internal/log.h @@ -0,0 +1,16 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#pragma once + +#include "ten_runtime/ten_config.h" + +#include "ten_utils/log/log.h" + +typedef struct ten_env_t ten_env_t; + +TEN_RUNTIME_API void ten_env_log(ten_env_t *self, TEN_LOG_LEVEL level, + const char *func_name, const char *file_name, + size_t line_no, const char *msg); diff --git a/core/include/ten_runtime/ten_env/ten_env.h b/core/include/ten_runtime/ten_env/ten_env.h index c2bb1677ab..39f7495f24 100644 --- a/core/include/ten_runtime/ten_env/ten_env.h +++ b/core/include/ten_runtime/ten_env/ten_env.h @@ -8,6 +8,7 @@ #include "ten_runtime/ten_config.h" #include "ten_runtime/common/errno.h" // IWYU pragma: keep +#include "ten_runtime/ten_env/internal/log.h" // IWYU pragma: keep #include "ten_runtime/ten_env/internal/metadata.h" // IWYU pragma: keep #include "ten_runtime/ten_env/internal/on_xxx_done.h" // IWYU pragma: keep #include "ten_runtime/ten_env/internal/return.h" // IWYU pragma: keep diff --git a/core/include/ten_utils/log/log.h b/core/include/ten_utils/log/log.h index 9f132aabfa..3fe4e5c84b 100644 --- a/core/include/ten_utils/log/log.h +++ b/core/include/ten_utils/log/log.h @@ -13,100 +13,76 @@ #include "ten_utils/lib/signature.h" -#define TEN_LOGV(...) \ - do { \ - if (ten_global_log.output_level <= TEN_LOG_LEVEL_VERBOSE) { \ - ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_VERBOSE, __func__, \ - __FILE__, __LINE__, __VA_ARGS__); \ - } \ - } while (0) - -#define TEN_LOGD(...) \ +#define TEN_LOGV(...) \ do { \ - if (ten_global_log.output_level <= TEN_LOG_LEVEL_DEBUG) { \ - ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_DEBUG, __func__, \ - __FILE__, __LINE__, __VA_ARGS__); \ - } \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_VERBOSE, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ } while (0) -#define TEN_LOGI(...) \ - do { \ - if (ten_global_log.output_level <= TEN_LOG_LEVEL_INFO) { \ - ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_INFO, __func__, \ - __FILE__, __LINE__, __VA_ARGS__); \ - } \ +#define TEN_LOGD(...) \ + do { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_DEBUG, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ } while (0) -#define TEN_LOGW(...) \ - do { \ - if (ten_global_log.output_level <= TEN_LOG_LEVEL_WARN) { \ - ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_WARN, __func__, \ - __FILE__, __LINE__, __VA_ARGS__); \ - } \ +#define TEN_LOGI(...) \ + do { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_INFO, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ } while (0) -#define TEN_LOGE(...) \ - do { \ - if (ten_global_log.output_level <= TEN_LOG_LEVEL_ERROR) { \ - ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_ERROR, __func__, \ - __FILE__, __LINE__, __VA_ARGS__); \ - } \ +#define TEN_LOGW(...) \ + do { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_WARN, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ } while (0) -#define TEN_LOGF(...) \ - do { \ - if (ten_global_log.output_level <= TEN_LOG_LEVEL_FATAL) { \ - ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_FATAL, __func__, \ - __FILE__, __LINE__, __VA_ARGS__); \ - } \ +#define TEN_LOGE(...) \ + do { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_ERROR, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ } while (0) -#define TEN_LOGV_AUX(log, ...) \ - do { \ - if ((log)->output_level <= TEN_LOG_LEVEL_VERBOSE) { \ - ten_log_log_formatted(log, TEN_LOG_LEVEL_VERBOSE, __func__, __FILE__, \ - __LINE__, __VA_ARGS__); \ - } \ +#define TEN_LOGF(...) \ + do { \ + ten_log_log_formatted(&ten_global_log, TEN_LOG_LEVEL_FATAL, __func__, \ + __FILE__, __LINE__, __VA_ARGS__); \ } while (0) -#define TEN_LOGD_AUX(log, ...) \ +#define TEN_LOGV_AUX(log, ...) \ do { \ - if ((log)->output_level <= TEN_LOG_LEVEL_DEBUG) { \ - ten_log_log_formatted(log, TEN_LOG_LEVEL_DEBUG, __func__, __FILE__, \ - __LINE__, __VA_ARGS__); \ - } \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_VERBOSE, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ } while (0) -#define TEN_LOGI_AUX(log, ...) \ - do { \ - if ((log)->output_level <= TEN_LOG_LEVEL_INFO) { \ - ten_log_log_formatted(log, TEN_LOG_LEVEL_INFO, __func__, __FILE__, \ - __LINE__, __VA_ARGS__); \ - } \ +#define TEN_LOGD_AUX(log, ...) \ + do { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_DEBUG, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ } while (0) -#define TEN_LOGW_AUX(log, ...) \ - do { \ - if ((log)->output_level <= TEN_LOG_LEVEL_WARN) { \ - ten_log_log_formatted(log, TEN_LOG_LEVEL_WARN, __func__, __FILE__, \ - __LINE__, __VA_ARGS__); \ - } \ +#define TEN_LOGI_AUX(log, ...) \ + do { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_INFO, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ } while (0) -#define TEN_LOGE_AUX(log, ...) \ - do { \ - if ((log)->output_level <= TEN_LOG_LEVEL_ERROR) { \ - ten_log_log_formatted(log, TEN_LOG_LEVEL_ERROR, __func__, __FILE__, \ - __LINE__, __VA_ARGS__); \ - } \ +#define TEN_LOGW_AUX(log, ...) \ + do { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_WARN, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ } while (0) -#define TEN_LOGF_AUX(log, ...) \ - do { \ - if ((log)->output_level <= TEN_LOG_LEVEL_FATAL) { \ - ten_log_log_formatted(log, TEN_LOG_LEVEL_FATAL, __func__, __FILE__, \ - __LINE__, __VA_ARGS__); \ - } \ +#define TEN_LOGE_AUX(log, ...) \ + do { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_ERROR, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ + } while (0) + +#define TEN_LOGF_AUX(log, ...) \ + do { \ + ten_log_log_formatted(log, TEN_LOG_LEVEL_FATAL, __func__, __FILE__, \ + __LINE__, __VA_ARGS__); \ } while (0) typedef enum TEN_LOG_LEVEL { diff --git a/core/include_internal/ten_runtime/binding/python/extension/extension.h b/core/include_internal/ten_runtime/binding/python/extension/extension.h index 95720a2884..7456be1f32 100644 --- a/core/include_internal/ten_runtime/binding/python/extension/extension.h +++ b/core/include_internal/ten_runtime/binding/python/extension/extension.h @@ -20,7 +20,9 @@ typedef struct ten_py_extension_t { PyObject_HEAD ten_signature_t signature; ten_extension_t *c_extension; - PyObject *py_ten; // Companion TEN object. + + // Companion TEN object, the actual type is ten_py_ten_env_t. + PyObject *py_ten_env; } ten_py_extension_t; TEN_RUNTIME_PRIVATE_API bool ten_py_extension_init_for_module(PyObject *module); diff --git a/core/include_internal/ten_runtime/ten_env/log.h b/core/include_internal/ten_runtime/ten_env/log.h index 5f8021510e..bac4d93222 100644 --- a/core/include_internal/ten_runtime/ten_env/log.h +++ b/core/include_internal/ten_runtime/ten_env/log.h @@ -7,21 +7,15 @@ #include "ten_runtime/ten_config.h" -#include "include_internal/ten_utils/log/log.h" +#include "ten_utils/log/log.h" typedef struct ten_env_t ten_env_t; -TEN_RUNTIME_API void ten_env_log(ten_env_t *self, TEN_LOG_LEVEL level, - const char *func_name, const char *file_name, - size_t line_no, const char *msg); - -TEN_RUNTIME_API void ten_env_log_formatted(ten_env_t *self, TEN_LOG_LEVEL level, - const char *func_name, - const char *file_name, - size_t line_no, const char *fmt, - ...); - TEN_RUNTIME_API void ten_env_log_with_size_formatted( ten_env_t *self, TEN_LOG_LEVEL level, const char *func_name, size_t func_name_len, const char *file_name, size_t file_name_len, size_t line_no, const char *fmt, ...); + +TEN_RUNTIME_API void ten_env_log_without_check_thread( + ten_env_t *self, TEN_LOG_LEVEL level, const char *func_name, + const char *file_name, size_t line_no, const char *msg); diff --git a/core/include_internal/ten_runtime/ten_env/ten_env.h b/core/include_internal/ten_runtime/ten_env/ten_env.h index 0c53f8783f..ac7d7309bb 100644 --- a/core/include_internal/ten_runtime/ten_env/ten_env.h +++ b/core/include_internal/ten_runtime/ten_env/ten_env.h @@ -10,9 +10,9 @@ #include "include_internal/ten_runtime/addon/addon.h" #include "include_internal/ten_runtime/binding/common.h" #include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/io/runloop.h" +#include "ten_utils/macro/check.h" #define TEN_SIGNATURE 0x1336D348DA779EA6U @@ -103,6 +103,9 @@ TEN_RUNTIME_API TEN_ENV_ATTACH_TO ten_env_get_attach_to(ten_env_t *self); TEN_RUNTIME_PRIVATE_API void ten_env_set_attach_to( ten_env_t *self, TEN_ENV_ATTACH_TO attach_to_type, void *attach_to); +TEN_RUNTIME_PRIVATE_API const char *ten_env_get_attached_instance_name( + ten_env_t *self); + inline ten_extension_t *ten_env_get_attached_extension(ten_env_t *self) { TEN_ASSERT(self, "Invalid argument."); // TEN_NOLINTNEXTLINE(thread-check) diff --git a/core/include_internal/ten_utils/log/log.h b/core/include_internal/ten_utils/log/log.h index 9bd2166aed..59c91ea2d8 100644 --- a/core/include_internal/ten_utils/log/log.h +++ b/core/include_internal/ten_utils/log/log.h @@ -35,7 +35,7 @@ TEN_UTILS_API void ten_log_log_with_size_from_va_list( size_t func_name_len, const char *file_name, size_t file_name_len, size_t line_no, const char *fmt, va_list ap); -TEN_UTILS_API void ten_log_log_from_va_list( +TEN_UTILS_PRIVATE_API void ten_log_log_from_va_list( ten_log_t *self, TEN_LOG_LEVEL level, const char *func_name, const char *file_name, size_t line_no, const char *fmt, va_list ap); @@ -43,10 +43,12 @@ TEN_UTILS_API void ten_log_log(ten_log_t *self, TEN_LOG_LEVEL level, const char *func_name, const char *file_name, size_t line_no, const char *msg); -TEN_UTILS_PRIVATE_API void ten_log_log_with_size( - ten_log_t *self, TEN_LOG_LEVEL level, const char *func_name, - size_t func_name_len, const char *file_name, size_t file_name_len, - size_t line_no, const char *msg, size_t msg_len); +TEN_UTILS_API void ten_log_log_with_size(ten_log_t *self, TEN_LOG_LEVEL level, + const char *func_name, + size_t func_name_len, + const char *file_name, + size_t file_name_len, size_t line_no, + const char *msg, size_t msg_len); TEN_UTILS_API void ten_log_global_init(void); diff --git a/core/src/ten_runtime/binding/go/interface/ten/log_level.go b/core/src/ten_runtime/binding/go/interface/ten/log_level.go new file mode 100644 index 0000000000..bbe3fdaacd --- /dev/null +++ b/core/src/ten_runtime/binding/go/interface/ten/log_level.go @@ -0,0 +1,18 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// + +package ten + +type LogLevel int32 + +const ( + LogLevelVerbose = 1 + LogLevelDebug = 2 + LogLevelInfo = 3 + LogLevelWarn = 4 + LogLevelError = 5 + LogLevelFatal = 6 +) diff --git a/core/src/ten_runtime/binding/go/interface/ten/ten_env.go b/core/src/ten_runtime/binding/go/interface/ten/ten_env.go index 4390e94a86..e195ce5368 100644 --- a/core/src/ten_runtime/binding/go/interface/ten/ten_env.go +++ b/core/src/ten_runtime/binding/go/interface/ten/ten_env.go @@ -23,19 +23,6 @@ type ( ResultHandler func(TenEnv, CmdResult) ) -type LogLevel int32 - -const ( - logLevelInvalid LogLevel = iota - - LogLevelVerbose - LogLevelDebug - LogLevelInfo - LogLevelWarn - LogLevelError - LogLevelFatal -) - // TenEnv represents the interface for the TEN (Run Time Environment) component. type TenEnv interface { postSyncJob(payload job) any @@ -90,7 +77,15 @@ type TenEnv interface { InitPropertyFromJSONBytes(value []byte) error - Log(level LogLevel, msg string) error + LogVerbose(msg string) + LogDebug(msg string) + LogInfo(msg string) + LogWarn(msg string) + LogError(msg string) + LogFatal(msg string) + Log(level LogLevel, msg string) + + logInternal(level LogLevel, msg string, skip int) } // Making a compile-time assertion which indicates that if 'ten' type doesn't @@ -536,11 +531,38 @@ func (p *tenEnv) SetPropertyAsync( return nil } -func (p *tenEnv) Log(level LogLevel, msg string) error { - // Get caller info - pc, fileName, lineNo, ok := runtime.Caller( - 1, // 1 means the caller of this function - ) +func (p *tenEnv) LogVerbose(msg string) { + p.logInternal( + LogLevelVerbose, msg, 2) +} + +func (p *tenEnv) LogDebug(msg string) { + p.logInternal(LogLevelDebug, msg, 2) +} + +func (p *tenEnv) LogInfo(msg string) { + p.logInternal(LogLevelInfo, msg, 2) +} + +func (p *tenEnv) LogWarn(msg string) { + p.logInternal(LogLevelWarn, msg, 2) +} + +func (p *tenEnv) LogError(msg string) { + p.logInternal(LogLevelError, msg, 2) +} + +func (p *tenEnv) LogFatal(msg string) { + p.logInternal(LogLevelFatal, msg, 2) +} + +func (p *tenEnv) Log(level LogLevel, msg string) { + p.logInternal(level, msg, 1) +} + +func (p *tenEnv) logInternal(level LogLevel, msg string, skip int) { + // Get caller info. + pc, fileName, lineNo, ok := runtime.Caller(skip) funcName := "unknown" if ok { fn := runtime.FuncForPC(pc) @@ -569,6 +591,4 @@ func (p *tenEnv) Log(level LogLevel, msg string) error { unsafe.Pointer(unsafe.StringData(msg)), C.int(len(msg)), ) - - return nil } diff --git a/core/src/ten_runtime/binding/go/interface/ten/ten_env.h b/core/src/ten_runtime/binding/go/interface/ten/ten_env.h index c06d8f6b34..26c6aaaf02 100644 --- a/core/src/ten_runtime/binding/go/interface/ten/ten_env.h +++ b/core/src/ten_runtime/binding/go/interface/ten/ten_env.h @@ -352,7 +352,7 @@ ten_go_status_t ten_go_ten_env_set_property_json_bytes(uintptr_t bridge_addr, ten_go_status_t ten_go_ten_env_init_property_from_json_bytes( uintptr_t bridge_addr, const void *json_str, int json_str_len); -ten_go_status_t ten_go_ten_env_log(uintptr_t bridge_addr, int level, - const void *func_name, int func_name_len, - const void *file_name, int file_name_len, - int line_no, const void *msg, int msg_len); +void ten_go_ten_env_log(uintptr_t bridge_addr, int level, const void *func_name, + int func_name_len, const void *file_name, + int file_name_len, int line_no, const void *msg, + int msg_len); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c index 09a8891423..90203c2a2f 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c @@ -7,14 +7,14 @@ #include #include -#include "include_internal/ten_runtime/binding/go/internal/common.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env.h" #include "include_internal/ten_runtime/binding/go/ten_env/ten_env_internal.h" #include "include_internal/ten_runtime/ten_env/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/binding/go/interface/ten/common.h" #include "ten_runtime/binding/go/interface/ten/ten_env.h" +#include "ten_runtime/ten_env/internal/log.h" #include "ten_utils/lib/error.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" typedef struct ten_env_notify_log_info_t { @@ -74,10 +74,10 @@ static void ten_env_notify_log(ten_env_t *ten_env, void *user_data) { ten_event_set(info->completed); } -ten_go_status_t ten_go_ten_env_log(uintptr_t bridge_addr, int level, - const void *func_name, int func_name_len, - const void *file_name, int file_name_len, - int line_no, const void *msg, int msg_len) { +void ten_go_ten_env_log(uintptr_t bridge_addr, int level, const void *func_name, + int func_name_len, const void *file_name, + int file_name_len, int line_no, const void *msg, + int msg_len) { ten_go_ten_env_t *self = ten_go_ten_env_reinterpret(bridge_addr); TEN_ASSERT(self && ten_go_ten_env_check_integrity(self), "Should not happen."); @@ -104,15 +104,11 @@ ten_go_status_t ten_go_ten_env_log(uintptr_t bridge_addr, int level, level, func_name_value, func_name_len, file_name_value, file_name_len, line_no, msg_value, msg_len); - ten_go_status_t status; - ten_go_status_init_with_errno(&status, TEN_ERRNO_OK); - ten_error_t err; ten_error_init(&err); if (!ten_env_proxy_notify(self->c_ten_env_proxy, ten_env_notify_log, info, false, &err)) { - ten_go_status_from_error(&status, &err); goto done; } @@ -121,6 +117,4 @@ ten_go_status_t ten_go_ten_env_log(uintptr_t bridge_addr, int level, done: ten_error_deinit(&err); ten_env_notify_log_info_destroy(info); - - return status; } diff --git a/core/src/ten_runtime/binding/python/interface/ten/ten_env.py b/core/src/ten_runtime/binding/python/interface/ten/ten_env.py index dd7be92e32..3106aada5b 100644 --- a/core/src/ten_runtime/binding/python/interface/ten/ten_env.py +++ b/core/src/ten_runtime/binding/python/interface/ten/ten_env.py @@ -112,21 +112,52 @@ def set_property_float(self, path: str, value: float) -> None: def init_property_from_json(self, json_str: str) -> None: return self._internal.init_property_from_json(json_str) + def log_verbose(self, msg: str) -> None: + self._log_internal(LogLevel.VERBOSE, msg, 2) + + def log_debug(self, msg: str) -> None: + self._log_internal(LogLevel.DEBUG, msg, 2) + + def log_info(self, msg: str) -> None: + self._log_internal(LogLevel.INFO, msg, 2) + + def log_warn(self, msg: str) -> None: + self._log_internal(LogLevel.WARN, msg, 2) + + def log_error(self, msg: str) -> None: + self._log_internal(LogLevel.ERROR, msg, 2) + + def log_fatal(self, msg: str) -> None: + self._log_internal(LogLevel.FATAL, msg, 2) + def log(self, level: LogLevel, msg: str) -> None: - # Get the current frame and the caller's frame. + self._log_internal(level, msg, 1) + + def _log_internal(self, level: LogLevel, msg: str, skip: int) -> None: + # Get the current frame. frame = inspect.currentframe() if frame is not None: - caller_frame = frame.f_back - if caller_frame is not None: - # Extract information from the caller's frame - file_name = caller_frame.f_code.co_filename - func_name = caller_frame.f_code.co_name - line_no = caller_frame.f_lineno - - return self._internal.log( - level, func_name, file_name, line_no, msg - ) - else: - return self._internal.log(level, None, None, 0, msg) - else: - return self._internal.log(level, None, None, 0, msg) + try: + # Skip the specified number of frames. + for _ in range(skip): + if frame is not None: + frame = frame.f_back + else: + break + + if frame is not None: + # Extract information from the caller's frame. + file_name = frame.f_code.co_filename + func_name = frame.f_code.co_name + line_no = frame.f_lineno + + return self._internal.log( + level, func_name, file_name, line_no, msg + ) + finally: + # A defensive programming practice to ensure immediate cleanup + # of potentially complex reference cycles. + del frame + + # Fallback in case of failure to get caller information. + return self._internal.log(level, None, None, 0, msg) diff --git a/core/src/ten_runtime/binding/python/native/common/error.c b/core/src/ten_runtime/binding/python/native/common/error.c index 13ab720e2c..b0eecc7c91 100644 --- a/core/src/ten_runtime/binding/python/native/common/error.c +++ b/core/src/ten_runtime/binding/python/native/common/error.c @@ -67,7 +67,7 @@ bool ten_py_check_and_clear_py_error(void) { } PyObject *ten_py_raise_py_value_error_exception(const char *msg) { - TEN_LOGD("TEN runtime raise Python ValueError exception: %s", msg); + TEN_LOGD("Raise Python ValueError exception: %s", msg); PyErr_SetString(PyExc_ValueError, msg); // Returning NULL indicates that an exception has occurred during the @@ -77,42 +77,42 @@ PyObject *ten_py_raise_py_value_error_exception(const char *msg) { } PyObject *ten_py_raise_py_type_error_exception(const char *msg) { - TEN_LOGD("TEN runtime raise Python TypeError exception: %s", msg); + TEN_LOGD("Raise Python TypeError exception: %s", msg); PyErr_SetString(PyExc_TypeError, msg); return NULL; } PyObject *ten_py_raise_py_memory_error_exception(const char *msg) { - TEN_LOGD("TEN runtime raise Python TypeError exception: %s", msg); + TEN_LOGD("Raise Python TypeError exception: %s", msg); PyErr_SetString(PyExc_MemoryError, msg); return NULL; } PyObject *ten_py_raise_py_system_error_exception(const char *msg) { - TEN_LOGD("TEN runtime raise Python SystemError exception: %s", msg); + TEN_LOGD("Raise Python SystemError exception: %s", msg); PyErr_SetString(PyExc_SystemError, msg); return NULL; } PyObject *ten_py_raise_py_import_error_exception(const char *msg) { - TEN_LOGD("TEN runtime raise Python ImportError exception: %s", msg); + TEN_LOGD("Raise Python ImportError exception: %s", msg); PyErr_SetString(PyExc_ImportError, msg); return NULL; } PyObject *ten_py_raise_py_runtime_error_exception(const char *msg) { - TEN_LOGD("TEN runtime raise Python RuntimeError exception: %s", msg); + TEN_LOGD("Raise Python RuntimeError exception: %s", msg); PyErr_SetString(PyExc_RuntimeError, msg); return NULL; } PyObject *ten_py_raise_py_not_implemented_error_exception(const char *msg) { - TEN_LOGD("TEN runtime raise Python NotImplementedError exception: %s", msg); + TEN_LOGD("Raise Python NotImplementedError exception: %s", msg); PyErr_SetString(PyExc_NotImplementedError, msg); return NULL; diff --git a/core/src/ten_runtime/binding/python/native/extension/extension.c b/core/src/ten_runtime/binding/python/native/extension/extension.c index 0f1fb4cf74..6f63b87b5e 100644 --- a/core/src/ten_runtime/binding/python/native/extension/extension.c +++ b/core/src/ten_runtime/binding/python/native/extension/extension.c @@ -61,7 +61,7 @@ static void proxy_on_init(ten_extension_t *extension, ten_env_t *ten_env) { "Invalid argument."); ten_py_ten_env_t *py_ten_env = ten_py_ten_wrap(ten_env); - py_extension->py_ten = (PyObject *)py_ten_env; + py_extension->py_ten_env = (PyObject *)py_ten_env; py_ten_env->c_ten_env_proxy = ten_env_proxy_create(ten_env, 1, NULL); TEN_ASSERT(py_ten_env->c_ten_env_proxy && @@ -100,11 +100,12 @@ static void proxy_on_start(ten_extension_t *extension, ten_env_t *ten_env) { py_extension && ten_py_extension_check_integrity(py_extension, true), "Invalid argument."); - PyObject *py_ten = py_extension->py_ten; - TEN_ASSERT(py_ten, "Should not happen."); + PyObject *py_ten_env = py_extension->py_ten_env; + TEN_ASSERT(py_ten_env, "Should not happen."); PyObject *py_res = - PyObject_CallMethod((PyObject *)py_extension, "on_start", "O", py_ten); + PyObject_CallMethod((PyObject *)py_extension, "on_start", "O", + ((ten_py_ten_env_t *)py_ten_env)->actual_py_ten_env); Py_XDECREF(py_res); bool err_occurred = ten_py_check_and_clear_py_error(); @@ -130,11 +131,12 @@ static void proxy_on_stop(ten_extension_t *extension, ten_env_t *ten_env) { py_extension && ten_py_extension_check_integrity(py_extension, true), "Invalid argument."); - PyObject *py_ten = py_extension->py_ten; - TEN_ASSERT(py_ten, "Should not happen."); + PyObject *py_ten_env = py_extension->py_ten_env; + TEN_ASSERT(py_ten_env, "Should not happen."); PyObject *py_res = - PyObject_CallMethod((PyObject *)py_extension, "on_stop", "O", py_ten); + PyObject_CallMethod((PyObject *)py_extension, "on_stop", "O", + ((ten_py_ten_env_t *)py_ten_env)->actual_py_ten_env); Py_XDECREF(py_res); bool err_occurred = ten_py_check_and_clear_py_error(); @@ -160,11 +162,12 @@ static void proxy_on_deinit(ten_extension_t *extension, ten_env_t *ten_env) { py_extension && ten_py_extension_check_integrity(py_extension, true), "Invalid argument."); - PyObject *py_ten = py_extension->py_ten; - TEN_ASSERT(py_ten, "Should not happen."); + PyObject *py_ten_env = py_extension->py_ten_env; + TEN_ASSERT(py_ten_env, "Should not happen."); PyObject *py_res = - PyObject_CallMethod((PyObject *)py_extension, "on_deinit", "O", py_ten); + PyObject_CallMethod((PyObject *)py_extension, "on_deinit", "O", + ((ten_py_ten_env_t *)py_ten_env)->actual_py_ten_env); Py_XDECREF(py_res); bool err_occurred = ten_py_check_and_clear_py_error(); @@ -190,13 +193,14 @@ static void proxy_on_cmd(ten_extension_t *extension, ten_env_t *ten_env, py_extension && ten_py_extension_check_integrity(py_extension, true), "Invalid argument."); - PyObject *py_ten = py_extension->py_ten; - TEN_ASSERT(py_ten, "Should not happen."); + PyObject *py_ten_env = py_extension->py_ten_env; + TEN_ASSERT(py_ten_env, "Should not happen."); ten_py_cmd_t *py_cmd = ten_py_cmd_wrap(cmd); - PyObject *py_res = PyObject_CallMethod((PyObject *)py_extension, "on_cmd", - "OO", py_ten, py_cmd); + PyObject *py_res = PyObject_CallMethod( + (PyObject *)py_extension, "on_cmd", "OO", + ((ten_py_ten_env_t *)py_ten_env)->actual_py_ten_env, py_cmd); Py_XDECREF(py_res); bool err_occurred = ten_py_check_and_clear_py_error(); @@ -224,13 +228,14 @@ static void proxy_on_data(ten_extension_t *extension, ten_env_t *ten_env, py_extension && ten_py_extension_check_integrity(py_extension, true), "Invalid argument."); - PyObject *py_ten = py_extension->py_ten; - TEN_ASSERT(py_ten, "Should not happen."); + PyObject *py_ten_env = py_extension->py_ten_env; + TEN_ASSERT(py_ten_env, "Should not happen."); ten_py_data_t *py_data = ten_py_data_wrap(data); - PyObject *py_res = PyObject_CallMethod((PyObject *)py_extension, "on_data", - "OO", py_ten, py_data); + PyObject *py_res = PyObject_CallMethod( + (PyObject *)py_extension, "on_data", "OO", + ((ten_py_ten_env_t *)py_ten_env)->actual_py_ten_env, py_data); Py_XDECREF(py_res); bool err_occurred = ten_py_check_and_clear_py_error(); @@ -259,13 +264,14 @@ static void proxy_on_audio_frame(ten_extension_t *extension, ten_env_t *ten_env, py_extension && ten_py_extension_check_integrity(py_extension, true), "Invalid argument."); - PyObject *py_ten = py_extension->py_ten; - TEN_ASSERT(py_ten, "Should not happen."); + PyObject *py_ten_env = py_extension->py_ten_env; + TEN_ASSERT(py_ten_env, "Should not happen."); ten_py_audio_frame_t *py_audio_frame = ten_py_audio_frame_wrap(audio_frame); PyObject *py_res = PyObject_CallMethod( - (PyObject *)py_extension, "on_audio_frame", "OO", py_ten, py_audio_frame); + (PyObject *)py_extension, "on_audio_frame", "OO", + ((ten_py_ten_env_t *)py_ten_env)->actual_py_ten_env, py_audio_frame); Py_XDECREF(py_res); bool err_occurred = ten_py_check_and_clear_py_error(); @@ -289,11 +295,12 @@ static void proxy_on_video_frame(ten_extension_t *extension, ten_env_t *ten_env, PyObject *py_extension = (PyObject *)ten_binding_handle_get_me_in_target_lang( (ten_binding_handle_t *)extension); - PyObject *py_ten = ((ten_py_extension_t *)py_extension)->py_ten; + PyObject *py_ten_env = ((ten_py_extension_t *)py_extension)->py_ten_env; ten_py_video_frame_t *py_video_frame = ten_py_video_frame_wrap(video_frame); - PyObject *py_res = PyObject_CallMethod(py_extension, "on_video_frame", "OO", - py_ten, py_video_frame); + PyObject *py_res = PyObject_CallMethod( + py_extension, "on_video_frame", "OO", + ((ten_py_ten_env_t *)py_ten_env)->actual_py_ten_env, py_video_frame); Py_XDECREF(py_res); bool err_occurred = ten_py_check_and_clear_py_error(); @@ -329,7 +336,7 @@ static PyObject *ten_py_extension_create(PyTypeObject *type, PyObject *py_name, TEN_ASSERT(py_extension->c_extension, "Should not happen."); ten_extension_set_me_in_target_lang(py_extension->c_extension, py_extension); - py_extension->py_ten = Py_None; + py_extension->py_ten_env = Py_None; return (PyObject *)py_extension; } diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c index 13f48a1668..3f30ff8951 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c @@ -8,7 +8,7 @@ #include "include_internal/ten_runtime/binding/python/common/error.h" #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" #include "include_internal/ten_runtime/ten_env/log.h" -#include "include_internal/ten_utils/log/log.h" +#include "ten_runtime/ten_env/internal/log.h" #include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" @@ -75,7 +75,7 @@ PyObject *ten_py_ten_env_log(PyObject *self, PyObject *args) { const char *file_name = NULL; size_t line_no = 0; const char *msg = NULL; - if (!PyArg_ParseTuple(args, "issis", &level, &func_name, &file_name, &line_no, + if (!PyArg_ParseTuple(args, "izzis", &level, &func_name, &file_name, &line_no, &msg)) { return ten_py_raise_py_value_error_exception( "Failed to parse argument when ten_env.log."); @@ -87,15 +87,22 @@ PyObject *ten_py_ten_env_log(PyObject *self, PyObject *args) { ten_env_notify_log_info_t *info = ten_env_notify_log_info_create(level, func_name, file_name, line_no, msg); - if (!ten_env_proxy_notify(py_ten->c_ten_env_proxy, ten_env_notify_log, info, - false, &err)) { - goto done; + if (py_ten->c_ten_env->attach_to == TEN_ENV_ATTACH_TO_ADDON) { + // =-=-= add comments + ten_env_log_without_check_thread(py_ten->c_ten_env, info->level, + info->func_name, info->file_name, + info->line_no, info->msg); + } else { + if (!ten_env_proxy_notify(py_ten->c_ten_env_proxy, ten_env_notify_log, info, + false, &err)) { + goto done; + } + + PyThreadState *saved_py_thread_state = PyEval_SaveThread(); + ten_event_wait(info->completed, -1); + PyEval_RestoreThread(saved_py_thread_state); } - PyThreadState *saved_py_thread_state = PyEval_SaveThread(); - ten_event_wait(info->completed, -1); - PyEval_RestoreThread(saved_py_thread_state); - done: ten_error_deinit(&err); ten_env_notify_log_info_destroy(info); diff --git a/core/src/ten_runtime/ten_env/internal/attached_loc.c b/core/src/ten_runtime/ten_env/internal/attached_loc.c new file mode 100644 index 0000000000..a5682ddb5d --- /dev/null +++ b/core/src/ten_runtime/ten_env/internal/attached_loc.c @@ -0,0 +1,35 @@ +// +// This file is part of the TEN Framework project. +// See https://github.com/TEN-framework/ten_framework/LICENSE for license +// information. +// +#include "include_internal/ten_runtime/app/app.h" +#include "include_internal/ten_runtime/extension/extension.h" +#include "include_internal/ten_runtime/extension_group/extension_group.h" +#include "include_internal/ten_runtime/ten_env/ten_env.h" +#include "ten_runtime/ten_env/ten_env.h" +#include "ten_utils/lib/string.h" + +const char *ten_env_get_attached_instance_name(ten_env_t *self) { + // =-=-= 改成 true + TEN_ASSERT(self && ten_env_check_integrity(self, false), "Invalid argument."); + + switch (self->attach_to) { + case TEN_ENV_ATTACH_TO_EXTENSION: + return ten_string_get_raw_str(&self->attached_target.extension->name); + + case TEN_ENV_ATTACH_TO_EXTENSION_GROUP: + return ten_string_get_raw_str( + &self->attached_target.extension_group->name); + + case TEN_ENV_ATTACH_TO_APP: + return ten_string_get_raw_str(&self->attached_target.app->uri); + + case TEN_ENV_ATTACH_TO_ADDON: + return ten_string_get_raw_str(&self->attached_target.addon_host->name); + + default: + TEN_ASSERT(0, "Handle more types: %d", self->attach_to); + return NULL; + } +} diff --git a/core/src/ten_runtime/ten_env/internal/log.c b/core/src/ten_runtime/ten_env/internal/log.c index 94949aefd1..b5c31998a1 100644 --- a/core/src/ten_runtime/ten_env/internal/log.c +++ b/core/src/ten_runtime/ten_env/internal/log.c @@ -3,31 +3,43 @@ // See https://github.com/TEN-framework/ten_framework/LICENSE for license // information. // -#include "include_internal/ten_runtime/ten_env/log.h" +#include "ten_runtime/ten_env/internal/log.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" #include "include_internal/ten_utils/log/log.h" #include "ten_runtime/ten_env/ten_env.h" +#include "ten_utils/lib/string.h" -void ten_env_log(ten_env_t *self, TEN_LOG_LEVEL level, const char *func_name, - const char *file_name, size_t line_no, const char *msg) { - TEN_ASSERT(self && ten_env_check_integrity(self, true), "Should not happen."); +// =-=-= +void ten_env_log_without_check_thread(ten_env_t *self, TEN_LOG_LEVEL level, + const char *func_name, + const char *file_name, size_t line_no, + const char *msg) { + TEN_ASSERT(self && ten_env_check_integrity(self, false), + "Should not happen."); + + ten_string_t final_msg; + ten_string_init_formatted(&final_msg, "[%s] %s", + ten_env_get_attached_instance_name(self), msg); - ten_log_log(&ten_global_log, level, func_name, file_name, line_no, msg); + ten_log_log(&ten_global_log, level, func_name, file_name, line_no, + ten_string_get_raw_str(&final_msg)); + + ten_string_deinit(&final_msg); } -void ten_env_log_formatted(ten_env_t *self, TEN_LOG_LEVEL level, - const char *func_name, const char *file_name, - size_t line_no, const char *fmt, ...) { +void ten_env_log(ten_env_t *self, TEN_LOG_LEVEL level, const char *func_name, + const char *file_name, size_t line_no, const char *msg) { TEN_ASSERT(self && ten_env_check_integrity(self, true), "Should not happen."); - va_list ap; - va_start(ap, fmt); + ten_string_t final_msg; + ten_string_init_formatted(&final_msg, "[%s] %s", + ten_env_get_attached_instance_name(self), msg); - ten_log_log_from_va_list(&ten_global_log, level, func_name, file_name, - line_no, fmt, ap); + ten_log_log(&ten_global_log, level, func_name, file_name, line_no, + ten_string_get_raw_str(&final_msg)); - va_end(ap); + ten_string_deinit(&final_msg); } void ten_env_log_with_size_formatted(ten_env_t *self, TEN_LOG_LEVEL level, @@ -38,12 +50,21 @@ void ten_env_log_with_size_formatted(ten_env_t *self, TEN_LOG_LEVEL level, const char *fmt, ...) { TEN_ASSERT(self && ten_env_check_integrity(self, true), "Should not happen."); + ten_string_t final_msg; + ten_string_init_formatted(&final_msg, "[%s] ", + ten_env_get_attached_instance_name(self)); + va_list ap; va_start(ap, fmt); - ten_log_log_with_size_from_va_list(&ten_global_log, level, func_name, - func_name_len, file_name, file_name_len, - line_no, fmt, ap); + ten_string_append_from_va_list(&final_msg, fmt, ap); va_end(ap); + + ten_log_log_with_size(&ten_global_log, level, func_name, func_name_len, + file_name, file_name_len, line_no, + ten_string_get_raw_str(&final_msg), + ten_string_len(&final_msg)); + + ten_string_deinit(&final_msg); } diff --git a/core/src/ten_runtime/timer/timer.c b/core/src/ten_runtime/timer/timer.c index 7885b5fee2..a39d87f228 100644 --- a/core/src/ten_runtime/timer/timer.c +++ b/core/src/ten_runtime/timer/timer.c @@ -12,11 +12,11 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/timer/timer.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/smart_ptr.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static bool ten_timer_is_closing(ten_timer_t *self) { @@ -57,10 +57,10 @@ static void ten_timer_on_close(ten_timer_t *self) { "Should not happen."); if (!ten_timer_could_be_close(self)) { - TEN_LOGD("Could not close alive timer."); + TEN_LOGV("Could not close alive timer."); return; } - TEN_LOGD("Close timer."); + TEN_LOGV("Close timer."); ten_timer_do_close(self); } @@ -151,7 +151,7 @@ static ten_timer_t *ten_timer_create_internal(ten_runloop_t *runloop) { TEN_ASSERT(runloop && ten_runloop_check_integrity(runloop, true), "Should not happen."); - TEN_LOGD("Create a timer."); + TEN_LOGV("Create a timer."); ten_timer_t *self = (ten_timer_t *)TEN_MALLOC(sizeof(ten_timer_t)); TEN_ASSERT(self, "Failed to allocate memory."); @@ -233,7 +233,7 @@ void ten_timer_destroy(ten_timer_t *self) { ten_timer_could_be_close(self), "Should not happen."); - TEN_LOGD("Destroy a timer."); + TEN_LOGV("Destroy a timer."); ten_sanitizer_thread_check_deinit(&self->thread_check); ten_signature_set(&self->signature, 0); @@ -275,7 +275,7 @@ void ten_timer_stop_async(ten_timer_t *self) { TEN_ASSERT(self && ten_timer_check_integrity(self, true), "Should not happen."); - TEN_LOGD("Stop a timer."); + TEN_LOGV("Stop a timer."); ten_runloop_post_task_tail(self->runloop, ten_timer_stop_, self, NULL); } @@ -315,7 +315,7 @@ void ten_timer_close_async(ten_timer_t *self) { "Should not happen."); if (ten_atomic_bool_compare_swap(&self->is_closing, 0, 1)) { - TEN_LOGD("Try to close a timer."); + TEN_LOGV("Try to close a timer."); ten_runloop_post_task_tail(self->runloop, ten_timer_close_, self, NULL); } diff --git a/core/src/ten_utils/log/log.c b/core/src/ten_utils/log/log.c index 5099b1c36e..f36991f45b 100644 --- a/core/src/ten_utils/log/log.c +++ b/core/src/ten_utils/log/log.c @@ -105,6 +105,10 @@ void ten_log_log_from_va_list(ten_log_t *self, TEN_LOG_LEVEL level, size_t line_no, const char *fmt, va_list ap) { assert(self && ten_log_check_integrity(self) && "Invalid argument."); + if (level < self->output_level) { + return; + } + ten_string_t msg; ten_string_init_from_va_list(&msg, fmt, ap); @@ -122,6 +126,10 @@ void ten_log_log_with_size_from_va_list(ten_log_t *self, TEN_LOG_LEVEL level, const char *fmt, va_list ap) { assert(self && ten_log_check_integrity(self) && "Invalid argument."); + if (level < self->output_level) { + return; + } + ten_string_t msg; ten_string_init_from_va_list(&msg, fmt, ap); @@ -137,6 +145,10 @@ void ten_log_log_formatted(ten_log_t *self, TEN_LOG_LEVEL level, size_t line_no, const char *fmt, ...) { assert(self && ten_log_check_integrity(self) && "Invalid argument."); + if (level < self->output_level) { + return; + } + va_list ap; va_start(ap, fmt); @@ -149,8 +161,13 @@ void ten_log_log(ten_log_t *self, TEN_LOG_LEVEL level, const char *func_name, const char *file_name, size_t line_no, const char *msg) { assert(self && ten_log_check_integrity(self) && "Invalid argument."); - ten_log_log_with_size(self, level, func_name, strlen(func_name), file_name, - strlen(file_name), line_no, msg, strlen(msg)); + if (level < self->output_level) { + return; + } + + ten_log_log_with_size( + self, level, func_name, func_name ? strlen(func_name) : 0, file_name, + file_name ? strlen(file_name) : 0, line_no, msg, msg ? strlen(msg) : 0); } void ten_log_log_with_size(ten_log_t *self, TEN_LOG_LEVEL level, @@ -159,6 +176,10 @@ void ten_log_log_with_size(ten_log_t *self, TEN_LOG_LEVEL level, size_t line_no, const char *msg, size_t msg_len) { assert(self && ten_log_check_integrity(self) && "Invalid argument."); + if (level < self->output_level) { + return; + } + ten_string_t buf; ten_string_init(&buf); diff --git a/core/src/ten_utils/sanitizer/memory_check.c b/core/src/ten_utils/sanitizer/memory_check.c index d484f85c26..023bced49f 100644 --- a/core/src/ten_utils/sanitizer/memory_check.c +++ b/core/src/ten_utils/sanitizer/memory_check.c @@ -14,12 +14,12 @@ #include #include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/sanitizer/memory_check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static ten_sanitizer_memory_records_t g_memory_records = {NULL, diff --git a/packages/core_apps/default_app_go/main.go b/packages/core_apps/default_app_go/main.go index 40dc3e400c..287e7c2fe1 100644 --- a/packages/core_apps/default_app_go/main.go +++ b/packages/core_apps/default_app_go/main.go @@ -16,9 +16,13 @@ type defaultApp struct { ten.DefaultApp } -func (p *defaultApp) OnDeinit(tenEnv ten.TenEnv) { - fmt.Println("defaultApp onDeinit") +func (p *defaultApp) OnInit(tenEnv ten.TenEnv) { + tenEnv.LogDebug("onInit") + tenEnv.OnInitDone() +} +func (p *defaultApp) OnDeinit(tenEnv ten.TenEnv) { + tenEnv.LogDebug("onDeinit") tenEnv.OnDeinitDone() } diff --git a/packages/core_apps/default_app_python/main.py b/packages/core_apps/default_app_python/main.py index 823b21a868..8bb26ac077 100644 --- a/packages/core_apps/default_app_python/main.py +++ b/packages/core_apps/default_app_python/main.py @@ -9,11 +9,11 @@ class DefaultApp(App): def on_init(self, ten_env: TenEnv): - ten_env.log(LogLevel.DEBUG, "app on_init") + ten_env.log_debug("on_init") ten_env.on_init_done() def on_deinit(self, ten_env: TenEnv) -> None: - print("app on_deinit") + ten_env.log_debug("on_deinit") ten_env.on_deinit_done() diff --git a/packages/core_extension_groups/default_extension_group/src/default_extension_group.c b/packages/core_extension_groups/default_extension_group/src/default_extension_group.c index 2b193d8a44..86b1972353 100644 --- a/packages/core_extension_groups/default_extension_group/src/default_extension_group.c +++ b/packages/core_extension_groups/default_extension_group/src/default_extension_group.c @@ -11,13 +11,14 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/ten_env/metadata.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/addon/extension_group/extension_group.h" #include "ten_runtime/extension_group/extension_group.h" #include "ten_runtime/ten.h" +#include "ten_runtime/ten_env/internal/log.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/container/list_ptr.h" +#include "ten_utils/log/log.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static void on_addon_create_instance_done(ten_env_t *ten_env, diff --git a/packages/core_extensions/default_extension_go/default_extension.go b/packages/core_extensions/default_extension_go/default_extension.go index e9e868ed37..5d35e9f2dc 100644 --- a/packages/core_extensions/default_extension_go/default_extension.go +++ b/packages/core_extensions/default_extension_go/default_extension.go @@ -24,13 +24,13 @@ func newDefaultExtension(name string) ten.Extension { } func (p *defaultExtension) OnStart(tenEnv ten.TenEnv) { - fmt.Println("defaultExtension OnStart") + tenEnv.LogDebug("OnStart") tenEnv.OnStartDone() } func (p *defaultExtension) OnStop(tenEnv ten.TenEnv) { - fmt.Println("defaultExtension OnStop") + tenEnv.LogDebug("OnStop") tenEnv.OnStopDone() } @@ -39,7 +39,7 @@ func (p *defaultExtension) OnCmd( tenEnv ten.TenEnv, cmd ten.Cmd, ) { - fmt.Println("defaultExtension OnCmd") + tenEnv.LogDebug("OnCmd") cmdResult, _ := ten.NewCmdResult(ten.StatusCodeOk) cmdResult.SetPropertyString("detail", "This is default go extension.") diff --git a/packages/core_extensions/default_extension_python/extension.py b/packages/core_extensions/default_extension_python/extension.py index db8cbd57a4..86007cb673 100644 --- a/packages/core_extensions/default_extension_python/extension.py +++ b/packages/core_extensions/default_extension_python/extension.py @@ -13,35 +13,34 @@ CmdResult, Data, ) -from .log import logger class DefaultExtension(Extension): def on_init(self, ten_env: TenEnv) -> None: - logger.info("DefaultExtension on_init") + ten_env.log_debug("on_init") ten_env.on_init_done() def on_start(self, ten_env: TenEnv) -> None: - logger.info("DefaultExtension on_start") + ten_env.log_debug("on_start") # TODO: read properties, initialize resources ten_env.on_start_done() def on_stop(self, ten_env: TenEnv) -> None: - logger.info("DefaultExtension on_stop") + ten_env.log_debug("on_stop") # TODO: clean up resources ten_env.on_stop_done() def on_deinit(self, ten_env: TenEnv) -> None: - logger.info("DefaultExtension on_deinit") + ten_env.log_debug("on_deinit") ten_env.on_deinit_done() def on_cmd(self, ten_env: TenEnv, cmd: Cmd) -> None: cmd_name = cmd.get_name() - logger.info("on_cmd name {}".format(cmd_name)) + ten_env.log_debug("on_cmd name {}".format(cmd_name)) # TODO: process cmd @@ -49,13 +48,22 @@ def on_cmd(self, ten_env: TenEnv, cmd: Cmd) -> None: ten_env.return_result(cmd_result, cmd) def on_data(self, ten_env: TenEnv, data: Data) -> None: + data_name = data.get_name() + ten_env.log_debug("on_data name {}".format(data_name)) + # TODO: process data pass def on_audio_frame(self, ten_env: TenEnv, audio_frame: AudioFrame) -> None: - # TODO: process pcm frame + audio_frame_name = audio_frame.get_name() + ten_env.log_debug("on_audio_frame name {}".format(audio_frame_name)) + + # TODO: process audio frame pass def on_video_frame(self, ten_env: TenEnv, video_frame: VideoFrame) -> None: - # TODO: process image frame + video_frame_name = video_frame.get_name() + ten_env.log_debug("on_video_frame name {}".format(video_frame_name)) + + # TODO: process video frame pass diff --git a/packages/core_extensions/default_extension_python/extension.py.tent b/packages/core_extensions/default_extension_python/extension.py.tent index f4e033847f..c0445ad331 100644 --- a/packages/core_extensions/default_extension_python/extension.py.tent +++ b/packages/core_extensions/default_extension_python/extension.py.tent @@ -13,35 +13,34 @@ from ten import ( CmdResult, Data, ) -from .log import logger class {{class_name_prefix}}Extension(Extension): def on_init(self, ten_env: TenEnv) -> None: - logger.info("{{class_name_prefix}}Extension on_init") + ten_env.log_debug("on_init") ten_env.on_init_done() def on_start(self, ten_env: TenEnv) -> None: - logger.info("{{class_name_prefix}}Extension on_start") + ten_env.log_debug("on_start") # TODO: read properties, initialize resources ten_env.on_start_done() def on_stop(self, ten_env: TenEnv) -> None: - logger.info("{{class_name_prefix}}Extension on_stop") + ten_env.log_debug("on_stop") # TODO: clean up resources ten_env.on_stop_done() def on_deinit(self, ten_env: TenEnv) -> None: - logger.info("{{class_name_prefix}}Extension on_deinit") + ten_env.log_debug("on_deinit") ten_env.on_deinit_done() def on_cmd(self, ten_env: TenEnv, cmd: Cmd) -> None: cmd_name = cmd.get_name() - logger.info("on_cmd name {}".format(cmd_name)) + ten_env.log_debug("on_cmd name {}".format(cmd_name)) # TODO: process cmd @@ -49,13 +48,22 @@ class {{class_name_prefix}}Extension(Extension): ten_env.return_result(cmd_result, cmd) def on_data(self, ten_env: TenEnv, data: Data) -> None: + data_name = data.get_name() + ten_env.log_debug("on_data name {}".format(data_name)) + # TODO: process data pass def on_audio_frame(self, ten_env: TenEnv, audio_frame: AudioFrame) -> None: - # TODO: process pcm frame + audio_frame_name = audio_frame.get_name() + ten_env.log_debug("on_audio_frame name {}".format(audio_frame_name)) + + # TODO: process audio frame pass def on_video_frame(self, ten_env: TenEnv, video_frame: VideoFrame) -> None: - # TODO: process image frame + video_frame_name = video_frame.get_name() + ten_env.log_debug("on_video_frame name {}".format(video_frame_name)) + + # TODO: process video frame pass diff --git a/packages/core_extensions/py_init_extension_cpp/src/main.cc b/packages/core_extensions/py_init_extension_cpp/src/main.cc index f6417e2e6b..a1e7cb3dba 100644 --- a/packages/core_extensions/py_init_extension_cpp/src/main.cc +++ b/packages/core_extensions/py_init_extension_cpp/src/main.cc @@ -3,18 +3,19 @@ // Licensed under the Apache License, Version 2.0. // See the LICENSE file for more information. // -#include #include +#include #include "include_internal/ten_runtime/app/base_dir.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" +#include "ten_runtime/binding/cpp/internal/ten_env.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_runtime/binding/python/common.h" #include "ten_utils/container/list_str.h" #include "ten_utils/lib/module.h" #include "ten_utils/lib/path.h" #include "ten_utils/lib/string.h" +#include "ten_utils/log/log.h" +#include "ten_utils/macro/check.h" static void foo() {} @@ -101,11 +102,11 @@ class py_init_addon_t : public ten::addon_t { void on_init(ten::ten_env_t &ten_env) override { // Do some initializations. - TEN_LOGI("py_init_addon_t::on_init"); + TEN_ENV_LOG_DEBUG(ten_env, "on_init"); int py_initialized = ten_py_is_initialized(); if (py_initialized != 0) { - TEN_LOGI("Python runtime has been initialized."); + TEN_ENV_LOG_INFO(ten_env, "Python runtime has been initialized."); ten_env.on_init_done(); return; } @@ -133,16 +134,18 @@ class py_init_addon_t : public ten::addon_t { "print(sys.path)\n"); const auto *sys_path = ten_py_get_path(); - TEN_LOGI("python initialized, sys.path: %s\n", sys_path); + TEN_ENV_LOG_INFO( + ten_env, + (std::string("python initialized, sys.path: ") + sys_path).c_str()); ten_py_mem_free((void *)sys_path); // Traverse the addon extensions directory and import module. ten_string_t *addon_extensions_path = get_addon_extensions_path(); - start_debugpy_server_if_needed(); + start_debugpy_server_if_needed(ten_env); - load_all_python_modules(addon_extensions_path); + load_all_python_modules(ten_env, addon_extensions_path); ten_string_destroy(addon_extensions_path); @@ -182,7 +185,11 @@ class py_init_addon_t : public ten::addon_t { if (py_init_by_self_) { int rc = ten_py_finalize(); if (rc < 0) { - TEN_LOGE("Failed to finalize python runtime, rc: %d", rc); + TEN_ENV_LOG_FATAL( + ten_env, (std::string("Failed to finalize python runtime, rc: ") + + std::to_string(rc)) + .c_str()); + TEN_ASSERT(0, "Should not happen."); } } @@ -240,7 +247,7 @@ class py_init_addon_t : public ten::addon_t { // Start the debugpy server according to the environment variable and wait for // the debugger to connect. - static void start_debugpy_server_if_needed() { + static void start_debugpy_server_if_needed(ten::ten_env_t &ten_env) { const char *enable_python_debug = getenv("TEN_ENABLE_PYTHON_DEBUG"); if (enable_python_debug == nullptr || strcmp(enable_python_debug, "true") != 0) { @@ -261,7 +268,9 @@ class py_init_addon_t : public ten::addon_t { char *endptr = nullptr; int64_t port = std::strtol(python_debug_port, &endptr, 10); if (*endptr != '\0' || port <= 0 || port > 65535) { - TEN_LOGE("Invalid python debug port: %s", python_debug_port); + TEN_ENV_LOG_ERROR(ten_env, (std::string("Invalid python debug port: ") + + python_debug_port) + .c_str()); return; } @@ -275,15 +284,18 @@ class py_init_addon_t : public ten::addon_t { ten_string_destroy(start_debug_server_script); - TEN_LOGI("Python debug server started at %s:%" PRId64, python_debug_host, - port); + TEN_ENV_LOG_INFO(ten_env, (std::string("Python debug server started at ") + + python_debug_host + std::to_string(port)) + .c_str()); } // Load all python addons by import modules. - static void load_all_python_modules(ten_string_t *addon_extensions_path) { + static void load_all_python_modules(ten::ten_env_t &ten_env, + ten_string_t *addon_extensions_path) { if (addon_extensions_path == nullptr || ten_string_is_empty(addon_extensions_path)) { - TEN_LOGE( + TEN_ENV_LOG_ERROR( + ten_env, "Failed to load python modules due to empty addon extension path."); return; } @@ -291,8 +303,11 @@ class py_init_addon_t : public ten::addon_t { ten_dir_fd_t *dir = ten_path_open_dir(ten_string_get_raw_str(addon_extensions_path)); if (dir == nullptr) { - TEN_LOGE("Failed to open directory: %s when loading python modules.", - ten_string_get_raw_str(addon_extensions_path)); + TEN_ENV_LOG_ERROR(ten_env, + (std::string("Failed to open directory: ") + + ten_string_get_raw_str(addon_extensions_path) + + " when loading python modules.") + .c_str()); return; } @@ -300,10 +315,11 @@ class py_init_addon_t : public ten::addon_t { while (itor != nullptr) { ten_string_t *short_name = ten_path_itor_get_name(itor); if (short_name == nullptr) { - TEN_LOGE( - "Failed to get short name under path %s, when loading python " - "modules.", - addon_extensions_path->buf); + TEN_ENV_LOG_ERROR(ten_env, + (std::string("Failed to get short name under path ") + + ten_string_get_raw_str(addon_extensions_path) + + ", when loading python modules.") + .c_str()); itor = ten_path_get_next(itor); continue; } diff --git a/packages/example_extensions/ffmpeg_demuxer/src/demuxer.cc b/packages/example_extensions/ffmpeg_demuxer/src/demuxer.cc index 0ecb96cc92..28c83f8a23 100644 --- a/packages/example_extensions/ffmpeg_demuxer/src/demuxer.cc +++ b/packages/example_extensions/ffmpeg_demuxer/src/demuxer.cc @@ -14,12 +14,12 @@ #include #include -#include "ten_utils/macro/check.h" #include "libavcodec/packet.h" #include "libavutil/channel_layout.h" #include "libswresample/swresample.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_runtime/msg/video_frame/video_frame.h" +#include "ten_utils/macro/check.h" #ifdef __cplusplus extern "C" { @@ -46,10 +46,10 @@ extern "C" { #endif #include "demuxer_thread.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/lib/alloc.h" +#include "ten_utils/log/log.h" +#include "ten_utils/macro/check.h" #define GET_FFMPEG_ERROR_MESSAGE(err_msg, errnum) \ /* NOLINTNEXTLINE */ \ diff --git a/packages/example_extensions/ffmpeg_demuxer/src/demuxer_thread.cc b/packages/example_extensions/ffmpeg_demuxer/src/demuxer_thread.cc index 3e2d81924b..925c551db3 100644 --- a/packages/example_extensions/ffmpeg_demuxer/src/demuxer_thread.cc +++ b/packages/example_extensions/ffmpeg_demuxer/src/demuxer_thread.cc @@ -13,13 +13,13 @@ #include #include "demuxer.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "libavutil/rational.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/event.h" #include "ten_utils/lib/thread.h" +#include "ten_utils/log/log.h" +#include "ten_utils/macro/check.h" namespace ten { namespace ffmpeg_extension { diff --git a/packages/example_extensions/ffmpeg_muxer/src/muxer.cc b/packages/example_extensions/ffmpeg_muxer/src/muxer.cc index b7e96daeaa..0c5661b867 100644 --- a/packages/example_extensions/ffmpeg_muxer/src/muxer.cc +++ b/packages/example_extensions/ffmpeg_muxer/src/muxer.cc @@ -9,12 +9,12 @@ #include #include -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "libavcodec/packet.h" #include "libavutil/channel_layout.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/lang/cpp/lib/buf.h" +#include "ten_utils/log/log.h" +#include "ten_utils/macro/check.h" #define ms2pts(pts, stream) \ av_rescale(pts, (stream)->time_base.den, \ diff --git a/packages/example_extensions/ffmpeg_muxer/src/muxer_thread.cc b/packages/example_extensions/ffmpeg_muxer/src/muxer_thread.cc index a6298c37da..f7ac3290c6 100644 --- a/packages/example_extensions/ffmpeg_muxer/src/muxer_thread.cc +++ b/packages/example_extensions/ffmpeg_muxer/src/muxer_thread.cc @@ -8,13 +8,13 @@ #include #include -#include "include_internal/ten_utils/log/log.h" #include "muxer.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/lib/event.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" +#include "ten_utils/log/log.h" namespace ten { namespace ffmpeg_extension { diff --git a/packages/example_extensions/pil_demo_python/main.py b/packages/example_extensions/pil_demo_python/main.py index 0232126b94..e8ec5f1e2c 100644 --- a/packages/example_extensions/pil_demo_python/main.py +++ b/packages/example_extensions/pil_demo_python/main.py @@ -19,34 +19,33 @@ class PilDemoExtension(Extension): def on_init(self, ten_env: TenEnv) -> None: - print("PilDemoExtension on_init") + ten_env.log_debug("on_init") ten_env.on_init_done() def on_start(self, ten_env: TenEnv) -> None: - print("PilDemoExtension on_start") + ten_env.log_debug("on_start") ten_env.on_start_done() def on_stop(self, ten_env: TenEnv) -> None: - print("PilDemoExtension on_stop") + ten_env.log_debug("on_stop") ten_env.on_stop_done() def on_deinit(self, ten_env: TenEnv) -> None: - print("PilDemoExtension on_deinit") + ten_env.log_debug("on_deinit") ten_env.on_deinit_done() def on_cmd(self, ten_env: TenEnv, cmd: Cmd) -> None: - print("PilDemoExtension on_cmd") cmd_json = cmd.to_json() - print("PilDemoExtension on_cmd json: " + cmd_json) + ten_env.log_info(f"on_cmd json: {cmd_json}") cmd_result = CmdResult.create(StatusCode.OK) cmd_result.set_property_string("detail", "success") ten_env.return_result(cmd_result, cmd) def on_video_frame(self, ten_env: TenEnv, video_frame: VideoFrame) -> None: - print("PilDemoExtension on_video_frame") + ten_env.log_debug("on_video_frame") if video_frame.get_pixel_fmt() != PixelFmt.RGBA: - print("PilDemoExtension on_video_frame, not support pixel format") + ten_env.log_error("on_video_frame, not support pixel format") return im = Image.frombuffer( @@ -62,15 +61,15 @@ def on_video_frame(self, ten_env: TenEnv, video_frame: VideoFrame) -> None: class PilDemoExtensionAddon(Addon): def on_init(self, ten_env: TenEnv) -> None: - print("PilDemoExtensionAddon on_init") + ten_env.log_debug("on_init") ten_env.on_init_done() return def on_create_instance(self, ten_env: TenEnv, name: str, context) -> None: - print("PilDemoExtensionAddon on_create_instance") + ten_env.log_debug("on_create_instance") ten_env.on_create_instance_done(PilDemoExtension(name), context) def on_deinit(self, ten_env: TenEnv) -> None: - print("PilDemoExtensionAddon on_deinit") + ten_env.log_debug("on_deinit") ten_env.on_deinit_done() return diff --git a/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/default_extension.go b/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/default_extension.go index d27f633039..a46e0556c0 100644 --- a/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/default_extension.go +++ b/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/default_extension.go @@ -8,8 +8,6 @@ package defaultextension import ( - "fmt" - "ten_framework/ten" ) @@ -18,13 +16,13 @@ type baseExtension struct { } func (ext *baseExtension) OnStart(tenEnv ten.TenEnv) { - fmt.Println("baseExtension OnStart") + tenEnv.LogDebug("OnStart") tenEnv.OnStartDone() } func (ext *baseExtension) OnStop(tenEnv ten.TenEnv) { - fmt.Println("baseExtension OnStop") + tenEnv.LogDebug("OnStop") tenEnv.OnStopDone() } diff --git a/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/ten_packages/extension/default_extension_python/extension.py b/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/ten_packages/extension/default_extension_python/extension.py index 70243444dc..4b6c632864 100644 --- a/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/ten_packages/extension/default_extension_python/extension.py +++ b/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/ten_packages/extension/default_extension_python/extension.py @@ -19,27 +19,27 @@ class DefaultExtension(Extension): def on_init(self, ten_env: TenEnv) -> None: - print("DefaultExtension on_init") + ten_env.log_debug("on_init") ten_env.init_property_from_json('{"testKey": "testValue"}') ten_env.on_init_done() def on_start(self, ten_env: TenEnv) -> None: - print("DefaultExtension on_start") + ten_env.log_debug("on_start") ten_env.set_property_from_json("testKey2", '"testValue2"') testValue = ten_env.get_property_to_json("testKey") testValue2 = ten_env.get_property_to_json("testKey2") - print("testValue: ", testValue, " testValue2: ", testValue2) + ten_env.log_info(f"testValue: {testValue}, testValue2: {testValue2}") ten_env.on_start_done() def on_stop(self, ten_env: TenEnv) -> None: - print("DefaultExtension on_stop") + ten_env.log_debug("on_stop") ten_env.on_stop_done() def on_deinit(self, ten_env: TenEnv) -> None: - print("DefaultExtension on_deinit") + ten_env.log_debug("on_deinit") ten_env.on_deinit_done() def check_greeting( @@ -47,27 +47,21 @@ def check_greeting( ): statusCode = result.get_status_code() detail = result.get_property_string("detail") - print( - "DefaultExtension check_greeting: status:" - + str(statusCode) - + " detail:" - + detail + ten_env.log_info( + f"check_greeting: status: {str(statusCode)}, detail: {detail}" ) respCmd = CmdResult.create(StatusCode.OK) respCmd.set_property_string("detail", detail + " nbnb") - print("DefaultExtension create respCmd") + ten_env.log_info("create respCmd") ten_env.return_result(respCmd, receivedCmd) def check_hello(self, ten_env: TenEnv, result: CmdResult, receivedCmd: Cmd): statusCode = result.get_status_code() detail = result.get_property_string("detail") - print( - "DefaultExtension check_hello: status:" - + str(statusCode) - + " detail:" - + detail + ten_env.log_info( + f"check_hello: status: {str(statusCode)}, detail: {detail}" ) # Send a command to go extension. @@ -78,15 +72,13 @@ def check_hello(self, ten_env: TenEnv, result: CmdResult, receivedCmd: Cmd): ) def on_cmd(self, ten_env: TenEnv, cmd: Cmd) -> None: - print("DefaultExtension on_cmd") - cmd_json = cmd.to_json() - print("DefaultExtension on_cmd json: " + cmd_json) + ten_env.log_debug("on_cmd: " + cmd_json) new_cmd = Cmd.create("hello") new_cmd.set_property_from_json("test", '"testValue2"') test_value = new_cmd.get_property_to_json("test") - print("DefaultExtension on_cmd test_value: " + test_value) + ten_env.log_info(f"on_cmd test_value: {test_value}") # Send command to a cpp extension. ten_env.send_cmd( diff --git a/tests/ten_runtime/smoke/cmd_result_test/multiple_result.cc b/tests/ten_runtime/smoke/cmd_result_test/multiple_result.cc index 397929b731..e415e0eb82 100644 --- a/tests/ten_runtime/smoke/cmd_result_test/multiple_result.cc +++ b/tests/ten_runtime/smoke/cmd_result_test/multiple_result.cc @@ -28,9 +28,9 @@ class test_extension_1 : public ten::extension_t { ++received_result_cnt; if (received_result_cnt == 1) { - TEN_LOGI("test_extension_1 receives 1 cmd result"); + TEN_ENV_LOG_INFO(ten_env, "receives 1 cmd result"); } else if (received_result_cnt == 2) { - TEN_LOGI("test_extension_1 receives 2 cmd result"); + TEN_ENV_LOG_INFO(ten_env, "receives 2 cmd result"); ten_env.return_result_directly(std::move(cmd_result)); } }); diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_1.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_1.cc index 2fd16b3399..84a5e03111 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_1.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_1.cc @@ -20,6 +20,9 @@ class test_extension : public ten::extension_t { void on_cmd(ten::ten_env_t &ten_env, std::unique_ptr cmd) override { + TEN_ENV_LOG_DEBUG(ten_env, + (std::string("on_cmd ") + cmd->get_name()).c_str()); + if (std::string(cmd->get_name()) == "hello_world") { auto cmd_result = ten::cmd_result_t::create(TEN_STATUS_CODE_OK); cmd_result->set_property("detail", "hello world, too"); From a149035ae2098ffe419163b40d61afba088c7920 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 17 Sep 2024 13:53:49 +0800 Subject: [PATCH 10/13] feat: new log mechanism --- core/src/ten_utils/log/time.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/ten_utils/log/time.c b/core/src/ten_utils/log/time.c index 8d6145707d..dde25f0c78 100644 --- a/core/src/ten_utils/log/time.c +++ b/core/src/ten_utils/log/time.c @@ -38,13 +38,13 @@ void ten_log_get_time(struct tm *time_info, size_t *msec) { #if defined(OS_WINDOWS) SYSTEMTIME st; GetLocalTime(&st); - tm->tm_year = st.wYear; - tm->tm_mon = st.wMonth - 1; - tm->tm_mday = st.wDay; - tm->tm_wday = st.wDayOfWeek; - tm->tm_hour = st.wHour; - tm->tm_min = st.wMinute; - tm->tm_sec = st.wSecond; + time_info->tm_year = st.wYear; + time_info->tm_mon = st.wMonth - 1; + time_info->tm_mday = st.wDay; + time_info->tm_wday = st.wDayOfWeek; + time_info->tm_hour = st.wHour; + time_info->tm_min = st.wMinute; + time_info->tm_sec = st.wSecond; *msec = st.wMilliseconds; #else struct timeval tv; From b24730b3dc34a3406d6e3927d7b0917450c0e5ba Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 17 Sep 2024 13:57:46 +0800 Subject: [PATCH 11/13] feat: new log mechanism --- .../ten_runtime/ten_env/ten_env.h | 2 +- .../python/native/ten_env/ten_env_log.c | 7 +++- .../ten_env/internal/attached_loc.c | 7 ++-- core/src/ten_runtime/ten_env/internal/log.c | 41 ++++++++++--------- 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/core/include_internal/ten_runtime/ten_env/ten_env.h b/core/include_internal/ten_runtime/ten_env/ten_env.h index ac7d7309bb..0c6d8c3952 100644 --- a/core/include_internal/ten_runtime/ten_env/ten_env.h +++ b/core/include_internal/ten_runtime/ten_env/ten_env.h @@ -104,7 +104,7 @@ TEN_RUNTIME_PRIVATE_API void ten_env_set_attach_to( ten_env_t *self, TEN_ENV_ATTACH_TO attach_to_type, void *attach_to); TEN_RUNTIME_PRIVATE_API const char *ten_env_get_attached_instance_name( - ten_env_t *self); + ten_env_t *self, bool check_thread); inline ten_extension_t *ten_env_get_attached_extension(ten_env_t *self) { TEN_ASSERT(self, "Invalid argument."); diff --git a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c index 3f30ff8951..14005a7ed7 100644 --- a/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c +++ b/core/src/ten_runtime/binding/python/native/ten_env/ten_env_log.c @@ -88,7 +88,12 @@ PyObject *ten_py_ten_env_log(PyObject *self, PyObject *args) { ten_env_notify_log_info_create(level, func_name, file_name, line_no, msg); if (py_ten->c_ten_env->attach_to == TEN_ENV_ATTACH_TO_ADDON) { - // =-=-= add comments + // TODO(Wei): This function is currently specifically designed for the addon + // because the addon currently does not have a main thread, so it's unable + // to check thread safety. Once the main thread for the addon is determined + // in the future, these hacks made specifically for the addon can be + // completely removed, and comprehensive thread safety checking can be + // implemented. ten_env_log_without_check_thread(py_ten->c_ten_env, info->level, info->func_name, info->file_name, info->line_no, info->msg); diff --git a/core/src/ten_runtime/ten_env/internal/attached_loc.c b/core/src/ten_runtime/ten_env/internal/attached_loc.c index a5682ddb5d..e138406813 100644 --- a/core/src/ten_runtime/ten_env/internal/attached_loc.c +++ b/core/src/ten_runtime/ten_env/internal/attached_loc.c @@ -10,9 +10,10 @@ #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/string.h" -const char *ten_env_get_attached_instance_name(ten_env_t *self) { - // =-=-= 改成 true - TEN_ASSERT(self && ten_env_check_integrity(self, false), "Invalid argument."); +const char *ten_env_get_attached_instance_name(ten_env_t *self, + bool check_thread) { + TEN_ASSERT(self && ten_env_check_integrity(self, check_thread), + "Invalid argument."); switch (self->attach_to) { case TEN_ENV_ATTACH_TO_EXTENSION: diff --git a/core/src/ten_runtime/ten_env/internal/log.c b/core/src/ten_runtime/ten_env/internal/log.c index b5c31998a1..f8aa50fb16 100644 --- a/core/src/ten_runtime/ten_env/internal/log.c +++ b/core/src/ten_runtime/ten_env/internal/log.c @@ -10,17 +10,17 @@ #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/string.h" -// =-=-= -void ten_env_log_without_check_thread(ten_env_t *self, TEN_LOG_LEVEL level, - const char *func_name, - const char *file_name, size_t line_no, - const char *msg) { - TEN_ASSERT(self && ten_env_check_integrity(self, false), +static void ten_env_log_internal(ten_env_t *self, TEN_LOG_LEVEL level, + const char *func_name, const char *file_name, + size_t line_no, const char *msg, + bool check_thread) { + TEN_ASSERT(self && ten_env_check_integrity(self, check_thread), "Should not happen."); ten_string_t final_msg; - ten_string_init_formatted(&final_msg, "[%s] %s", - ten_env_get_attached_instance_name(self), msg); + ten_string_init_formatted( + &final_msg, "[%s] %s", + ten_env_get_attached_instance_name(self, check_thread), msg); ten_log_log(&ten_global_log, level, func_name, file_name, line_no, ten_string_get_raw_str(&final_msg)); @@ -28,18 +28,21 @@ void ten_env_log_without_check_thread(ten_env_t *self, TEN_LOG_LEVEL level, ten_string_deinit(&final_msg); } +// TODO(Wei): This function is currently specifically designed for the addon +// because the addon currently does not have a main thread, so it's unable to +// check thread safety. Once the main thread for the addon is determined in the +// future, these hacks made specifically for the addon can be completely +// removed, and comprehensive thread safety checking can be implemented. +void ten_env_log_without_check_thread(ten_env_t *self, TEN_LOG_LEVEL level, + const char *func_name, + const char *file_name, size_t line_no, + const char *msg) { + ten_env_log_internal(self, level, func_name, file_name, line_no, msg, false); +} + void ten_env_log(ten_env_t *self, TEN_LOG_LEVEL level, const char *func_name, const char *file_name, size_t line_no, const char *msg) { - TEN_ASSERT(self && ten_env_check_integrity(self, true), "Should not happen."); - - ten_string_t final_msg; - ten_string_init_formatted(&final_msg, "[%s] %s", - ten_env_get_attached_instance_name(self), msg); - - ten_log_log(&ten_global_log, level, func_name, file_name, line_no, - ten_string_get_raw_str(&final_msg)); - - ten_string_deinit(&final_msg); + ten_env_log_internal(self, level, func_name, file_name, line_no, msg, true); } void ten_env_log_with_size_formatted(ten_env_t *self, TEN_LOG_LEVEL level, @@ -52,7 +55,7 @@ void ten_env_log_with_size_formatted(ten_env_t *self, TEN_LOG_LEVEL level, ten_string_t final_msg; ten_string_init_formatted(&final_msg, "[%s] ", - ten_env_get_attached_instance_name(self)); + ten_env_get_attached_instance_name(self, true)); va_list ap; va_start(ap, fmt); From c32ba17b8c9cd0a2db6e059e3459e8528a0cc78f Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 17 Sep 2024 14:30:57 +0800 Subject: [PATCH 12/13] feat: new log mechanism --- .../ten_runtime/extension_thread/extension_thread.h | 1 - core/include_internal/ten_runtime/ten_env/ten_env.h | 1 - core/include_internal/ten_utils/log/level.h | 2 +- core/src/ten_runtime/addon/extension/extension.c | 3 +-- core/src/ten_runtime/addon/extension_group/extension_group.c | 3 +-- core/src/ten_runtime/addon/protocol/protocol.c | 3 +-- core/src/ten_runtime/addon/ten_env/on_xxx.c | 3 +-- core/src/ten_runtime/app/close.c | 3 +-- core/src/ten_runtime/app/ten_env/on_xxx.c | 1 - core/src/ten_runtime/binding/python/native/app/app.c | 1 - core/src/ten_runtime/binding/python/native/common/error.c | 2 +- core/src/ten_runtime/connection/connection.c | 3 +-- core/src/ten_runtime/engine/internal/close.c | 3 +-- core/src/ten_runtime/engine/internal/extension_interface.c | 4 +--- core/src/ten_runtime/engine/internal/remote_interface.c | 3 +-- core/src/ten_runtime/engine/internal/thread.c | 3 +-- core/src/ten_runtime/engine/msg_interface/timer.c | 3 +-- core/src/ten_runtime/extension/msg_handling.c | 3 +-- core/src/ten_runtime/extension/ten_env/on_xxx.c | 3 +-- .../ten_runtime/extension_context/internal/del_extension.c | 3 +-- .../extension_context/internal/extension_group_is_inited.c | 3 +-- .../extension_context/internal/extension_group_is_stopped.c | 3 +-- .../extension_context/internal/extension_thread_is_closing.c | 1 - core/src/ten_runtime/extension_group/internal/metadata.c | 1 - core/src/ten_runtime/extension_group/ten_env/on_xxx.c | 3 +-- core/src/ten_runtime/extension_thread/extension_thread.c | 1 - core/src/ten_runtime/extension_thread/on_xxx.c | 3 +-- core/src/ten_runtime/global/signal.c | 3 +-- .../msg/cmd_base/cmd/start_graph/field/long_running_mode.c | 3 +-- .../cmd_base/cmd/start_graph/field/predefined_graph_name.c | 3 +-- .../msg/cmd_base/cmd/stop_graph/field/graph_name.c | 3 +-- .../src/ten_runtime/msg/cmd_base/cmd/timeout/field/timer_id.c | 3 +-- .../ten_runtime/msg/cmd_base/cmd/timer/field/timeout_in_us.c | 3 +-- core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timer_id.c | 3 +-- core/src/ten_runtime/msg/cmd_base/cmd/timer/field/times.c | 3 +-- .../msg/cmd_base/cmd_result/field/original_cmd_type.c | 3 +-- .../ten_runtime/msg/cmd_base/cmd_result/field/status_code.c | 3 +-- core/src/ten_runtime/msg/cmd_base/field/cmd_id.c | 3 +-- core/src/ten_runtime/msg/cmd_base/field/seq_id.c | 3 +-- core/src/ten_runtime/msg/field/name.c | 3 +-- core/src/ten_runtime/msg/msg.c | 3 +-- core/src/ten_runtime/protocol/asynced/protocol_asynced.c | 3 +-- core/src/ten_runtime/protocol/close.c | 1 - core/src/ten_runtime/protocol/context.c | 3 +-- core/src/ten_runtime/protocol/integrated/close.c | 3 +-- core/src/ten_runtime/remote/remote.c | 4 +--- core/src/ten_runtime/schema_store/interface_info.c | 3 +-- core/src/ten_runtime/schema_store/store.c | 3 +-- core/src/ten_runtime/ten_env/internal/send.c | 3 +-- core/src/ten_runtime/ten_env/internal/set_property.c | 3 +-- core/src/ten_runtime/ten_env/ten_env.c | 3 +-- core/src/ten_runtime/timer/timer.c | 1 - core/src/ten_utils/backtrace/common.c | 1 - .../src/ten_utils/backtrace/platform/posix/darwin/backtrace.c | 1 - core/src/ten_utils/backtrace/platform/posix/fileline.c | 2 +- core/src/ten_utils/backtrace/platform/win/internal.c | 1 - core/src/ten_utils/io/general/loops/runloop.c | 3 +-- core/src/ten_utils/io/posix/socket.c | 3 +-- core/src/ten_utils/lib/sys/general/ref.c | 3 +-- core/src/ten_utils/lib/sys/general/thread.c | 3 +-- core/src/ten_utils/lib/sys/posix/file_lock.c | 2 +- core/src/ten_utils/lib/sys/posix/thread_local.c | 2 +- core/src/ten_utils/lib/sys/posix/thread_once.c | 1 - core/src/ten_utils/log/output.c | 1 - core/src/ten_utils/sanitizer/memory_check.c | 1 - core/src/ten_utils/sanitizer/thread_check.c | 3 +-- tests/common/client/curl_connect.c | 2 +- .../integration/go/access_property_go/client/client.cc | 1 - .../ten_runtime/integration/go/close_app_go/client/client.cc | 1 - .../integration/go/expired_ten_go/client/client.cc | 1 - .../integration/go/frequently_cgo_call_go/client/client.cc | 1 - .../integration/go/handle_error_go/client/client.cc | 2 -- .../integration/go/prepare_to_stop_go/client/client.cc | 2 -- .../integration/go/return_result_go/client/client.cc | 1 - .../integration/go/return_value_go/client/client.cc | 2 -- .../ten_runtime/integration/go/send_json_go/client/client.cc | 2 -- .../integration/go/start_app_sync_go/client/client.cc | 2 -- .../integration/go/three_extension_cmd_go/client/client.cc | 1 - .../integration/go/transfer_pointer_go/client/client.cc | 1 - .../go/two_extension_one_group_cmd_go/client/client.cc | 2 -- .../smoke/extension_test/graph_name/graph_name_basic.cc | 1 - 81 files changed, 52 insertions(+), 135 deletions(-) diff --git a/core/include_internal/ten_runtime/extension_thread/extension_thread.h b/core/include_internal/ten_runtime/extension_thread/extension_thread.h index 966219b454..504185cb1c 100644 --- a/core/include_internal/ten_runtime/extension_thread/extension_thread.h +++ b/core/include_internal/ten_runtime/extension_thread/extension_thread.h @@ -7,7 +7,6 @@ #include "ten_runtime/ten_config.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/container/list.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/error.h" diff --git a/core/include_internal/ten_runtime/ten_env/ten_env.h b/core/include_internal/ten_runtime/ten_env/ten_env.h index 0c6d8c3952..bf159508f4 100644 --- a/core/include_internal/ten_runtime/ten_env/ten_env.h +++ b/core/include_internal/ten_runtime/ten_env/ten_env.h @@ -9,7 +9,6 @@ #include "include_internal/ten_runtime/addon/addon.h" #include "include_internal/ten_runtime/binding/common.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/io/runloop.h" #include "ten_utils/macro/check.h" diff --git a/core/include_internal/ten_utils/log/level.h b/core/include_internal/ten_utils/log/level.h index 96244a01ec..98a7679836 100644 --- a/core/include_internal/ten_utils/log/level.h +++ b/core/include_internal/ten_utils/log/level.h @@ -7,7 +7,7 @@ #include "ten_utils/ten_config.h" -#include "include_internal/ten_utils/log/log.h" +#include "ten_utils/log/log.h" TEN_UTILS_PRIVATE_API char ten_log_level_char(TEN_LOG_LEVEL level); diff --git a/core/src/ten_runtime/addon/extension/extension.c b/core/src/ten_runtime/addon/extension/extension.c index 9d93fda112..6aba34b193 100644 --- a/core/src/ten_runtime/addon/extension/extension.c +++ b/core/src/ten_runtime/addon/extension/extension.c @@ -12,10 +12,9 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/addon/addon.h" #include "ten_runtime/ten_env/ten_env.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static ten_addon_store_t g_extension_store = { diff --git a/core/src/ten_runtime/addon/extension_group/extension_group.c b/core/src/ten_runtime/addon/extension_group/extension_group.c index 3c815f7d18..632b60e49d 100644 --- a/core/src/ten_runtime/addon/extension_group/extension_group.c +++ b/core/src/ten_runtime/addon/extension_group/extension_group.c @@ -10,9 +10,8 @@ #include "include_internal/ten_runtime/engine/engine.h" #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/addon/extension_group/extension_group.h" +#include "ten_utils/macro/check.h" static ten_addon_store_t g_extension_group_store = { false, diff --git a/core/src/ten_runtime/addon/protocol/protocol.c b/core/src/ten_runtime/addon/protocol/protocol.c index a061c413f9..8ee7f827f0 100644 --- a/core/src/ten_runtime/addon/protocol/protocol.c +++ b/core/src/ten_runtime/addon/protocol/protocol.c @@ -8,13 +8,12 @@ #include "include_internal/ten_runtime/addon/addon.h" #include "include_internal/ten_runtime/addon/common/store.h" #include "include_internal/ten_runtime/common/constant_str.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" #include "ten_utils/lib/uri.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_get.h" diff --git a/core/src/ten_runtime/addon/ten_env/on_xxx.c b/core/src/ten_runtime/addon/ten_env/on_xxx.c index 41a78596aa..2a3106b5d9 100644 --- a/core/src/ten_runtime/addon/ten_env/on_xxx.c +++ b/core/src/ten_runtime/addon/ten_env/on_xxx.c @@ -17,10 +17,9 @@ #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" void ten_addon_on_init_done(ten_env_t *self) { diff --git a/core/src/ten_runtime/app/close.c b/core/src/ten_runtime/app/close.c index 51e1ecaa38..aaa13f828c 100644 --- a/core/src/ten_runtime/app/close.c +++ b/core/src/ten_runtime/app/close.c @@ -15,14 +15,13 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/context_store.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/protocol/context_store.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" diff --git a/core/src/ten_runtime/app/ten_env/on_xxx.c b/core/src/ten_runtime/app/ten_env/on_xxx.c index 271865f1bc..c1145aeaa8 100644 --- a/core/src/ten_runtime/app/ten_env/on_xxx.c +++ b/core/src/ten_runtime/app/ten_env/on_xxx.c @@ -17,7 +17,6 @@ #include "include_internal/ten_runtime/schema_store/store.h" #include "include_internal/ten_runtime/ten_env/metadata_cb.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/ten_env/internal/on_xxx_done.h" diff --git a/core/src/ten_runtime/binding/python/native/app/app.c b/core/src/ten_runtime/binding/python/native/app/app.c index b04cdfd341..135aafca38 100644 --- a/core/src/ten_runtime/binding/python/native/app/app.c +++ b/core/src/ten_runtime/binding/python/native/app/app.c @@ -11,7 +11,6 @@ #include "include_internal/ten_runtime/binding/python/ten_env/ten_env.h" #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/metadata/metadata_info.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/binding/python/common.h" #include "ten_runtime/ten_env/ten_env.h" diff --git a/core/src/ten_runtime/binding/python/native/common/error.c b/core/src/ten_runtime/binding/python/native/common/error.c index b0eecc7c91..6ef1536857 100644 --- a/core/src/ten_runtime/binding/python/native/common/error.c +++ b/core/src/ten_runtime/binding/python/native/common/error.c @@ -6,7 +6,7 @@ #include #include "include_internal/ten_runtime/binding/python/common/python_stuff.h" -#include "include_internal/ten_utils/log/log.h" +#include "ten_utils/log/log.h" static void ten_py_print_py_error(void) { PyObject *ptype = NULL; diff --git a/core/src/ten_runtime/connection/connection.c b/core/src/ten_runtime/connection/connection.c index 6b97f520e8..981220335c 100644 --- a/core/src/ten_runtime/connection/connection.c +++ b/core/src/ten_runtime/connection/connection.c @@ -18,8 +18,6 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/remote/remote.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/container/list.h" @@ -29,6 +27,7 @@ #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/ref.h" #include "ten_utils/lib/smart_ptr.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" diff --git a/core/src/ten_runtime/engine/internal/close.c b/core/src/ten_runtime/engine/internal/close.c index 2162a08bc7..76319e98a3 100644 --- a/core/src/ten_runtime/engine/internal/close.c +++ b/core/src/ten_runtime/engine/internal/close.c @@ -15,14 +15,13 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/remote/remote.h" #include "include_internal/ten_runtime/timer/timer.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/container/hash_handle.h" #include "ten_utils/container/hash_table.h" #include "ten_utils/container/list.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/engine/internal/extension_interface.c b/core/src/ten_runtime/engine/internal/extension_interface.c index e4b71c0b9f..c9be3cf631 100644 --- a/core/src/ten_runtime/engine/internal/extension_interface.c +++ b/core/src/ten_runtime/engine/internal/extension_interface.c @@ -15,14 +15,12 @@ #include "include_internal/ten_runtime/engine/msg_interface/start_graph.h" #include "include_internal/ten_runtime/extension_context/extension_context.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" -#include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/smart_ptr.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" // The 'cmd' parameter is the command triggers the enabling of extension system. diff --git a/core/src/ten_runtime/engine/internal/remote_interface.c b/core/src/ten_runtime/engine/internal/remote_interface.c index 1ff8378f9e..c77709ce0e 100644 --- a/core/src/ten_runtime/engine/internal/remote_interface.c +++ b/core/src/ten_runtime/engine/internal/remote_interface.c @@ -19,8 +19,6 @@ #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/remote/remote.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" @@ -29,6 +27,7 @@ #include "ten_utils/container/list_ptr.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/engine/internal/thread.c b/core/src/ten_runtime/engine/internal/thread.c index 34fbfb6aa7..3c54f693a2 100644 --- a/core/src/ten_runtime/engine/internal/thread.c +++ b/core/src/ten_runtime/engine/internal/thread.c @@ -11,13 +11,12 @@ #include "include_internal/ten_runtime/app/app.h" #include "include_internal/ten_runtime/connection/connection.h" #include "include_internal/ten_runtime/engine/engine.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/event.h" #include "ten_utils/lib/string.h" #include "ten_utils/lib/thread.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" diff --git a/core/src/ten_runtime/engine/msg_interface/timer.c b/core/src/ten_runtime/engine/msg_interface/timer.c index da27d8e02c..da522cc249 100644 --- a/core/src/ten_runtime/engine/msg_interface/timer.c +++ b/core/src/ten_runtime/engine/msg_interface/timer.c @@ -11,10 +11,9 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/timer/timer.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/timer/timer.h" +#include "ten_utils/macro/check.h" static void ten_engine_timer_on_trigger(ten_timer_t *self, void *on_trigger_data) { diff --git a/core/src/ten_runtime/extension/msg_handling.c b/core/src/ten_runtime/extension/msg_handling.c index ee9f38fd7b..82e80e4b07 100644 --- a/core/src/ten_runtime/extension/msg_handling.c +++ b/core/src/ten_runtime/extension/msg_handling.c @@ -19,8 +19,6 @@ #include "include_internal/ten_runtime/path/path.h" #include "include_internal/ten_runtime/path/path_group.h" #include "include_internal/ten_runtime/path/path_table.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/ten_env/internal/return.h" @@ -28,6 +26,7 @@ #include "ten_utils/container/list_ptr.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/smart_ptr.h" +#include "ten_utils/macro/check.h" static void ten_extension_cache_cmd_result_to_in_path_for_auto_return( ten_extension_t *extension, ten_shared_ptr_t *cmd) { diff --git a/core/src/ten_runtime/extension/ten_env/on_xxx.c b/core/src/ten_runtime/extension/ten_env/on_xxx.c index 25f5e961f8..a443da5df9 100644 --- a/core/src/ten_runtime/extension/ten_env/on_xxx.c +++ b/core/src/ten_runtime/extension/ten_env/on_xxx.c @@ -13,9 +13,8 @@ #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" +#include "ten_utils/macro/check.h" static ten_extension_on_init_done_t *ten_extension_on_init_done_create( ten_extension_t *extension) { diff --git a/core/src/ten_runtime/extension_context/internal/del_extension.c b/core/src/ten_runtime/extension_context/internal/del_extension.c index 36317894ec..03afeea918 100644 --- a/core/src/ten_runtime/extension_context/internal/del_extension.c +++ b/core/src/ten_runtime/extension_context/internal/del_extension.c @@ -13,9 +13,8 @@ #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/ten_env/ten_env.h" +#include "ten_utils/macro/check.h" void ten_extension_context_delete_extension(void *self_, void *arg) { ten_extension_context_t *self = self_; diff --git a/core/src/ten_runtime/extension_context/internal/extension_group_is_inited.c b/core/src/ten_runtime/extension_context/internal/extension_group_is_inited.c index b58cb22e0c..e72c7e7a4a 100644 --- a/core/src/ten_runtime/extension_context/internal/extension_group_is_inited.c +++ b/core/src/ten_runtime/extension_context/internal/extension_group_is_inited.c @@ -11,10 +11,9 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" +#include "ten_utils/macro/check.h" void ten_extension_context_on_all_extensions_in_extension_group_are_inited( void *self_, void *arg) { diff --git a/core/src/ten_runtime/extension_context/internal/extension_group_is_stopped.c b/core/src/ten_runtime/extension_context/internal/extension_group_is_stopped.c index 20761c59ec..a351b229e3 100644 --- a/core/src/ten_runtime/extension_context/internal/extension_group_is_stopped.c +++ b/core/src/ten_runtime/extension_context/internal/extension_group_is_stopped.c @@ -11,10 +11,9 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" +#include "ten_utils/macro/check.h" void ten_extension_context_on_all_extensions_in_extension_group_are_stopped( void *self_, void *arg) { diff --git a/core/src/ten_runtime/extension_context/internal/extension_thread_is_closing.c b/core/src/ten_runtime/extension_context/internal/extension_thread_is_closing.c index 18883c3cc4..4d76068dc3 100644 --- a/core/src/ten_runtime/extension_context/internal/extension_thread_is_closing.c +++ b/core/src/ten_runtime/extension_context/internal/extension_thread_is_closing.c @@ -11,7 +11,6 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/extension_thread/on_xxx.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" diff --git a/core/src/ten_runtime/extension_group/internal/metadata.c b/core/src/ten_runtime/extension_group/internal/metadata.c index 561e1699ca..2759476db6 100644 --- a/core/src/ten_runtime/extension_group/internal/metadata.c +++ b/core/src/ten_runtime/extension_group/internal/metadata.c @@ -11,7 +11,6 @@ #include "include_internal/ten_runtime/extension_group/extension_group_info/extension_group_info.h" #include "include_internal/ten_runtime/extension_group/on_xxx.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/check.h" void ten_extension_group_load_metadata(ten_extension_group_t *self) { diff --git a/core/src/ten_runtime/extension_group/ten_env/on_xxx.c b/core/src/ten_runtime/extension_group/ten_env/on_xxx.c index b9a9bb168c..0a1a10ba96 100644 --- a/core/src/ten_runtime/extension_group/ten_env/on_xxx.c +++ b/core/src/ten_runtime/extension_group/ten_env/on_xxx.c @@ -15,11 +15,10 @@ #include "include_internal/ten_runtime/metadata/metadata_info.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/container/list.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" void ten_extension_group_on_init(ten_env_t *ten_env) { diff --git a/core/src/ten_runtime/extension_thread/extension_thread.c b/core/src/ten_runtime/extension_thread/extension_thread.c index 14a1e6c38b..762a51d3a3 100644 --- a/core/src/ten_runtime/extension_thread/extension_thread.c +++ b/core/src/ten_runtime/extension_thread/extension_thread.c @@ -22,7 +22,6 @@ #include "include_internal/ten_runtime/extension_thread/msg_interface/common.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/check.h" #include "include_internal/ten_utils/sanitizer/thread_check.h" #include "ten_runtime/extension/extension.h" diff --git a/core/src/ten_runtime/extension_thread/on_xxx.c b/core/src/ten_runtime/extension_thread/on_xxx.c index 6b83bc1697..3ba87a4269 100644 --- a/core/src/ten_runtime/extension_thread/on_xxx.c +++ b/core/src/ten_runtime/extension_thread/on_xxx.c @@ -37,8 +37,6 @@ #include "include_internal/ten_runtime/path/path_table.h" #include "include_internal/ten_runtime/schema_store/store.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/container/list.h" @@ -47,6 +45,7 @@ #include "ten_utils/lib/error.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_runtime/global/signal.c b/core/src/ten_runtime/global/signal.c index 9b33416d14..711930c5bd 100644 --- a/core/src/ten_runtime/global/signal.c +++ b/core/src/ten_runtime/global/signal.c @@ -12,12 +12,11 @@ #include "include_internal/ten_runtime/app/close.h" #include "include_internal/ten_runtime/global/global.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" #include "ten_utils/container/list.h" #include "ten_utils/container/list_node_ptr.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" #include "ten_utils/sanitizer/memory_check.h" diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/long_running_mode.c b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/long_running_mode.c index 2823902dcf..b19deff0e9 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/long_running_mode.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/long_running_mode.c @@ -8,11 +8,10 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/msg/cmd/start_graph/cmd.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" bool ten_cmd_start_graph_put_long_running_mode_to_json(ten_msg_t *self, diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/predefined_graph_name.c b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/predefined_graph_name.c index cf29972783..efa6e09747 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/predefined_graph_name.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/field/predefined_graph_name.c @@ -8,11 +8,10 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/msg/cmd/start_graph/cmd.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" bool ten_cmd_start_graph_put_predefined_graph_name_to_json(ten_msg_t *self, diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/field/graph_name.c b/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/field/graph_name.c index 8f005cf8f0..d22a8b2fe1 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/field/graph_name.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/stop_graph/field/graph_name.c @@ -10,10 +10,9 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/stop_graph/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" bool ten_cmd_stop_graph_put_graph_name_to_json(ten_msg_t *self, diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timeout/field/timer_id.c b/core/src/ten_runtime/msg/cmd_base/cmd/timeout/field/timer_id.c index 939ebc6e0e..eb3e380934 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timeout/field/timer_id.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timeout/field/timer_id.c @@ -9,9 +9,8 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd/timeout/cmd.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" bool ten_cmd_timeout_put_timer_id_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timeout_in_us.c b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timeout_in_us.c index c1152f4d98..ade92f91d7 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timeout_in_us.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timeout_in_us.c @@ -6,9 +6,8 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" bool ten_cmd_timer_put_timeout_in_us_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timer_id.c b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timer_id.c index c1f32e2721..70c8fd81e8 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timer_id.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/timer_id.c @@ -6,9 +6,8 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" bool ten_cmd_timer_put_timer_id_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/times.c b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/times.c index 9b77169f63..d0950e4545 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/times.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/timer/field/times.c @@ -8,9 +8,8 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" bool ten_cmd_timer_put_times_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/cmd_base/cmd_result/field/original_cmd_type.c b/core/src/ten_runtime/msg/cmd_base/cmd_result/field/original_cmd_type.c index 25ac42061d..75005e7af5 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd_result/field/original_cmd_type.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd_result/field/original_cmd_type.c @@ -8,10 +8,9 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_result/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/lib/json.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" bool ten_cmd_result_put_original_cmd_type_to_json(ten_msg_t *self, diff --git a/core/src/ten_runtime/msg/cmd_base/cmd_result/field/status_code.c b/core/src/ten_runtime/msg/cmd_base/cmd_result/field/status_code.c index c210776872..38dff7f111 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd_result/field/status_code.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd_result/field/status_code.c @@ -8,11 +8,10 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_result/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/lib/json.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" bool ten_cmd_result_put_status_code_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/cmd_base/field/cmd_id.c b/core/src/ten_runtime/msg/cmd_base/field/cmd_id.c index 32cad4b6e0..5f6bd098d3 100644 --- a/core/src/ten_runtime/msg/cmd_base/field/cmd_id.c +++ b/core/src/ten_runtime/msg/cmd_base/field/cmd_id.c @@ -8,10 +8,9 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" bool ten_cmd_base_put_cmd_id_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/cmd_base/field/seq_id.c b/core/src/ten_runtime/msg/cmd_base/field/seq_id.c index 8f0533dfa2..55411d6b90 100644 --- a/core/src/ten_runtime/msg/cmd_base/field/seq_id.c +++ b/core/src/ten_runtime/msg/cmd_base/field/seq_id.c @@ -8,10 +8,9 @@ #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" bool ten_cmd_base_put_seq_id_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/field/name.c b/core/src/ten_runtime/msg/field/name.c index ebc2d5b989..c325a7a328 100644 --- a/core/src/ten_runtime/msg/field/name.c +++ b/core/src/ten_runtime/msg/field/name.c @@ -5,10 +5,9 @@ // #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" bool ten_raw_msg_name_to_json(ten_msg_t *self, ten_json_t *json, diff --git a/core/src/ten_runtime/msg/msg.c b/core/src/ten_runtime/msg/msg.c index c0cda1eed1..e3d18a6a09 100644 --- a/core/src/ten_runtime/msg/msg.c +++ b/core/src/ten_runtime/msg/msg.c @@ -22,8 +22,6 @@ #include "include_internal/ten_runtime/msg/field/field_info.h" #include "include_internal/ten_runtime/msg/msg_info.h" #include "include_internal/ten_runtime/schema_store/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/value/value_path.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" @@ -39,6 +37,7 @@ #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/value.h" diff --git a/core/src/ten_runtime/protocol/asynced/protocol_asynced.c b/core/src/ten_runtime/protocol/asynced/protocol_asynced.c index 04b56c4ab1..8dfd5369ae 100644 --- a/core/src/ten_runtime/protocol/asynced/protocol_asynced.c +++ b/core/src/ten_runtime/protocol/asynced/protocol_asynced.c @@ -20,8 +20,6 @@ #include "include_internal/ten_runtime/protocol/close.h" #include "include_internal/ten_runtime/protocol/protocol.h" #include "include_internal/ten_runtime/remote/remote.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/protocol/close.h" #include "ten_utils/container/list.h" @@ -31,6 +29,7 @@ #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/ref.h" #include "ten_utils/lib/smart_ptr.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" #include "ten_utils/sanitizer/thread_check.h" diff --git a/core/src/ten_runtime/protocol/close.c b/core/src/ten_runtime/protocol/close.c index 6d6782dd82..b79a89849c 100644 --- a/core/src/ten_runtime/protocol/close.c +++ b/core/src/ten_runtime/protocol/close.c @@ -7,7 +7,6 @@ #include "include_internal/ten_runtime/common/closeable.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_runtime/protocol/context.c b/core/src/ten_runtime/protocol/context.c index 75d523e8dd..204ac813a4 100644 --- a/core/src/ten_runtime/protocol/context.c +++ b/core/src/ten_runtime/protocol/context.c @@ -8,13 +8,12 @@ #include "include_internal/ten_runtime/protocol/context.h" #include "include_internal/ten_runtime/protocol/context_store.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/ref.h" #include "ten_utils/lib/signature.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/macro/memory.h" #include "ten_utils/sanitizer/thread_check.h" diff --git a/core/src/ten_runtime/protocol/integrated/close.c b/core/src/ten_runtime/protocol/integrated/close.c index 4233d15b33..3ea6f2cc9a 100644 --- a/core/src/ten_runtime/protocol/integrated/close.c +++ b/core/src/ten_runtime/protocol/integrated/close.c @@ -9,9 +9,8 @@ #include "include_internal/ten_runtime/protocol/integrated/close.h" #include "include_internal/ten_runtime/protocol/integrated/protocol_integrated.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/io/stream.h" +#include "ten_utils/macro/check.h" // The principle is very simple. As long as the integrated protocol still has // resources in hands, it cannot be closed, otherwise it can. diff --git a/core/src/ten_runtime/remote/remote.c b/core/src/ten_runtime/remote/remote.c index dc28f9d58b..f8613fb132 100644 --- a/core/src/ten_runtime/remote/remote.c +++ b/core/src/ten_runtime/remote/remote.c @@ -14,12 +14,10 @@ #include "include_internal/ten_runtime/engine/internal/thread.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/protocol/protocol.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" -#include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" #include "ten_utils/sanitizer/thread_check.h" diff --git a/core/src/ten_runtime/schema_store/interface_info.c b/core/src/ten_runtime/schema_store/interface_info.c index aa62623adb..c3486e2d5f 100644 --- a/core/src/ten_runtime/schema_store/interface_info.c +++ b/core/src/ten_runtime/schema_store/interface_info.c @@ -5,11 +5,10 @@ // #include "include_internal/ten_runtime/schema_store/interface.h" #include "include_internal/ten_rust/ten_rust.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/json.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/memory.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_is.h" diff --git a/core/src/ten_runtime/schema_store/store.c b/core/src/ten_runtime/schema_store/store.c index 7ec55291da..bfdff5cbc3 100644 --- a/core/src/ten_runtime/schema_store/store.c +++ b/core/src/ten_runtime/schema_store/store.c @@ -14,8 +14,6 @@ #include "include_internal/ten_runtime/schema_store/interface.h" #include "include_internal/ten_runtime/schema_store/msg.h" #include "include_internal/ten_runtime/schema_store/property.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/constant_str.h" #include "include_internal/ten_utils/schema/schema.h" #include "include_internal/ten_utils/schema/types/schema_object.h" @@ -26,6 +24,7 @@ #include "ten_utils/container/list_ptr.h" #include "ten_utils/lib/error.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" #include "ten_utils/value/value.h" #include "ten_utils/value/value_is.h" diff --git a/core/src/ten_runtime/ten_env/internal/send.c b/core/src/ten_runtime/ten_env/internal/send.c index 294a03d0fc..3e9c461e97 100644 --- a/core/src/ten_runtime/ten_env/internal/send.c +++ b/core/src/ten_runtime/ten_env/internal/send.c @@ -14,12 +14,11 @@ #include "include_internal/ten_runtime/msg/cmd_base/cmd_base.h" #include "include_internal/ten_runtime/msg/msg.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/msg.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/error.h" +#include "ten_utils/macro/check.h" /** * @brief All message sending code flows will eventually fall into this diff --git a/core/src/ten_runtime/ten_env/internal/set_property.c b/core/src/ten_runtime/ten_env/internal/set_property.c index 92d5d31f78..d085136a06 100644 --- a/core/src/ten_runtime/ten_env/internal/set_property.c +++ b/core/src/ten_runtime/ten_env/internal/set_property.c @@ -16,14 +16,13 @@ #include "include_internal/ten_runtime/ten_env/metadata.h" #include "include_internal/ten_runtime/ten_env/metadata_cb.h" #include "include_internal/ten_runtime/ten_env/ten_env.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/ten_env/internal/metadata.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" static ten_env_set_property_sync_context_t * diff --git a/core/src/ten_runtime/ten_env/ten_env.c b/core/src/ten_runtime/ten_env/ten_env.c index 2f67a7d608..d454b9cd07 100644 --- a/core/src/ten_runtime/ten_env/ten_env.c +++ b/core/src/ten_runtime/ten_env/ten_env.c @@ -16,14 +16,13 @@ #include "include_internal/ten_runtime/extension_group/extension_group.h" #include "include_internal/ten_runtime/extension_thread/extension_thread.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_runtime/app/app.h" #include "ten_runtime/binding/common.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/string.h" +#include "ten_utils/macro/check.h" #include "ten_utils/sanitizer/thread_check.h" bool ten_env_check_integrity(ten_env_t *self, bool check_thread) { diff --git a/core/src/ten_runtime/timer/timer.c b/core/src/ten_runtime/timer/timer.c index a39d87f228..3efcd637b2 100644 --- a/core/src/ten_runtime/timer/timer.c +++ b/core/src/ten_runtime/timer/timer.c @@ -11,7 +11,6 @@ #include "include_internal/ten_runtime/common/loc.h" #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" #include "include_internal/ten_runtime/msg/msg.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_runtime/timer/timer.h" #include "ten_utils/io/runloop.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_utils/backtrace/common.c b/core/src/ten_utils/backtrace/common.c index 6786b47172..f5a0ee69bd 100644 --- a/core/src/ten_utils/backtrace/common.c +++ b/core/src/ten_utils/backtrace/common.c @@ -10,7 +10,6 @@ #include #include "include_internal/ten_utils/backtrace/backtrace.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_utils/backtrace/platform/posix/darwin/backtrace.c b/core/src/ten_utils/backtrace/platform/posix/darwin/backtrace.c index aa96f855f6..51d3c55b77 100644 --- a/core/src/ten_utils/backtrace/platform/posix/darwin/backtrace.c +++ b/core/src/ten_utils/backtrace/platform/posix/darwin/backtrace.c @@ -12,7 +12,6 @@ #include #include "include_internal/ten_utils/backtrace/common.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/alloc.h" /** diff --git a/core/src/ten_utils/backtrace/platform/posix/fileline.c b/core/src/ten_utils/backtrace/platform/posix/fileline.c index 7e019d64ae..bd0935b4c0 100644 --- a/core/src/ten_utils/backtrace/platform/posix/fileline.c +++ b/core/src/ten_utils/backtrace/platform/posix/fileline.c @@ -16,6 +16,7 @@ #include #include "include_internal/ten_utils/backtrace/platform/posix/config.h" // IWYU pragma: keep +#include "ten_utils/log/log.h" #ifdef HAVE_MACH_O_DYLD_H #include @@ -23,7 +24,6 @@ #include "include_internal/ten_utils/backtrace/backtrace.h" #include "include_internal/ten_utils/backtrace/platform/posix/internal.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/atomic_ptr.h" #include "ten_utils/lib/file.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_utils/backtrace/platform/win/internal.c b/core/src/ten_utils/backtrace/platform/win/internal.c index be037cad72..95cf40abba 100644 --- a/core/src/ten_utils/backtrace/platform/win/internal.c +++ b/core/src/ten_utils/backtrace/platform/win/internal.c @@ -16,7 +16,6 @@ #include "include_internal/ten_utils/backtrace/backtrace.h" #include "include_internal/ten_utils/backtrace/common.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/macro/memory.h" diff --git a/core/src/ten_utils/io/general/loops/runloop.c b/core/src/ten_utils/io/general/loops/runloop.c index 62ed09e765..5c3ad22af4 100644 --- a/core/src/ten_utils/io/general/loops/runloop.c +++ b/core/src/ten_utils/io/general/loops/runloop.c @@ -8,8 +8,6 @@ #include #include -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/container/list.h" #include "ten_utils/io/general/loops/runloop.h" #include "ten_utils/lib/alloc.h" @@ -17,6 +15,7 @@ #include "ten_utils/lib/mutex.h" #include "ten_utils/lib/thread_local.h" #include "ten_utils/lib/thread_once.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/field.h" #include "ten_utils/macro/mark.h" diff --git a/core/src/ten_utils/io/posix/socket.c b/core/src/ten_utils/io/posix/socket.c index 1ff609b907..2041508f46 100644 --- a/core/src/ten_utils/io/posix/socket.c +++ b/core/src/ten_utils/io/posix/socket.c @@ -11,9 +11,8 @@ #include #include -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" +#include "ten_utils/macro/check.h" #include "ten_utils/macro/mark.h" ten_socket_t *ten_socket_create(TEN_SOCKET_FAMILY family, TEN_SOCKET_TYPE type, diff --git a/core/src/ten_utils/lib/sys/general/ref.c b/core/src/ten_utils/lib/sys/general/ref.c index 8579710f8b..b5e33389bb 100644 --- a/core/src/ten_utils/lib/sys/general/ref.c +++ b/core/src/ten_utils/lib/sys/general/ref.c @@ -5,11 +5,10 @@ // #include "ten_utils/lib/ref.h" -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/atomic.h" #include "ten_utils/lib/signature.h" +#include "ten_utils/macro/check.h" static bool ten_ref_check_integrity(ten_ref_t *self, bool has_positive_ref_cnt) { diff --git a/core/src/ten_utils/lib/sys/general/thread.c b/core/src/ten_utils/lib/sys/general/thread.c index 389a8fddd1..f409d3fc8a 100644 --- a/core/src/ten_utils/lib/sys/general/thread.c +++ b/core/src/ten_utils/lib/sys/general/thread.c @@ -15,11 +15,10 @@ #include #endif -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/thread_local.h" #include "ten_utils/lib/thread_once.h" +#include "ten_utils/macro/check.h" static ten_thread_once_t __tcb_once = TEN_THREAD_ONCE_INIT; static ten_thread_key_t __tcb = kInvalidTlsKey; diff --git a/core/src/ten_utils/lib/sys/posix/file_lock.c b/core/src/ten_utils/lib/sys/posix/file_lock.c index fbacd30b64..af8ec83c16 100644 --- a/core/src/ten_utils/lib/sys/posix/file_lock.c +++ b/core/src/ten_utils/lib/sys/posix/file_lock.c @@ -8,7 +8,7 @@ #include #include -#include "include_internal/ten_utils/log/log.h" +#include "ten_utils/log/log.h" static int ten_file_lock_reg(int fd, int cmd, short type, off_t offset, short whence, off_t len) { diff --git a/core/src/ten_utils/lib/sys/posix/thread_local.c b/core/src/ten_utils/lib/sys/posix/thread_local.c index 23ab6ecc78..b367c19d38 100644 --- a/core/src/ten_utils/lib/sys/posix/thread_local.c +++ b/core/src/ten_utils/lib/sys/posix/thread_local.c @@ -7,7 +7,7 @@ #include -#include "include_internal/ten_utils/log/log.h" +#include "ten_utils/log/log.h" ten_thread_key_t ten_thread_key_create(void) { ten_thread_key_t key = kInvalidTlsKey; diff --git a/core/src/ten_utils/lib/sys/posix/thread_once.c b/core/src/ten_utils/lib/sys/posix/thread_once.c index c94c130d61..1ca13abbae 100644 --- a/core/src/ten_utils/lib/sys/posix/thread_once.c +++ b/core/src/ten_utils/lib/sys/posix/thread_once.c @@ -7,7 +7,6 @@ #include -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/check.h" int ten_thread_once(ten_thread_once_t *once_control, diff --git a/core/src/ten_utils/log/output.c b/core/src/ten_utils/log/output.c index 0e71f76c4c..83d2b2c3ab 100644 --- a/core/src/ten_utils/log/output.c +++ b/core/src/ten_utils/log/output.c @@ -18,7 +18,6 @@ #include "include_internal/ten_utils/log/log.h" #include "include_internal/ten_utils/log/output.h" #include "ten_utils/lib/file.h" -#include "ten_utils/macro/check.h" static void ten_log_output_set(ten_log_t *self, const ten_log_output_func_t output_cb, diff --git a/core/src/ten_utils/sanitizer/memory_check.c b/core/src/ten_utils/sanitizer/memory_check.c index 023bced49f..34e38911f0 100644 --- a/core/src/ten_utils/sanitizer/memory_check.c +++ b/core/src/ten_utils/sanitizer/memory_check.c @@ -13,7 +13,6 @@ #include #include -#include "include_internal/ten_utils/log/log.h" #include "include_internal/ten_utils/sanitizer/memory_check.h" #include "ten_utils/container/list.h" #include "ten_utils/lib/alloc.h" diff --git a/core/src/ten_utils/sanitizer/thread_check.c b/core/src/ten_utils/sanitizer/thread_check.c index 96b6ce1d01..f4131dbdbb 100644 --- a/core/src/ten_utils/sanitizer/thread_check.c +++ b/core/src/ten_utils/sanitizer/thread_check.c @@ -7,10 +7,9 @@ #include -#include "include_internal/ten_utils/log/log.h" -#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/sanitizer/thread_check.h" #include "ten_utils/lib/thread.h" +#include "ten_utils/macro/check.h" bool ten_sanitizer_thread_check_check_integrity( ten_sanitizer_thread_check_t *self) { diff --git a/tests/common/client/curl_connect.c b/tests/common/client/curl_connect.c index a2d4ab2ecb..560ed7b436 100644 --- a/tests/common/client/curl_connect.c +++ b/tests/common/client/curl_connect.c @@ -5,8 +5,8 @@ // #include "tests/common/client/curl_connect.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/time.h" +#include "ten_utils/log/log.h" bool ten_test_curl_connect_with_retry(CURL *curl, uint16_t max_retries, int64_t delay_in_ms) { diff --git a/tests/ten_runtime/integration/go/access_property_go/client/client.cc b/tests/ten_runtime/integration/go/access_property_go/client/client.cc index ca801fd394..c5aa632a48 100644 --- a/tests/ten_runtime/integration/go/access_property_go/client/client.cc +++ b/tests/ten_runtime/integration/go/access_property_go/client/client.cc @@ -5,7 +5,6 @@ // #include -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/close_app_go/client/client.cc b/tests/ten_runtime/integration/go/close_app_go/client/client.cc index 736c4983c5..ece702d064 100644 --- a/tests/ten_runtime/integration/go/close_app_go/client/client.cc +++ b/tests/ten_runtime/integration/go/close_app_go/client/client.cc @@ -6,7 +6,6 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/expired_ten_go/client/client.cc b/tests/ten_runtime/integration/go/expired_ten_go/client/client.cc index 05c98e7cd7..a0fd20fda6 100644 --- a/tests/ten_runtime/integration/go/expired_ten_go/client/client.cc +++ b/tests/ten_runtime/integration/go/expired_ten_go/client/client.cc @@ -6,7 +6,6 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/frequently_cgo_call_go/client/client.cc b/tests/ten_runtime/integration/go/frequently_cgo_call_go/client/client.cc index 2a6850d8c4..bce444eff4 100644 --- a/tests/ten_runtime/integration/go/frequently_cgo_call_go/client/client.cc +++ b/tests/ten_runtime/integration/go/frequently_cgo_call_go/client/client.cc @@ -6,7 +6,6 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/handle_error_go/client/client.cc b/tests/ten_runtime/integration/go/handle_error_go/client/client.cc index 212adb518c..517ae3bce5 100644 --- a/tests/ten_runtime/integration/go/handle_error_go/client/client.cc +++ b/tests/ten_runtime/integration/go/handle_error_go/client/client.cc @@ -5,8 +5,6 @@ // #include -#include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/prepare_to_stop_go/client/client.cc b/tests/ten_runtime/integration/go/prepare_to_stop_go/client/client.cc index fb8414b83d..64a2161476 100644 --- a/tests/ten_runtime/integration/go/prepare_to_stop_go/client/client.cc +++ b/tests/ten_runtime/integration/go/prepare_to_stop_go/client/client.cc @@ -5,8 +5,6 @@ // #include -#include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/return_result_go/client/client.cc b/tests/ten_runtime/integration/go/return_result_go/client/client.cc index 48dd501153..f480ec8421 100644 --- a/tests/ten_runtime/integration/go/return_result_go/client/client.cc +++ b/tests/ten_runtime/integration/go/return_result_go/client/client.cc @@ -5,7 +5,6 @@ // #include -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/return_value_go/client/client.cc b/tests/ten_runtime/integration/go/return_value_go/client/client.cc index 05c98e7cd7..4d9a64d3e5 100644 --- a/tests/ten_runtime/integration/go/return_value_go/client/client.cc +++ b/tests/ten_runtime/integration/go/return_value_go/client/client.cc @@ -5,8 +5,6 @@ // #include -#include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/send_json_go/client/client.cc b/tests/ten_runtime/integration/go/send_json_go/client/client.cc index 399c26587b..3a0812f1dc 100644 --- a/tests/ten_runtime/integration/go/send_json_go/client/client.cc +++ b/tests/ten_runtime/integration/go/send_json_go/client/client.cc @@ -5,8 +5,6 @@ // #include -#include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/start_app_sync_go/client/client.cc b/tests/ten_runtime/integration/go/start_app_sync_go/client/client.cc index 736c4983c5..7c1f652548 100644 --- a/tests/ten_runtime/integration/go/start_app_sync_go/client/client.cc +++ b/tests/ten_runtime/integration/go/start_app_sync_go/client/client.cc @@ -5,8 +5,6 @@ // #include -#include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/three_extension_cmd_go/client/client.cc b/tests/ten_runtime/integration/go/three_extension_cmd_go/client/client.cc index 5b8f52c873..e95c478029 100644 --- a/tests/ten_runtime/integration/go/three_extension_cmd_go/client/client.cc +++ b/tests/ten_runtime/integration/go/three_extension_cmd_go/client/client.cc @@ -6,7 +6,6 @@ #include #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/transfer_pointer_go/client/client.cc b/tests/ten_runtime/integration/go/transfer_pointer_go/client/client.cc index 40dc2706cd..5ea37c4e1f 100644 --- a/tests/ten_runtime/integration/go/transfer_pointer_go/client/client.cc +++ b/tests/ten_runtime/integration/go/transfer_pointer_go/client/client.cc @@ -5,7 +5,6 @@ // #include -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/client/client.cc b/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/client/client.cc index 6556117fe2..89e25d1e3d 100644 --- a/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/client/client.cc +++ b/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/client/client.cc @@ -5,8 +5,6 @@ // #include -#include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/macro/mark.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/smoke/extension_test/graph_name/graph_name_basic.cc b/tests/ten_runtime/smoke/extension_test/graph_name/graph_name_basic.cc index 96a5b2053b..f288f9f2ad 100644 --- a/tests/ten_runtime/smoke/extension_test/graph_name/graph_name_basic.cc +++ b/tests/ten_runtime/smoke/extension_test/graph_name/graph_name_basic.cc @@ -8,7 +8,6 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "include_internal/ten_utils/log/log.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" #include "tests/common/client/cpp/msgpack_tcp.h" From d67195bfee67d2bde78f628b40e951696fab5cda Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 17 Sep 2024 15:21:36 +0800 Subject: [PATCH 13/13] feat: new log mechanism --- .../default_extension_python/extension.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/ten_runtime/integration/python/multiple_results_python/multiple_results_python_app/ten_packages/extension/default_extension_python/extension.py b/tests/ten_runtime/integration/python/multiple_results_python/multiple_results_python_app/ten_packages/extension/default_extension_python/extension.py index 5503beed10..e5559c2152 100644 --- a/tests/ten_runtime/integration/python/multiple_results_python/multiple_results_python_app/ten_packages/extension/default_extension_python/extension.py +++ b/tests/ten_runtime/integration/python/multiple_results_python/multiple_results_python_app/ten_packages/extension/default_extension_python/extension.py @@ -20,7 +20,7 @@ def __init__(self, name: str) -> None: self.__counter = 0 def on_init(self, ten_env: TenEnv) -> None: - print(f"{self.name} on_init") + ten_env.log_debug("on_init") ten_env.on_init_done() def check_hello(self, ten_env: TenEnv, result: CmdResult, receivedCmd: Cmd): @@ -28,20 +28,18 @@ def check_hello(self, ten_env: TenEnv, result: CmdResult, receivedCmd: Cmd): if self.__counter == 1: assert result.get_is_final() is False - print(f"{self.name} receive 1 cmd result") + ten_env.log_info("receive 1 cmd result") elif self.__counter == 2: assert result.get_is_final() is True - print(f"{self.name} receive 2 cmd result") + ten_env.log_info("receive 2 cmd result") respCmd = CmdResult.create(StatusCode.OK) respCmd.set_property_string("detail", "nbnb") ten_env.return_result(respCmd, receivedCmd) def on_cmd(self, ten_env: TenEnv, cmd: Cmd) -> None: - print(f"{self.name} on_cmd") - cmd_json = cmd.to_json() - print(f"{self.name} on_cmd json: {cmd_json}") + ten_env.log_debug(f"on_cmd json: {cmd_json}") if self.name == "default_extension_python_1": new_cmd = Cmd.create("hello") @@ -49,12 +47,12 @@ def on_cmd(self, ten_env: TenEnv, cmd: Cmd) -> None: new_cmd, lambda ten, result: self.check_hello(ten, result, cmd) ) elif self.name == "default_extension_python_2": - print(f"{self.name} create respCmd 1") + ten_env.log_info("create respCmd 1") respCmd = CmdResult.create(StatusCode.OK) # The following line is the key. respCmd.set_is_final(False) ten_env.return_result(respCmd, cmd) - print(f"{self.name} create respCmd 2") + ten_env.log_info("create respCmd 2") respCmd = CmdResult.create(StatusCode.OK) ten_env.return_result(respCmd, cmd)