MCPcopy Create free account
hub / github.com/davisking/dlib / global_data

Method global_data

dlib/logger/logger_kernel_1.cpp:124–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122// ----------------------------------------------------------------------------------------
123
124 logger::global_data::
125 global_data(
126 ) :
127 next_thread_name(1)
128 {
129 // make sure the main program thread always has id 0. Since there is
130 // a global logger object declared in this file we should expect that
131 // the global_data object will be initialized in the main program thread
132 // so if we call get_thread_id() now we should get the main thread id.
133 thread_id_type main_id = get_thread_id();
134 uint64 id_zero = 0;
135 thread_names.add(main_id,id_zero);
136
137 // set up the defaults
138 auto_flush_table.val = true;
139 streambuf_table.val = std::cout.rdbuf();
140 header_table.val = print_default_logger_header;
141
142 // also allocate an initial buffer for hook based logging
143 hookbuf.buffer.reserve(1000);
144 }
145
146 logger::global_data::level_container::
147 level_container (

Callers

nothing calls this directly

Calls 3

reserveMethod · 0.80
get_thread_idFunction · 0.50
addMethod · 0.45

Tested by

no test coverage detected