kelo

Форк
0
/
console.go 
114 строк · 1.9 Кб
1
package godom
2

3
import (
4
	"gitverse.ru/metalcore/kelo/wrapper"
5
)
6

7
type ConsoleValuer interface {
8
	wrapper.JSGetter
9

10
	Assert(bool, ...any)
11
	Clear()
12
	Count() int
13
	CountReset()
14
	Debug(...any)
15
	Dir(any)
16
	DirXML(any)
17
	Error(...any)
18
	Group(...any)
19
	GroupCollapsed(...any)
20
	GroupEnd()
21
	Info(...any)
22
	Log(...any)
23
	Table(...any)
24
	Time(...any)
25
	TimeEnd(...any)
26
	TimeLog(...any)
27
	Trace(...any)
28
	Warn(...any)
29
}
30

31
type Console struct {
32
	wrapper.JS
33
}
34

35
func NewConsole(js wrapper.JSValuer) *Console {
36
	return &Console{*wrapper.NewJS(js)}
37
}
38

39
func (c *Console) Assert(b bool, args ...any) {
40
	_ = args
41
	c.GetJS().Call("assert", b)
42
}
43

44
func (c *Console) Clear() {
45
	c.GetJS().Call("clear")
46
}
47

48
func (c *Console) Count() int {
49
	return c.GetJS().Call("count").Int()
50
}
51

52
func (c *Console) CountReset() {
53
	c.GetJS().Call("countReset")
54
}
55

56
func (c *Console) Debug(args ...any) {
57
	c.GetJS().Call("debug", args...)
58
}
59

60
func (c *Console) Dir(args any) {
61
	c.GetJS().Call("dir", args)
62
}
63

64
func (c *Console) DirXML(args any) {
65
	c.GetJS().Call("dirXML", args)
66
}
67

68
func (c *Console) Error(args ...any) {
69
	c.GetJS().Call("error", args...)
70
}
71

72
func (c *Console) Group(args ...any) {
73
	c.GetJS().Call("group", args...)
74
}
75

76
func (c *Console) GroupCollapsed(args ...any) {
77
	c.GetJS().Call("groupCollapsed", args...)
78
}
79

80
func (c *Console) GroupEnd() {
81
	c.GetJS().Call("groupEnd")
82
}
83

84
func (c *Console) Info(args ...any) {
85
	c.GetJS().Call("info", args...)
86
}
87

88
func (c *Console) Log(args ...any) {
89
	c.GetJS().Call("log", args...)
90
}
91

92
func (c *Console) Table(args ...any) {
93
	c.GetJS().Call("table", args...)
94
}
95

96
func (c *Console) Time(args ...any) {
97
	c.GetJS().Call("time", args...)
98
}
99

100
func (c *Console) TimeEnd(args ...any) {
101
	c.GetJS().Call("timeEnd", args...)
102
}
103

104
func (c *Console) TimeLog(args ...any) {
105
	c.GetJS().Call("timeLog", args...)
106
}
107

108
func (c *Console) Trace(args ...any) {
109
	c.GetJS().Call("trace", args...)
110
}
111

112
func (c *Console) Warn(args ...any) {
113
	c.GetJS().Call("warn", args...)
114
}
115

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.