Files
ortools-clone/docs/cpp/raw__logging_8cc_source.html
2021-01-26 11:34:47 +01:00

263 lines
38 KiB
HTML

<!-- HTML header for doxygen 1.8.18-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OR-Tools: raw_logging.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="styleSheet.tmp.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="orLogo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">OR-Tools
&#160;<span id="projectnumber">8.2</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('raw__logging_8cc_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">raw_logging.cc</div> </div>
</div><!--header-->
<div class="contents">
<a href="raw__logging_8cc.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">// Copyright 2010-2018 Google LLC</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">// You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment">// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment">// See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment">// limitations under the License.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160; </div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="raw__logging_8h.html">ortools/base/raw_logging.h</a>&quot;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160; </div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="preprocessor">#include &lt;errno.h&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="preprocessor">#include &lt;fcntl.h&gt;</span> <span class="comment">// for open()</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#include &lt;stdarg.h&gt;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#include &lt;time.h&gt;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160; </div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &quot;absl/base/macros.h&quot;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &quot;absl/debugging/stacktrace.h&quot;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="commandlineflags_8h.html">ortools/base/commandlineflags.h</a>&quot;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="base_2logging_8h.html">ortools/base/logging.h</a>&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="logging__utilities_8h.html">ortools/base/logging_utilities.h</a>&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#if !defined(_MSC_VER)</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &lt;sys/syscall.h&gt;</span> <span class="comment">// for syscall()</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="raw__logging_8cc.html#ae5604ff6b1ea302304b59ebd9acd4ced"> 30</a></span>&#160;<span class="preprocessor">#define safe_write(fd, s, len) syscall(SYS_write, fd, s, len)</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="io_8h.html">io.h</a>&gt;</span> <span class="comment">// _write()</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="comment">// Not so safe, but what can you do?</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#define safe_write(fd, s, len) _write(fd, s, len)</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; </div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">#if defined(_MSC_VER) &amp;&amp; !defined(__MINGW32__)</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="keyword">enum</span> { STDIN_FILENO = 0, STDOUT_FILENO = 1, STDERR_FILENO = 2 };</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacegoogle.html">google</a> {</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="comment">// CAVEAT: vsnprintf called from *DoRawLog below has some (exotic) code paths</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="comment">// that invoke malloc() and getenv() that might acquire some locks.</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="comment">// If this becomes a problem we should reimplement a subset of vsnprintf</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="comment">// that does not need locks and malloc.</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; </div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="comment">// Helper for RawLog__ below.</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="comment">// *DoRawLog writes to *buf of *size and move them past the written portion.</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="comment">// It returns true iff there was no overflow or error.</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="namespacegoogle.html#aca38b48e705eea950d4c1a0c4f0864d0"> 51</a></span>&#160;<span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="namespacegoogle.html#aca38b48e705eea950d4c1a0c4f0864d0">DoRawLog</a>(<span class="keywordtype">char</span>** buf, <span class="keywordtype">int</span>* size, <span class="keyword">const</span> <span class="keywordtype">char</span>* format, ...) {</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; va_list ap;</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; va_start(ap, format);</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keywordtype">int</span> n = vsnprintf(*buf, *size, format, ap);</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; va_end(ap);</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keywordflow">if</span> (n &lt; 0 || n &gt; *size) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; *size -= n;</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; *buf += n;</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;}</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="comment">// Helper for RawLog__ below.</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="namespacegoogle.html#a89a5e2b8f6c3d8589bb994cbbc033bb6"> 63</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="namespacegoogle.html#a89a5e2b8f6c3d8589bb994cbbc033bb6">VADoRawLog</a>(<span class="keywordtype">char</span>** buf, <span class="keywordtype">int</span>* size, <span class="keyword">const</span> <span class="keywordtype">char</span>* format,</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; va_list ap) {</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keywordtype">int</span> n = vsnprintf(*buf, *size, format, ap);</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordflow">if</span> (n &lt; 0 || n &gt; *size) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; *size -= n;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; *buf += n;</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;}</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="namespacegoogle.html#abaf22b53e0939d4028fac0117e1c5ba3"> 72</a></span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="namespacegoogle.html#abaf22b53e0939d4028fac0117e1c5ba3">kLogBufSize</a> = 3000;</div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="namespacegoogle.html#a75f47cfa66597358ed09762e5b21c462"> 73</a></span>&#160;<span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="namespacegoogle.html#a75f47cfa66597358ed09762e5b21c462">crashed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="namespacegoogle.html#ada71130f5f3b55dbec713c608b9e5447"> 74</a></span>&#160;<span class="keyword">static</span> <a class="code" href="structgoogle_1_1logging__internal_1_1_crash_reason.html">logging_internal::CrashReason</a> <a class="code" href="namespacegoogle.html#ada71130f5f3b55dbec713c608b9e5447">crash_reason</a>;</div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="namespacegoogle.html#ac8976e82fa12927de3d5a369f5c08ebb"> 75</a></span>&#160;<span class="keyword">static</span> <span class="keywordtype">char</span> <a class="code" href="namespacegoogle.html#ac8976e82fa12927de3d5a369f5c08ebb">crash_buf</a>[<a class="code" href="namespacegoogle.html#abaf22b53e0939d4028fac0117e1c5ba3">kLogBufSize</a> + 1] = {0}; <span class="comment">// Will end in &#39;\0&#39;</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="namespacegoogle.html#a7643b964fd19d9a3a932496e531b70be"> 77</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacegoogle.html#a7643b964fd19d9a3a932496e531b70be">RawLog__</a>(<a class="code" href="log__severity_8h.html#a88e450ea80e6caaddd7d4ad0864b651d">LogSeverity</a> severity, <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="namespacefile.html">file</a>, <span class="keywordtype">int</span> line,</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* format, ...) {</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">if</span> (!(absl::GetFlag(FLAGS_logtostderr) ||</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; severity &gt;= absl::GetFlag(FLAGS_stderrthreshold) ||</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; absl::GetFlag(FLAGS_alsologtostderr) ||</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; !<a class="code" href="namespacegoogle_1_1logging__internal.html#aa3792ddc75755350b76a7b196369eda3">logging_internal::IsGoogleLoggingInitialized</a>())) {</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordflow">return</span>; <span class="comment">// this stderr log message is suppressed</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; }</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="comment">// can&#39;t call localtime_r here: it can allocate</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordtype">char</span> buffer[<a class="code" href="namespacegoogle.html#abaf22b53e0939d4028fac0117e1c5ba3">kLogBufSize</a>];</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keywordtype">char</span>* buf = buffer;</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keywordtype">int</span> size = <span class="keyword">sizeof</span>(buffer);</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="comment">// NOTE: this format should match the specification in base/logging.h</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <a class="code" href="namespacegoogle.html#aca38b48e705eea950d4c1a0c4f0864d0">DoRawLog</a>(&amp;buf, &amp;size, <span class="stringliteral">&quot;%c0000 00:00:00.000000 %5u %s:%d] RAW: &quot;</span>,</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <a class="code" href="namespacegoogle.html#a85e200fc02aea6b6196148088fa23c3e">LogSeverityNames</a>[severity][0], <a class="code" href="namespacegoogle_1_1logging__internal.html#aa5bcfef09a25e887a41b29f9ba9be836">logging_internal::GetTID</a>(),</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <a class="code" href="namespacegoogle_1_1logging__internal.html#af7c52c82f4832b6bfabe0c86a0c19d2e">logging_internal::const_basename</a>(<span class="keyword">const_cast&lt;</span><span class="keywordtype">char</span>*<span class="keyword">&gt;</span>(<a class="code" href="namespacefile.html">file</a>)), line);</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; </div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="comment">// Record the position and size of the buffer after the prefix</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* msg_start = buf;</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> msg_size = size;</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; </div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; va_list ap;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; va_start(ap, format);</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keywordtype">bool</span> no_chop = <a class="code" href="namespacegoogle.html#a89a5e2b8f6c3d8589bb994cbbc033bb6">VADoRawLog</a>(&amp;buf, &amp;size, format, ap);</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; va_end(ap);</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keywordflow">if</span> (no_chop) {</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <a class="code" href="namespacegoogle.html#aca38b48e705eea950d4c1a0c4f0864d0">DoRawLog</a>(&amp;buf, &amp;size, <span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <a class="code" href="namespacegoogle.html#aca38b48e705eea950d4c1a0c4f0864d0">DoRawLog</a>(&amp;buf, &amp;size, <span class="stringliteral">&quot;RAW_LOG ERROR: The Message was too long!\n&quot;</span>);</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; }</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="comment">// We make a raw syscall to write directly to the stderr file descriptor,</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="comment">// avoiding FILE buffering (to avoid invoking malloc()), and bypassing</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="comment">// libc (to side-step any libc interception).</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="comment">// We write just once to avoid races with other invocations of RawLog__.</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <a class="code" href="raw__logging_8cc.html#ae5604ff6b1ea302304b59ebd9acd4ced">safe_write</a>(STDERR_FILENO, buffer, strlen(buffer));</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordflow">if</span> (severity == <a class="code" href="namespacegoogle.html#ac452c4c8ec1cbc24dd074e260aa0b617">GLOG_FATAL</a>) {</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keywordflow">if</span> (!<a class="code" href="namespacegoogle_1_1logging__internal.html#ae48c15a4cb2d1c03ec053b1a20fcde98">logging_internal::sync_val_compare_and_swap</a>(&amp;<a class="code" href="namespacegoogle.html#a75f47cfa66597358ed09762e5b21c462">crashed</a>, <span class="keyword">false</span>, <span class="keyword">true</span>)) {</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <a class="code" href="namespacegoogle.html#ada71130f5f3b55dbec713c608b9e5447">crash_reason</a>.<a class="code" href="structgoogle_1_1logging__internal_1_1_crash_reason.html#a7efa5e9c7494c7d4586359300221aa5d">filename</a> = <a class="code" href="namespacefile.html">file</a>;</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <a class="code" href="namespacegoogle.html#ada71130f5f3b55dbec713c608b9e5447">crash_reason</a>.<a class="code" href="structgoogle_1_1logging__internal_1_1_crash_reason.html#ada7b81cc6d5bbe25b92c0162697e0f58">line_number</a> = line;</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; memcpy(<a class="code" href="namespacegoogle.html#ac8976e82fa12927de3d5a369f5c08ebb">crash_buf</a>, msg_start, msg_size); <span class="comment">// Don&#39;t include prefix</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <a class="code" href="namespacegoogle.html#ada71130f5f3b55dbec713c608b9e5447">crash_reason</a>.<a class="code" href="structgoogle_1_1logging__internal_1_1_crash_reason.html#a254bf0858da09c96a48daf64404eb4f8">message</a> = <a class="code" href="namespacegoogle.html#ac8976e82fa12927de3d5a369f5c08ebb">crash_buf</a>;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <a class="code" href="namespacegoogle.html#ada71130f5f3b55dbec713c608b9e5447">crash_reason</a>.<a class="code" href="structgoogle_1_1logging__internal_1_1_crash_reason.html#acb5ba97551079e0b072c62c21d784ac5">depth</a> = absl::GetStackTrace(</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <a class="code" href="namespacegoogle.html#ada71130f5f3b55dbec713c608b9e5447">crash_reason</a>.<a class="code" href="structgoogle_1_1logging__internal_1_1_crash_reason.html#a155108dfb07b71f192a35ce75199ed33">stack</a>, ABSL_ARRAYSIZE(<a class="code" href="namespacegoogle.html#ada71130f5f3b55dbec713c608b9e5447">crash_reason</a>.<a class="code" href="structgoogle_1_1logging__internal_1_1_crash_reason.html#a155108dfb07b71f192a35ce75199ed33">stack</a>), 1);</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <a class="code" href="namespacegoogle_1_1logging__internal.html#a88dfce8ed7ee385f0238de1387ea7845">SetCrashReason</a>(&amp;<a class="code" href="namespacegoogle.html#ada71130f5f3b55dbec713c608b9e5447">crash_reason</a>);</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; }</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <a class="code" href="classgoogle_1_1_log_message.html#aeb92d4addb41255c9732cacfcb54f795">LogMessage::Fail</a>(); <span class="comment">// abort()</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; }</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;}</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;} <span class="comment">// namespace google</span></div>
<div class="ttc" id="abase_2logging_8h_html"><div class="ttname"><a href="base_2logging_8h.html">logging.h</a></div></div>
<div class="ttc" id="aclassgoogle_1_1_log_message_html_aeb92d4addb41255c9732cacfcb54f795"><div class="ttname"><a href="classgoogle_1_1_log_message.html#aeb92d4addb41255c9732cacfcb54f795">google::LogMessage::Fail</a></div><div class="ttdeci">static void ATTRIBUTE_NORETURN Fail()</div><div class="ttdef"><b>Definition:</b> <a href="base_2logging_8cc_source.html#l01392">base/logging.cc:1392</a></div></div>
<div class="ttc" id="acommandlineflags_8h_html"><div class="ttname"><a href="commandlineflags_8h.html">commandlineflags.h</a></div></div>
<div class="ttc" id="aio_8h_html"><div class="ttname"><a href="io_8h.html">io.h</a></div></div>
<div class="ttc" id="alog__severity_8h_html_a88e450ea80e6caaddd7d4ad0864b651d"><div class="ttname"><a href="log__severity_8h.html#a88e450ea80e6caaddd7d4ad0864b651d">LogSeverity</a></div><div class="ttdeci">int LogSeverity</div><div class="ttdef"><b>Definition:</b> <a href="log__severity_8h_source.html#l00022">log_severity.h:22</a></div></div>
<div class="ttc" id="alogging__utilities_8h_html"><div class="ttname"><a href="logging__utilities_8h.html">logging_utilities.h</a></div></div>
<div class="ttc" id="anamespacefile_html"><div class="ttname"><a href="namespacefile.html">file</a></div><div class="ttdef"><b>Definition:</b> <a href="file_8cc_source.html#l00141">file.cc:141</a></div></div>
<div class="ttc" id="anamespacegoogle_1_1logging__internal_html_a88dfce8ed7ee385f0238de1387ea7845"><div class="ttname"><a href="namespacegoogle_1_1logging__internal.html#a88dfce8ed7ee385f0238de1387ea7845">google::logging_internal::SetCrashReason</a></div><div class="ttdeci">void SetCrashReason(const CrashReason *r)</div><div class="ttdef"><b>Definition:</b> <a href="logging__utilities_8cc_source.html#l00299">logging_utilities.cc:299</a></div></div>
<div class="ttc" id="anamespacegoogle_1_1logging__internal_html_aa3792ddc75755350b76a7b196369eda3"><div class="ttname"><a href="namespacegoogle_1_1logging__internal.html#aa3792ddc75755350b76a7b196369eda3">google::logging_internal::IsGoogleLoggingInitialized</a></div><div class="ttdeci">bool IsGoogleLoggingInitialized()</div><div class="ttdef"><b>Definition:</b> <a href="logging__utilities_8cc_source.html#l00223">logging_utilities.cc:223</a></div></div>
<div class="ttc" id="anamespacegoogle_1_1logging__internal_html_aa5bcfef09a25e887a41b29f9ba9be836"><div class="ttname"><a href="namespacegoogle_1_1logging__internal.html#aa5bcfef09a25e887a41b29f9ba9be836">google::logging_internal::GetTID</a></div><div class="ttdeci">unsigned int GetTID()</div><div class="ttdef"><b>Definition:</b> <a href="logging__utilities_8cc_source.html#l00227">logging_utilities.cc:227</a></div></div>
<div class="ttc" id="anamespacegoogle_1_1logging__internal_html_ae48c15a4cb2d1c03ec053b1a20fcde98"><div class="ttname"><a href="namespacegoogle_1_1logging__internal.html#ae48c15a4cb2d1c03ec053b1a20fcde98">google::logging_internal::sync_val_compare_and_swap</a></div><div class="ttdeci">T sync_val_compare_and_swap(T *ptr, T oldval, T newval)</div><div class="ttdef"><b>Definition:</b> <a href="logging__utilities_8h_source.html#l00050">logging_utilities.h:50</a></div></div>
<div class="ttc" id="anamespacegoogle_1_1logging__internal_html_af7c52c82f4832b6bfabe0c86a0c19d2e"><div class="ttname"><a href="namespacegoogle_1_1logging__internal.html#af7c52c82f4832b6bfabe0c86a0c19d2e">google::logging_internal::const_basename</a></div><div class="ttdeci">const char * const_basename(const char *filepath)</div><div class="ttdef"><b>Definition:</b> <a href="logging__utilities_8cc_source.html#l00238">logging_utilities.cc:238</a></div></div>
<div class="ttc" id="anamespacegoogle_html"><div class="ttname"><a href="namespacegoogle.html">google</a></div><div class="ttdef"><b>Definition:</b> <a href="log__severity_8h_source.html#l00024">log_severity.h:24</a></div></div>
<div class="ttc" id="anamespacegoogle_html_a75f47cfa66597358ed09762e5b21c462"><div class="ttname"><a href="namespacegoogle.html#a75f47cfa66597358ed09762e5b21c462">google::crashed</a></div><div class="ttdeci">static bool crashed</div><div class="ttdef"><b>Definition:</b> <a href="raw__logging_8cc_source.html#l00073">raw_logging.cc:73</a></div></div>
<div class="ttc" id="anamespacegoogle_html_a7643b964fd19d9a3a932496e531b70be"><div class="ttname"><a href="namespacegoogle.html#a7643b964fd19d9a3a932496e531b70be">google::RawLog__</a></div><div class="ttdeci">void RawLog__(LogSeverity severity, const char *file, int line, const char *format,...)</div><div class="ttdef"><b>Definition:</b> <a href="raw__logging_8cc_source.html#l00077">raw_logging.cc:77</a></div></div>
<div class="ttc" id="anamespacegoogle_html_a85e200fc02aea6b6196148088fa23c3e"><div class="ttname"><a href="namespacegoogle.html#a85e200fc02aea6b6196148088fa23c3e">google::LogSeverityNames</a></div><div class="ttdeci">GOOGLE_GLOG_DLL_DECL const char *const LogSeverityNames[NUM_SEVERITIES]</div><div class="ttdef"><b>Definition:</b> <a href="base_2logging_8cc_source.html#l00358">base/logging.cc:358</a></div></div>
<div class="ttc" id="anamespacegoogle_html_a89a5e2b8f6c3d8589bb994cbbc033bb6"><div class="ttname"><a href="namespacegoogle.html#a89a5e2b8f6c3d8589bb994cbbc033bb6">google::VADoRawLog</a></div><div class="ttdeci">static bool VADoRawLog(char **buf, int *size, const char *format, va_list ap)</div><div class="ttdef"><b>Definition:</b> <a href="raw__logging_8cc_source.html#l00063">raw_logging.cc:63</a></div></div>
<div class="ttc" id="anamespacegoogle_html_abaf22b53e0939d4028fac0117e1c5ba3"><div class="ttname"><a href="namespacegoogle.html#abaf22b53e0939d4028fac0117e1c5ba3">google::kLogBufSize</a></div><div class="ttdeci">static const int kLogBufSize</div><div class="ttdef"><b>Definition:</b> <a href="raw__logging_8cc_source.html#l00072">raw_logging.cc:72</a></div></div>
<div class="ttc" id="anamespacegoogle_html_ac452c4c8ec1cbc24dd074e260aa0b617"><div class="ttname"><a href="namespacegoogle.html#ac452c4c8ec1cbc24dd074e260aa0b617">google::GLOG_FATAL</a></div><div class="ttdeci">const int GLOG_FATAL</div><div class="ttdef"><b>Definition:</b> <a href="log__severity_8h_source.html#l00025">log_severity.h:25</a></div></div>
<div class="ttc" id="anamespacegoogle_html_ac8976e82fa12927de3d5a369f5c08ebb"><div class="ttname"><a href="namespacegoogle.html#ac8976e82fa12927de3d5a369f5c08ebb">google::crash_buf</a></div><div class="ttdeci">static char crash_buf[kLogBufSize+1]</div><div class="ttdef"><b>Definition:</b> <a href="raw__logging_8cc_source.html#l00075">raw_logging.cc:75</a></div></div>
<div class="ttc" id="anamespacegoogle_html_aca38b48e705eea950d4c1a0c4f0864d0"><div class="ttname"><a href="namespacegoogle.html#aca38b48e705eea950d4c1a0c4f0864d0">google::DoRawLog</a></div><div class="ttdeci">static bool DoRawLog(char **buf, int *size, const char *format,...)</div><div class="ttdef"><b>Definition:</b> <a href="raw__logging_8cc_source.html#l00051">raw_logging.cc:51</a></div></div>
<div class="ttc" id="anamespacegoogle_html_ada71130f5f3b55dbec713c608b9e5447"><div class="ttname"><a href="namespacegoogle.html#ada71130f5f3b55dbec713c608b9e5447">google::crash_reason</a></div><div class="ttdeci">static logging_internal::CrashReason crash_reason</div><div class="ttdef"><b>Definition:</b> <a href="base_2logging_8cc_source.html#l01048">base/logging.cc:1048</a></div></div>
<div class="ttc" id="araw__logging_8cc_html_ae5604ff6b1ea302304b59ebd9acd4ced"><div class="ttname"><a href="raw__logging_8cc.html#ae5604ff6b1ea302304b59ebd9acd4ced">safe_write</a></div><div class="ttdeci">#define safe_write(fd, s, len)</div><div class="ttdef"><b>Definition:</b> <a href="raw__logging_8cc_source.html#l00030">raw_logging.cc:30</a></div></div>
<div class="ttc" id="araw__logging_8h_html"><div class="ttname"><a href="raw__logging_8h.html">raw_logging.h</a></div></div>
<div class="ttc" id="astructgoogle_1_1logging__internal_1_1_crash_reason_html"><div class="ttname"><a href="structgoogle_1_1logging__internal_1_1_crash_reason.html">google::logging_internal::CrashReason</a></div><div class="ttdef"><b>Definition:</b> <a href="logging__utilities_8h_source.html#l00064">logging_utilities.h:64</a></div></div>
<div class="ttc" id="astructgoogle_1_1logging__internal_1_1_crash_reason_html_a155108dfb07b71f192a35ce75199ed33"><div class="ttname"><a href="structgoogle_1_1logging__internal_1_1_crash_reason.html#a155108dfb07b71f192a35ce75199ed33">google::logging_internal::CrashReason::stack</a></div><div class="ttdeci">void * stack[32]</div><div class="ttdef"><b>Definition:</b> <a href="logging__utilities_8h_source.html#l00073">logging_utilities.h:73</a></div></div>
<div class="ttc" id="astructgoogle_1_1logging__internal_1_1_crash_reason_html_a254bf0858da09c96a48daf64404eb4f8"><div class="ttname"><a href="structgoogle_1_1logging__internal_1_1_crash_reason.html#a254bf0858da09c96a48daf64404eb4f8">google::logging_internal::CrashReason::message</a></div><div class="ttdeci">const char * message</div><div class="ttdef"><b>Definition:</b> <a href="logging__utilities_8h_source.html#l00069">logging_utilities.h:69</a></div></div>
<div class="ttc" id="astructgoogle_1_1logging__internal_1_1_crash_reason_html_a7efa5e9c7494c7d4586359300221aa5d"><div class="ttname"><a href="structgoogle_1_1logging__internal_1_1_crash_reason.html#a7efa5e9c7494c7d4586359300221aa5d">google::logging_internal::CrashReason::filename</a></div><div class="ttdeci">const char * filename</div><div class="ttdef"><b>Definition:</b> <a href="logging__utilities_8h_source.html#l00067">logging_utilities.h:67</a></div></div>
<div class="ttc" id="astructgoogle_1_1logging__internal_1_1_crash_reason_html_acb5ba97551079e0b072c62c21d784ac5"><div class="ttname"><a href="structgoogle_1_1logging__internal_1_1_crash_reason.html#acb5ba97551079e0b072c62c21d784ac5">google::logging_internal::CrashReason::depth</a></div><div class="ttdeci">int depth</div><div class="ttdef"><b>Definition:</b> <a href="logging__utilities_8h_source.html#l00074">logging_utilities.h:74</a></div></div>
<div class="ttc" id="astructgoogle_1_1logging__internal_1_1_crash_reason_html_ada7b81cc6d5bbe25b92c0162697e0f58"><div class="ttname"><a href="structgoogle_1_1logging__internal_1_1_crash_reason.html#ada7b81cc6d5bbe25b92c0162697e0f58">google::logging_internal::CrashReason::line_number</a></div><div class="ttdeci">int line_number</div><div class="ttdef"><b>Definition:</b> <a href="logging__utilities_8h_source.html#l00068">logging_utilities.h:68</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.18-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_a7cc1eeded8f693d0da6c729bc88c45a.html">ortools</a></li><li class="navelem"><a class="el" href="dir_8f9dc966244f4c6e9b2fa0dee1e4ef1a.html">base</a></li><li class="navelem"><a class="el" href="raw__logging_8cc.html">raw_logging.cc</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>