34 #if defined _SYSTEM_POSIX_ 36 #elif defined _SYSTEM_WIN32_ 40 # error "No ::icl_core::logging namespace implementation defined for this platform." 43 #if defined ICL_CORE_QT_SUPPORT 44 #include <QtCore/QString> 84 if (number_of_bytes + protected_buffer_size > writable_length)
86 if (writable_length > protected_buffer_size)
88 number_of_bytes = writable_length - protected_buffer_size;
97 m_write_index += number_of_bytes;
106 va_start(argptr, fmt);
110 if (bytes_printed >= 0)
112 if (
size_t(bytes_printed) > writable_length)
114 m_write_index += writable_length;
118 m_write_index += bytes_printed;
151 m_level(parent->m_initial_level),
164 char local_buffer[8];
165 size_t length =
os::snprintf(local_buffer, 8,
"%hu", static_cast<uint8_t>(value));
166 stream.
write(local_buffer, length);
172 char local_buffer[8];
173 size_t length =
os::snprintf(local_buffer, 8,
"%hu", value);
174 stream.
write(local_buffer, length);
180 char local_buffer[13];
181 size_t length =
os::snprintf(local_buffer, 13,
"%u", value);
182 stream.
write(local_buffer, length);
189 char local_buffer[13];
190 size_t length =
os::snprintf(local_buffer, 13,
"%lu", value);
191 stream.
write(local_buffer, length);
198 char local_buffer[23];
199 size_t length =
os::snprintf(local_buffer, 23,
"%llu", value);
200 stream.
write(local_buffer, length);
206 char local_buffer[8];
207 size_t length =
os::snprintf(local_buffer, 8,
"%hd", static_cast<int16_t>(value));
208 stream.
write(local_buffer, length);
214 char local_buffer[8];
215 size_t length =
os::snprintf(local_buffer, 8,
"%hd", value);
216 stream.
write(local_buffer, length);
222 char local_buffer[13];
223 size_t length =
os::snprintf(local_buffer, 13,
"%d", value);
224 stream.
write(local_buffer, length);
231 char local_buffer[13];
232 size_t length =
os::snprintf(local_buffer, 13,
"%ld", value);
233 stream.
write(local_buffer, length);
240 char local_buffer[23];
241 size_t length =
os::snprintf(local_buffer, 23,
"%lld", value);
242 stream.
write(local_buffer, length);
246 #ifdef _SYSTEM_DARWIN_ 249 char local_buffer[23];
250 size_t length =
os::snprintf(local_buffer, 23,
"%zu", value);
251 stream.
write(local_buffer, length);
258 stream.
write(text, strlen(text));
264 stream.
write(text.c_str(), text.size());
270 char local_buffer[100];
271 size_t length =
os::snprintf(local_buffer, 100,
"%f", value);
272 stream.
write(local_buffer, length);
280 stream.
write(
"True", 4);
284 stream.
write(
"False", 5);
291 char local_buffer[25];
292 size_t length =
os::snprintf(local_buffer, 25,
"%p", value);
293 stream.
write(local_buffer, length);
297 #ifndef _SYSTEM_WIN32_ 304 #if defined ICL_CORE_QT_SUPPORT 307 return operator << (stream, value.toLatin1().constData());
313 #ifdef _IC_BUILDER_DEPRECATED_STYLE_ 335 void ThreadStream::SetClassname(
const char *classname)
343 void ThreadStream::SetObjectname(
const char *objectname)
351 void ThreadStream::SetFilename(
const char *filename)
359 void ThreadStream::SetFunction(
const char *
function)
367 void ThreadStream::SetLine(
size_t line)
384 void ThreadStream::Write(
const char *
buffer,
size_t number_of_bytes,
385 size_t protected_buffer_size)
387 write(buffer, number_of_bytes, protected_buffer_size);
394 void ThreadStream::Printf(
const char *fmt, ...)
400 va_start(argptr, fmt);
404 if (bytes_printed >= 0)
406 if (
size_t(bytes_printed) > writable_length)
408 m_write_index += writable_length;
412 m_write_index += bytes_printed;
423 void ThreadStream::Flush()
ICL_CORE_OS_IMPL_NS::ThreadId ThreadId
void post()
Increments the semaphore.
void printf(const char *fmt,...)
void releaseThreadStream(icl_core::logging::ThreadStream *thread_stream)
Contains icl_logging::ThreadStream.
Contains ACE specific implementations of logging stream operators.
ThreadStream(LogStream *parent)
void * memcpy(void *dest, void *src, size_t count)
char m_classname[cDEFAULT_LOG_SIZE+1]
void changeLevel(icl_core::logging::LogLevel level)
const char * nameCStr() const
#define ICL_CORE_VC_DEPRECATE_STYLE_USE(arg)
void setFilename(const char *filename)
Contains a system independet PRINTF macro.
void setClassname(const char *classname)
unsigned __int64 uint64_t
icl_core::logging::LogLevel m_line_log_level
Implements a thread-safe logging framework.
ThreadStream & operator<<(ThreadStream &stream, const ThreadId &thread_id)
std::set< LogOutputStream * > m_output_stream_list
void setFunction(const char *function)
void write(const char *buffer, size_t number_of_bytes, size_t protected_buffer_size=1)
char m_filename[cDEFAULT_LOG_SIZE+1]
char m_data[cDEFAULT_LOG_SIZE+1]
char m_function[cDEFAULT_LOG_SIZE+1]
Definition of the implementation namespace for global functions.
char m_objectname[cDEFAULT_LOG_SIZE+1]
icl_core::logging::LogLevel m_level
int vsnprintf(char *buffer, size_t maxlen, const char *format, va_list argptr)
Contains global LXRT functions.
void setObjectname(const char *objectname)
Implements the actual logging for an individual thread.
void setLine(size_t line)
Contains icl_logging::LogStream.
void * memset(void *dest, int c, size_t count)
icl_core::logging::LogLevel getLogLevel() const
void setLineLogLevel(icl_core::logging::LogLevel line_log_level)
#define cDEFAULT_LOG_SIZE
ThreadStream & operator<<(ThreadStreamFunc func)
Contains icl_logging::LogOutputStream.
int snprintf(char *buffer, size_t maxlen, const char *format,...)