forked from irungentoo/toxcore
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Move tox_log_level out into its own file.
Perhaps we can reuse it in the logger.
- Loading branch information
Showing
7 changed files
with
88 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "tox_log_level.h" | ||
|
||
const char *tox_log_level_to_string(Tox_Log_Level value) | ||
{ | ||
switch (value) { | ||
case TOX_LOG_LEVEL_TRACE: | ||
return "TOX_LOG_LEVEL_TRACE"; | ||
|
||
case TOX_LOG_LEVEL_DEBUG: | ||
return "TOX_LOG_LEVEL_DEBUG"; | ||
|
||
case TOX_LOG_LEVEL_INFO: | ||
return "TOX_LOG_LEVEL_INFO"; | ||
|
||
case TOX_LOG_LEVEL_WARNING: | ||
return "TOX_LOG_LEVEL_WARNING"; | ||
|
||
case TOX_LOG_LEVEL_ERROR: | ||
return "TOX_LOG_LEVEL_ERROR"; | ||
} | ||
|
||
return "<invalid Tox_Log_Level>"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* SPDX-License-Identifier: GPL-3.0-or-later | ||
* Copyright © 2022-2024 The TokTok team. | ||
*/ | ||
|
||
#ifndef C_TOXCORE_TOXCORE_TOX_LOG_LEVEL_H | ||
#define C_TOXCORE_TOXCORE_TOX_LOG_LEVEL_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief Severity level of log messages. | ||
*/ | ||
typedef enum Tox_Log_Level { | ||
|
||
/** | ||
* Very detailed traces including all network activity. | ||
*/ | ||
TOX_LOG_LEVEL_TRACE, | ||
|
||
/** | ||
* Debug messages such as which port we bind to. | ||
*/ | ||
TOX_LOG_LEVEL_DEBUG, | ||
|
||
/** | ||
* Informational log messages such as video call status changes. | ||
*/ | ||
TOX_LOG_LEVEL_INFO, | ||
|
||
/** | ||
* Warnings about internal inconsistency or logic errors. | ||
*/ | ||
TOX_LOG_LEVEL_WARNING, | ||
|
||
/** | ||
* Severe unexpected errors caused by external or internal inconsistency. | ||
*/ | ||
TOX_LOG_LEVEL_ERROR, | ||
|
||
} Tox_Log_Level; | ||
|
||
const char *tox_log_level_to_string(Tox_Log_Level value); | ||
|
||
#ifdef __cplusplus | ||
} /* extern "C" */ | ||
#endif | ||
|
||
#endif /* C_TOXCORE_TOXCORE_TOX_LOG_LEVEL_H */ |