mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-02 11:16:34 -04:00
Improve debugabbility of JSON API
JSON API server uses standardized error handling based on std::error_condition for a few method, this improve debugabbility both from library size and from API client side JSON API auth token are now more flexible, now the only proibition is using colon character ':' in user name Implemented TO_JSON operation for std::error_condition Avoid unkown serial job handling code duplication via fatalUnknownSerialJob Usability improvement in t_RsLogger Disable compilation of now unused is_alphanumeric
This commit is contained in:
parent
9c65836503
commit
5dbbe1ffd7
9 changed files with 311 additions and 99 deletions
|
@ -41,12 +41,14 @@ struct t_RsLogger
|
|||
{
|
||||
inline t_RsLogger() = default;
|
||||
|
||||
typedef t_RsLogger stream_type;
|
||||
|
||||
template<typename T>
|
||||
inline t_RsLogger& operator<<(const T& val)
|
||||
inline stream_type& operator<<(const T& val)
|
||||
{ ostr << val; return *this; }
|
||||
|
||||
/// needed for manipulators and things like std::endl
|
||||
t_RsLogger& operator<<(std::ostream& (*pf)(std::ostream&))
|
||||
stream_type& operator<<(std::ostream& (*pf)(std::ostream&))
|
||||
{
|
||||
if(pf == static_cast<std::ostream& (*)(std::ostream&)>(
|
||||
&std::endl< char, std::char_traits<char> > ))
|
||||
|
@ -84,8 +86,10 @@ struct t_RsLogger
|
|||
{
|
||||
inline t_RsLogger() = default;
|
||||
|
||||
typedef decltype(std::cerr) stream_type;
|
||||
|
||||
template<typename T>
|
||||
inline std::ostream& operator<<(const T& val)
|
||||
inline stream_type& operator<<(const T& val)
|
||||
{
|
||||
return std::cerr << static_cast<char>(CATEGORY) << " " << time(nullptr)
|
||||
<< " " << val;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue