Enable Seafire diagnostics
This commit is contained in:
parent
6673e3936b
commit
4216469674
@ -7,9 +7,12 @@
|
|||||||
|
|
||||||
#include <code/build/web/http-server.hxx>
|
#include <code/build/web/http-server.hxx>
|
||||||
|
|
||||||
|
#include <code/seafire/server/diagnostics.hxx>
|
||||||
|
|
||||||
#include <code/seafire/protocol/rfc7231/server.hxx>
|
#include <code/seafire/protocol/rfc7231/server.hxx>
|
||||||
|
|
||||||
#include <code/seafire/common/io/tcp-acceptor.hxx>
|
#include <code/seafire/common/io/tcp-acceptor.hxx>
|
||||||
|
#include <code/seafire/routing/diagnostics.hxx>
|
||||||
#include <code/seafire/routing/router.hxx>
|
#include <code/seafire/routing/router.hxx>
|
||||||
|
|
||||||
namespace code::build::web
|
namespace code::build::web
|
||||||
@ -17,8 +20,14 @@ namespace code::build::web
|
|||||||
|
|
||||||
augmentation_t::
|
augmentation_t::
|
||||||
augmentation_t()
|
augmentation_t()
|
||||||
: _diagnostics{std::cout} // fixme: make configurable
|
{
|
||||||
{}
|
_diagnostics.enable(seafire::server::server_category());
|
||||||
|
_diagnostics.enable(seafire::server::supervisor_category());
|
||||||
|
_diagnostics.enable(seafire::server::session_category());
|
||||||
|
_diagnostics.enable(seafire::server::transaction_category());
|
||||||
|
_diagnostics.enable(seafire::server::request_category());
|
||||||
|
_diagnostics.enable(seafire::routing::routing_category());
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
augmentation_t::
|
augmentation_t::
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include <code/build/initialization-context.hxx>
|
#include <code/build/initialization-context.hxx>
|
||||||
#include <code/build/types.hxx>
|
#include <code/build/types.hxx>
|
||||||
|
|
||||||
#include <code/seafire/common/diagnostics.hxx>
|
#include <code/build/web/diagnostics.hxx>
|
||||||
|
|
||||||
#include <asio.hpp>
|
#include <asio.hpp>
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ namespace code::build::web
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
asio::io_context _io_context;
|
asio::io_context _io_context;
|
||||||
seafire::common::ostream_diagnostics_t _diagnostics;
|
seafire_diagnostics_t _diagnostics;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,4 +17,15 @@ namespace code::build::web
|
|||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
seafire_diagnostics_t::
|
||||||
|
seafire_diagnostics_t()
|
||||||
|
{}
|
||||||
|
|
||||||
|
void
|
||||||
|
seafire_diagnostics_t::
|
||||||
|
do_log(std::string const& text)
|
||||||
|
{
|
||||||
|
record(http_category(), info()) << text;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace code::build::web
|
} // namespace code::build::web
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
#include <code/build/types.hxx>
|
#include <code/build/types.hxx>
|
||||||
#include <code/build/diagnostics.hxx>
|
#include <code/build/diagnostics.hxx>
|
||||||
|
|
||||||
|
#include <code/seafire/common/diagnostics.hxx>
|
||||||
|
|
||||||
namespace code::build::web
|
namespace code::build::web
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -13,6 +15,24 @@ namespace code::build::web
|
|||||||
category_t const&
|
category_t const&
|
||||||
web_category();
|
web_category();
|
||||||
|
|
||||||
|
class seafire_diagnostics_t
|
||||||
|
: public code::seafire::common::diagnostics_t
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
seafire_diagnostics_t();
|
||||||
|
|
||||||
|
seafire_diagnostics_t(seafire_diagnostics_t const&) = delete;
|
||||||
|
seafire_diagnostics_t(seafire_diagnostics_t&&) = delete;
|
||||||
|
|
||||||
|
seafire_diagnostics_t& operator=(seafire_diagnostics_t const&) = delete;
|
||||||
|
seafire_diagnostics_t& operator=(seafire_diagnostics_t&&) = delete;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void
|
||||||
|
do_log(string const&) override;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace code::build::web
|
} // namespace code::build::web
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user