<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/16156">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">logging.h: define ansi color constants<br><br>It's hard to figure out what color logging categories have with those ANSI<br>color code strings. Instead, define these OSMO_LOGCOLOR_* constants.<br><br>Naming: commonly, the logging.h header has the "LOG" prefix in the name, but it<br>seems saner to include the OSMO_ prefix: it seems too likely that some<br>libosmocore user somewhere already has defined "LOGCOLOR_RED" somewhere.<br><br>Change-Id: I03b6b1f73ae7ee61d37ff921e071a3d0881d3e9a<br>---<br>M include/osmocom/core/logging.h<br>1 file changed, 18 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/56/16156/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h</span><br><span>index 139d291..0846c1b 100644</span><br><span>--- a/include/osmocom/core/logging.h</span><br><span>+++ b/include/osmocom/core/logging.h</span><br><span>@@ -127,6 +127,24 @@</span><br><span> #define DLRSPRO          -19     /*!< Osmocom Remote SIM Protocol */</span><br><span> #define OSMO_NUM_DLIB 19      /*!< Number of logging sub-systems in libraries */</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Colors that can be used in log_info_cat.color */</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_NORMAL NULL</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_RED "\033[1;31m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_GREEN "\033[1;32m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_YELLOW "\033[1;33m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_BLUE "\033[1;34m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_PURPLE "\033[1;35m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_CYAN "\033[1;36m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_DARKRED "\033[31m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_DARKGREEN "\033[32m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_DARKYELLOW "\033[33m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_DARKBLUE "\033[34m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_DARKPURPLE "\033[35m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_DARKCYAN "\033[36m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_DARKGREY "\033[1;30m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_GREY "\033[37m"</span><br><span style="color: hsl(120, 100%, 40%);">+#define OSMO_LOGCOLOR_BRIGHTWHITE "\033[1;37m"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*! Configuration of single log category / sub-system */</span><br><span> struct log_category {</span><br><span>   uint8_t loglevel;       /*!< configured log-level */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/16156">change 16156</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/16156"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I03b6b1f73ae7ee61d37ff921e071a3d0881d3e9a </div>
<div style="display:none"> Gerrit-Change-Number: 16156 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>