mod_servlet
C++Servlets
|
Logger with specific logging LEVEL
to use.
More...
#include <logger.h>
Public Member Functions | |
template<typename T > | |
level_logger & | operator<< (const T &value) |
Generic streaming output operator. More... | |
level_logger & | operator<< (std::ostream &(*manip)(std::ostream &)) |
Streaming output operator for manipulators (e.g. More... | |
level_logger & | operator<< (char ch) |
Streaming output operator for char . More... | |
level_logger & | operator<< (char16_t ch) |
Streaming output operator for char16_t . More... | |
level_logger & | operator<< (const char16_t *str) |
Writes C-style array of character of type char16_t to the output. More... | |
level_logger & | operator<< (const std::u16string &str) |
Writes string of character of type char16_t to the output. More... | |
level_logger & | operator<< (char32_t ch) |
Streaming output operator for char32_t . More... | |
level_logger & | operator<< (const char32_t *str) |
Writes C-style array of character of type char32_t to the output. More... | |
level_logger & | operator<< (const std::u32string &str) |
Writes string of character of type char32_t to the output. More... | |
level_logger & | operator<< (wchar_t ch) |
Streaming output operator for wchar_t . More... | |
level_logger & | operator<< (const wchar_t *str) |
Writes C-style array of character of type wchar_t to the output. More... | |
level_logger & | operator<< (const std::wstring &str) |
Writes string of wide characters to the output. More... | |
level_logger & | flush () |
Flushes underlying stream. More... | |
level_logger & | put (char ch) |
Puts a character of type wchar to output if the logging level is sufficient. More... | |
level_logger & | put (char16_t ch) |
Puts a character of type char16_t to output if the logging level is sufficient. More... | |
level_logger & | put (char32_t ch) |
Puts a character of type char32_t to output if the logging level is sufficient. More... | |
level_logger & | put (wchar_t ch) |
Puts a character of type wchar_t to output if the logging level is sufficient. More... | |
level_logger & | write (const char *s, std::streamsize n) |
Writes first n characters of array s to the output stream if the logging level is sufficient. More... | |
Friends | |
class | logger |
Logger with specific logging LEVEL
to use.
This logger has overloaded streaming output operators which will output the object into the underlying stream. It also has the special treatment for international characters and UTF strings. It convers UTF-16
and UTF-32
strings into UTF_8
and prints them.
For example the following output will be hadled correctly:
|
inline |
Flushes underlying stream.
|
inline |
Generic streaming output operator.
The value
will be passed to actual output stream if the logging level is sufficient for the object to be printed.
T | type of the value to send to a stream. |
value | object to print. |
level_logger& servlet::logging::level_logger::operator<< | ( | std::ostream &(*)(std::ostream &) | manip | ) |
Streaming output operator for manipulators (e.g.
std::endl
).
manip | mainpulator to print. |
level_logger& servlet::logging::level_logger::operator<< | ( | char | ch | ) |
Streaming output operator for char
.
This method does nothing if the logging level is not sufficient.
ch | character to print. |
level_logger& servlet::logging::level_logger::operator<< | ( | char16_t | ch | ) |
Streaming output operator for char16_t
.
This method does nothing if the logging level is not sufficient.
ch | character to print. |
level_logger& servlet::logging::level_logger::operator<< | ( | const char16_t * | str | ) |
Writes C-style array of character of type char16_t
to the output.
This method does nothing if the logging level is not sufficient.
This string is handled as string of UTF-16
characters. They are converted to UTF-8
before being passed to the output stream.
str | C-array of characters to write to the output stream |
level_logger& servlet::logging::level_logger::operator<< | ( | const std::u16string & | str | ) |
Writes string of character of type char16_t
to the output.
This method does nothing if the logging level is not sufficient.
This string is handled as string of UTF-16
characters. They are converted to UTF-8
before being passed to the output stream.
str | UTF-16 string to write to the output stream |
level_logger& servlet::logging::level_logger::operator<< | ( | char32_t | ch | ) |
Streaming output operator for char32_t
.
This method does nothing if the logging level is not sufficient.
ch | character to print. |
level_logger& servlet::logging::level_logger::operator<< | ( | const char32_t * | str | ) |
Writes C-style array of character of type char32_t
to the output.
This method does nothing if the logging level is not sufficient.
This string is handled as string of UTF-32
characters. They are converted to UTF-8
before being passed to the output stream.
str | C-array of characters to write to the output stream |
level_logger& servlet::logging::level_logger::operator<< | ( | const std::u32string & | str | ) |
Writes string of character of type char32_t
to the output.
This method does nothing if the logging level is not sufficient.
This string is handled as string of UTF-32
characters. They are converted to UTF-8
before being passed to the output stream.
str | UTF-32 string to write to the output stream |
level_logger& servlet::logging::level_logger::operator<< | ( | wchar_t | ch | ) |
Streaming output operator for wchar_t
.
This method does nothing if the logging level is not sufficient.
ch | character to print. |
level_logger& servlet::logging::level_logger::operator<< | ( | const wchar_t * | str | ) |
Writes C-style array of character of type wchar_t
to the output.
This method does nothing if the logging level is not sufficient.
This string is handled as string of wide characters. They are converted to UTF-8
before being passed to the output stream.
str | C-array of characters to write to the output stream |
level_logger& servlet::logging::level_logger::operator<< | ( | const std::wstring & | str | ) |
Writes string of wide characters to the output.
This method does nothing if the logging level is not sufficient.
This string is handled as string of wide characters. They are converted to UTF-8
before being passed to the output stream.
str | wchar_t string to write to the output stream |
|
inline |
Puts a character of type wchar
to output if the logging level is sufficient.
Otherwise does nothing.
ch | character to print. |
|
inline |
Puts a character of type char16_t
to output if the logging level is sufficient.
Otherwise does nothing.
ch | character to print. |
|
inline |
Puts a character of type char32_t
to output if the logging level is sufficient.
Otherwise does nothing.
ch | character to print. |
|
inline |
Puts a character of type wchar_t
to output if the logging level is sufficient.
Otherwise does nothing.
ch | character to print. |
level_logger& servlet::logging::level_logger::write | ( | const char * | s, |
std::streamsize | n | ||
) |
Writes first n
characters of array s
to the output stream if the logging level is sufficient.
s | Array of at least n characters. |
n | Number of characters to write. |