Nui
console.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <nui/frontend/val.hpp>
6 
7 namespace Nui
8 {
9  class Console
10  {
11  public:
12  template <typename... Args>
13  static void log(Args&&... args)
14  {
15  Nui::val::global("console").call<void>("log", convertToVal(std::forward<Args>(args))...);
16  }
17  template <typename... Args>
18  static void error(Args&&... args)
19  {
20  Nui::val::global("console").call<void>("error", convertToVal(std::forward<Args>(args))...);
21  }
22  template <typename... Args>
23  static void warn(Args&&... args)
24  {
25  Nui::val::global("console").call<void>("warn", convertToVal(std::forward<Args>(args))...);
26  }
27  template <typename... Args>
28  static void info(Args&&... args)
29  {
30  Nui::val::global("console").call<void>("info", convertToVal(std::forward<Args>(args))...);
31  }
32  template <typename... Args>
33  static void debug(Args&&... args)
34  {
35  Nui::val::global("console").call<void>("debug", convertToVal(std::forward<Args>(args))...);
36  }
37  template <typename... Args>
38  static void trace(Args&&... args)
39  {
40  Nui::val::global("console").call<void>("trace", convertToVal(std::forward<Args>(args))...);
41  }
42  template <typename... Args>
43  static void table(Args&&... args)
44  {
45  Nui::val::global("console").call<void>("table", convertToVal(std::forward<Args>(args))...);
46  }
47  static void group()
48  {
49  Nui::val::global("console").call<void>("group");
50  }
51  static void groupCollapsed()
52  {
53  Nui::val::global("console").call<void>("groupCollapsed");
54  }
55  static void groupEnd()
56  {
57  Nui::val::global("console").call<void>("groupEnd");
58  }
59  static void clear()
60  {
61  Nui::val::global("console").call<void>("clear");
62  }
63  template <typename T>
64  static void assert_(bool condition, T&& message)
65  {
66  Nui::val::global("console").call<void>("assert", condition, std::forward<T>(message));
67  }
68  };
69 }
Definition: console.hpp:10
static void debug(Args &&... args)
Definition: console.hpp:33
static void info(Args &&... args)
Definition: console.hpp:28
static void clear()
Definition: console.hpp:59
static void groupCollapsed()
Definition: console.hpp:51
static void group()
Definition: console.hpp:47
static void trace(Args &&... args)
Definition: console.hpp:38
static void assert_(bool condition, T &&message)
Definition: console.hpp:64
static void warn(Args &&... args)
Definition: console.hpp:23
static void table(Args &&... args)
Definition: console.hpp:43
static void error(Args &&... args)
Definition: console.hpp:18
static void groupEnd()
Definition: console.hpp:55
static void log(Args &&... args)
Definition: console.hpp:13
Definition: file_dialog.hpp:6
void convertToVal(Nui::val &val, T const &obj)
Definition: val_conversion.hpp:109