fix logger

This commit is contained in:
chatlanin
2023-10-03 22:52:09 +03:00
parent c722357baf
commit 07b2ef61e6
2 changed files with 15 additions and 16 deletions

View File

@@ -1,13 +1,12 @@
![hack++'s logo](./hack.png) ![hack++'s logo](./hack.png)
*This is a very necessary collection of pieces of working code, for the possible simplification of life.* * Это очень нужная коллекция фрагментов рабочего кода для возможного упрощения жизни.*
The author does not in any way pretend to the purity of implementation and fidelity of execution. Автор никоим образом не претендует на чистоту реализации и верность исполнения, поэтому, если вы думаете, что можете сделать это по-другому, то пожалуйста, сделайте это.
Therefore, if you think that you can do it differently, then please do it. Я буду очень благодарен вам за предоставленную информацию.
I will be very grateful to you for PR.
Please see example for implementation by /bin/main.cpp Пожалуйста, смотрите пример реализации с помощью /bin/{package}/main.cpp
Tests are written according to necessity and the presence of the right mood!!! Тесты пишутся по необходимости и при наличии нужного настроения!!!
But you can always fix it. :) Но вы всегда можете это исправить. :)

View File

@@ -12,15 +12,6 @@
namespace hack namespace hack
{ {
template<typename T, typename U>
void prepare(T t, U u)
{
std::cout << t
<< u.file_name() << ":" << view::color::reset
<< view::color::italic << view::color::yellow << u.function_name() << "()" << view::color::reset
<< view::color::bold << view::color::blue << "[" << u.line() << "]" << view::color::reset << ": ";
}
class log class log
{ {
public: public:
@@ -55,6 +46,15 @@ namespace hack
inline static std::string devider = " "; inline static std::string devider = " ";
private: private:
template<typename T, typename U>
void prepare(T t, U u)
{
std::cout << t
<< u.file_name() << ":" << view::color::reset
<< view::color::italic << view::color::yellow << u.function_name() << "()" << view::color::reset
<< view::color::bold << view::color::blue << "[" << u.line() << "]" << view::color::reset << ": ";
}
static void print() { std::cout << std::endl; } static void print() { std::cout << std::endl; }
static std::ostream& make_type_view(std::ostream &os) static std::ostream& make_type_view(std::ostream &os)