OSSIA
Open Scenario System for Interactive Application
ossia-max/src/logger.hpp
1 #pragma once
2 #include "ext.h"
3 #include "ext_obex.h"
4 #undef error
5 #undef post
6 #include <ossia/network/common/websocket_log_sink.hpp>
7 
8 namespace ossia
9 {
10 namespace max_binding
11 {
12 
13 #pragma mark -
14 #pragma mark t_logger structure declaration
15 
16 struct logger
17 {
18  t_object m_object;
19  t_symbol* m_host;
20  t_symbol* m_appname;
21  t_symbol* m_exec;
22  long m_ival{};
23 
24  enum Status
25  {
26  DISCONNECTED,
27  CONNECTED
28  } m_status;
29 
30  void* m_polling_clock{};
31  void* m_dumpout{};
32 
33  void reset();
34 
35  static void
36  in_anything(ossia::max_binding::logger* x, t_symbol* s, long argc, t_atom* argv);
37  static void free(ossia::max_binding::logger* x);
38  static t_max_err
39  notify(logger* x, t_symbol* s, t_symbol* msg, void* sender, void* data);
40  static void check_connection_status(logger* x);
41 
42  static void assist(logger* x, void* b, long m, long a, char* s);
43 
44  std::shared_ptr<ossia::websocket_threaded_connection> m_con;
45  std::shared_ptr<spdlog::logger> m_log;
46  std::shared_ptr<ossia::websocket_heartbeat> m_beat;
47  std::mutex m_mutex;
48 };
49 } // max namespace
50 } // ossia namespace
51 
52 #pragma mark -
53 #pragma mark ossia_logger class declaration
54 
55 extern "C" {
56 void* ossia_logger_new(t_symbol* s, long argc, t_atom* argv);
57 }
Definition: git_info.h:7
spdlog::logger & logger() noexcept
Where the errors will be logged. Default is stderr.
Definition: context.cpp:104