Document of c-modernization-kit (porter) 1.0.0
Loading...
Searching...
No Matches
potrLog.h File Reference

porter 内部ログマクロ定義ヘッダー。 More...

#include <porter_type.h>
Include dependency graph for potrLog.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define POTR_LOG(level, ...)
 porter 内部ログ出力マクロ。

Functions

void potr_log_write (PotrLogLevel level, const char *file, int line, const char *fmt,...)
 ログメッセージを書き込みます (内部関数)。

Detailed Description

porter 内部ログマクロ定義ヘッダー。

Author
c-modernization-kit sample team
Date
2026/03/09
Version
1.0.0

porter ライブラリ内部でのみ使用するログ出力マクロを定義します。
ライブラリ外部には公開しません。
公開 API は porter.hpotrLogConfig() を参照してください。

使用方法:

POTR_LOG(POTR_TRACE_INFO, "service_id=%" PRId64 " opened", service_id);
POTR_LOG(POTR_TRACE_ERROR, "socket bind failed: port=%u", port);
POTR_LOG(POTR_TRACE_VERBOSE, "PING sent: seq=%u", seq);
@ POTR_TRACE_ERROR
エラー。操作の失敗を記録。TRACE_LV_ERROR (1) と同値。
@ POTR_TRACE_INFO
情報。TRACE_LV_INFO (3) と同値。
@ POTR_TRACE_VERBOSE
詳細情報 (デバッグ)。TRACE_LV_VERBOSE (4) と同値。
#define POTR_LOG(level,...)
porter 内部ログ出力マクロ。
Definition potrLog.h:68

Definition in file potrLog.h.

Macro Definition Documentation

◆ POTR_LOG

#define POTR_LOG ( level,
... )
Value:
potr_log_write((level), __FILE__, __LINE__, __VA_ARGS__)
void potr_log_write(PotrLogLevel level, const char *file, int line, const char *fmt,...)
ログメッセージを書き込みます (内部関数)。
Definition potrLog.c:128

porter 内部ログ出力マクロ。

FILELINE を自動付加して potr_log_write() を呼び出します。
設定レベルより低いメッセージは potr_log_write() 冒頭で早期リターンします。

POTR_LOG(POTR_TRACE_INFO, "potrOpenService: service_id=%" PRId64 "", service_id);
POTR_LOG(POTR_TRACE_WARNING, "NACK received: seq=%u", seq);
POTR_LOG(POTR_TRACE_ERROR, "socket() failed");
@ POTR_TRACE_WARNING
警告。回復可能な異常を記録。TRACE_LV_WARNING (2) と同値。

Definition at line 68 of file potrLog.h.

Referenced by apply_service_kv(), check_and_update_session(), check_health_timeout(), check_reorder_timeout(), comm_recv_thread_start(), config_load_global(), config_load_service(), connect_thread_func(), drain_recv_window(), flush_packed(), flush_packed_peer(), health_thread_func(), n1_check_health_timeout(), n1_notify_health_alive(), n1_process_outer_pkt(), n1_recv_deliver(), n1_update_path_recv(), notify_connected_tcp(), notify_health_alive(), open_socket_tcp_sender(), peer_create(), peer_free(), peer_path_clear(), peer_table_destroy(), peer_table_init(), potr_connect_thread_start(), potr_connect_thread_stop(), potr_health_thread_start(), potr_tcp_health_thread_start(), potrCloseService(), potrDisconnectPeer(), potrOpenService(), potrOpenServiceFromConfig(), potrSend(), process_outer_pkt(), raw_session_disconnect(), receiver_accept_loop(), recv_deliver(), recv_thread_func(), reset_all_paths_disconnected(), send_ping_reply(), sender_connect_loop(), start_connected_threads(), tcp_connect_with_timeout(), tcp_health_thread_func(), tcp_recv_thread_func(), and tcp_recv_thread_start().

Function Documentation

◆ potr_log_write()

void potr_log_write ( PotrLogLevel level,
const char * file,
int line,
const char * fmt,
... )

ログメッセージを書き込みます (内部関数)。

Parameters
[in]levelログレベル。
[in]fileソースファイル名 (FILE)。
[in]line行番号 (LINE)。
[in]fmtprintf 形式のフォーマット文字列。
[in]...フォーマット引数。

g_log_level より低いレベルのメッセージは無視されます (高速パス)。
本関数を直接呼び出さず、POTR_LOG マクロを使用してください。

Definition at line 128 of file potrLog.c.

References log_basename(), and s_trace.

Here is the call graph for this function: