@colisweb/rescript-toolkit 2.11.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitlab-ci.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  include:
2
- - "https://colisweb-open-source.gitlab.io/ci-common/v13.8.3/templates/colisweb.yml"
2
+ - "https://colisweb-open-source.gitlab.io/ci-common/v13.11.1/templates/colisweb.yml"
3
3
 
4
4
  # -----------------------------------------------
5
5
  # Test
@@ -16,7 +16,6 @@ rescript compilation:
16
16
  - .yarn/
17
17
  script:
18
18
  - export NPM_TOKEN=${NPM_TOKEN:-undefined}
19
- - echo $NPM_TOKEN
20
19
  - yarn install --cache-folder .yarn --pure-lockfile
21
20
  - yarn test
22
21
 
package/bsconfig.json CHANGED
@@ -31,12 +31,11 @@
31
31
  "reason-react",
32
32
  "decco",
33
33
  "rescript-classnames",
34
- "rescript-logger",
35
34
  "reschema",
36
35
  "rescript-react-update",
37
36
  "restorative"
38
37
  ],
39
- "ppx-flags": ["decco/ppx", "lenses-ppx/ppx", "rescript-logger/ppx"],
38
+ "ppx-flags": ["decco/ppx", "lenses-ppx/ppx"],
40
39
  "refmt": 3,
41
40
  "warnings": {
42
41
  "number": "-44-30-32",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "2.11.0",
3
+ "version": "2.13.0",
4
4
  "scripts": {
5
5
  "clean": "rescript clean",
6
6
  "build": "rescript build",
@@ -65,7 +65,6 @@
65
65
  "reschema": "1.3.1",
66
66
  "rescript": "9.1.4",
67
67
  "rescript-classnames": "6.0.0",
68
- "rescript-logger": "2.0.2",
69
68
  "rescript-react-update": "5.0.0",
70
69
  "restorative": "0.4.0-beta.1",
71
70
  "sanitize-html": "2.6.1",
@@ -74,6 +73,7 @@
74
73
  },
75
74
  "devDependencies": {
76
75
  "@babel/core": "7.16.5",
76
+ "@sentry/browser": "6.17.6",
77
77
  "@storybook/addon-actions": "6.1.21",
78
78
  "@storybook/addon-essentials": "6.1.21",
79
79
  "@storybook/addon-knobs": "6.1.21",
package/src/Toolkit.res CHANGED
@@ -9,3 +9,5 @@ module Router = Toolkit__Router
9
9
  module Ui = Toolkit__Ui
10
10
  module Utils = Toolkit__Utils
11
11
  module Form = Toolkit__Form
12
+ module BrowserLogger = Toolkit__BrowserLogger
13
+ module NativeLogger = Toolkit__NativeLogger
@@ -0,0 +1,92 @@
1
+ open BsSentry
2
+
3
+ @val @scope("process.env") external nodeEnv: string = "NODE_ENV"
4
+
5
+ let debugStyle = "background-color: #208E9C; color: white; padding: 5px; font-size: 10px;"
6
+ let warningStyle = "background-color: #FFAD2D; color: white; padding: 5px; font-size: 10px;"
7
+ let errorStyle = "background-color: #FF4714; color: white; padding: 5px; font-size: 10px;"
8
+
9
+ let debug = str => {
10
+ if nodeEnv !== "production" {
11
+ Js.Console.log3("%cDEBUG", debugStyle, str)
12
+ }
13
+ }
14
+
15
+ let debug2 = (str, str2) => {
16
+ if nodeEnv !== "production" {
17
+ Js.Console.log4("%cDEBUG", debugStyle, str, str2)
18
+ }
19
+ }
20
+ let debug3 = (str, str2, str3) => {
21
+ if nodeEnv !== "production" {
22
+ Js.Console.logMany(["%cDEBUG", debugStyle, str, str2, str3])
23
+ }
24
+ }
25
+
26
+ let warning = str => {
27
+ if nodeEnv !== "production" {
28
+ Js.Console.log3("%cWARN", warningStyle, str)
29
+ }
30
+ }
31
+
32
+ let warning2 = (str, str2) => {
33
+ if nodeEnv !== "production" {
34
+ Js.Console.log4("%cWARN", warningStyle, str, str2)
35
+ }
36
+ }
37
+
38
+ let warning3 = (str, str2, str3) => {
39
+ if nodeEnv !== "production" {
40
+ Js.Console.logMany(["%cWARN", warningStyle, str, str2, str3])
41
+ }
42
+ }
43
+
44
+ let error = str => {
45
+ if nodeEnv !== "production" {
46
+ Js.Console.log3("%cERROR", errorStyle, str)
47
+ } else {
48
+ open Sentry
49
+ withScope(_scope => {
50
+ captureMessage(Obj.magic(str))
51
+ })
52
+ }
53
+ }
54
+
55
+ let error2 = (str, str2) => {
56
+ if nodeEnv !== "production" {
57
+ Js.Console.log4("%cERROR", errorStyle, str, str2)
58
+ } else {
59
+ open Sentry
60
+ withScope(scope => {
61
+ scope->Scope.setExtra("data", str2)
62
+ captureMessage(Obj.magic(str))
63
+ })
64
+ }
65
+ }
66
+
67
+ let error3 = (str, str2, str3) => {
68
+ if nodeEnv !== "production" {
69
+ Js.Console.logMany(["%cERROR", errorStyle, str, str2, str3])
70
+ } else {
71
+ open Sentry
72
+ withScope(scope => {
73
+ scope->Scope.setExtra("1-data", str2)
74
+ scope->Scope.setExtra("2-data", str3)
75
+ captureMessage(Obj.magic(str))
76
+ })
77
+ }
78
+ }
79
+
80
+ let error4 = (str, str2, str3, str4) => {
81
+ if nodeEnv !== "production" {
82
+ Js.Console.logMany(["%cERROR", errorStyle, str, str2, str3, str4])
83
+ } else {
84
+ open Sentry
85
+ withScope(scope => {
86
+ scope->Scope.setExtra("1-data", str2)
87
+ scope->Scope.setExtra("2-data", str3)
88
+ scope->Scope.setExtra("3-data", str4)
89
+ captureMessage(Obj.magic(str))
90
+ })
91
+ }
92
+ }
@@ -0,0 +1,8 @@
1
+ let debug: 'a => unit
2
+ let debug2: ('a, 'b) => unit
3
+
4
+ let warning: 'a => unit
5
+ let warning2: ('a, 'b) => unit
6
+
7
+ let error: 'a => unit
8
+ let error2: ('a, 'b) => unit
@@ -0,0 +1,54 @@
1
+ open BsSentryReactNative
2
+
3
+ @val @scope("process.env") external nodeEnv: string = "NODE_ENV"
4
+
5
+ let debugStyle = "background-color: #208E9C; color: white; padding: 5px; font-size: 10px;"
6
+ let warningStyle = "background-color: #FFAD2D; color: white; padding: 5px; font-size: 10px;"
7
+ let errorStyle = "background-color: #FF4714; color: white; padding: 5px; font-size: 10px;"
8
+
9
+ let debug = str => {
10
+ if nodeEnv !== "production" {
11
+ Js.Console.log3("%cDEBUG", debugStyle, str)
12
+ }
13
+ }
14
+
15
+ let debug2 = (str, str2) => {
16
+ if nodeEnv !== "production" {
17
+ Js.Console.log4("%cDEBUG", debugStyle, str, str2)
18
+ }
19
+ }
20
+
21
+ let warning = str => {
22
+ if nodeEnv !== "production" {
23
+ Js.Console.log3("%cWARN", warningStyle, str)
24
+ }
25
+ }
26
+
27
+ let warning2 = (str, str2) => {
28
+ if nodeEnv !== "production" {
29
+ Js.Console.log4("%cWARN", warningStyle, str, str2)
30
+ }
31
+ }
32
+
33
+ let error = str => {
34
+ if nodeEnv !== "production" {
35
+ Js.Console.log3("%cERROR", errorStyle, str)
36
+ } else {
37
+ open Sentry
38
+ withScope(_scope => {
39
+ captureMessage(Obj.magic(str))
40
+ })
41
+ }
42
+ }
43
+
44
+ let error2 = (str, str2) => {
45
+ if nodeEnv !== "production" {
46
+ Js.Console.log4("%cERROR", errorStyle, str, str2)
47
+ } else {
48
+ open Sentry
49
+ withScope(scope => {
50
+ scope->Scope.setExtra("data", str2)
51
+ captureMessage(Obj.magic(str))
52
+ })
53
+ }
54
+ }
@@ -0,0 +1,8 @@
1
+ let debug: 'a => unit
2
+ let debug2: ('a, 'b) => unit
3
+
4
+ let warning: 'a => unit
5
+ let warning2: ('a, 'b) => unit
6
+
7
+ let error: 'a => unit
8
+ let error2: ('a, 'b) => unit
@@ -0,0 +1,16 @@
1
+ # Logger
2
+
3
+ Display log only at development and trigger Sentry on error on production.
4
+
5
+ ## Usage
6
+
7
+ ```reason
8
+ let obj = {
9
+ "test": 1,
10
+ "z": "ee"
11
+ }
12
+
13
+ Toolkit.BrowserLogger.debug("test")
14
+
15
+ Toolkit.BrowserLogger.error2("Error", obj)
16
+ ```
@@ -55,10 +55,7 @@ let toResult = (
55
55
  switch response["data"]->mapData {
56
56
  | Ok(_) as ok => ok
57
57
  | Error(error) => {
58
- %log.error(
59
- "Decoder failure"
60
- ("err", error)
61
- )
58
+ Toolkit__BrowserLogger.error2("Decoder failure", error)
62
59
  Error(
63
60
  #invalidResponseData(
64
61
  response->castToUndecodedResponse,
@@ -76,10 +73,8 @@ let toResult = (
76
73
  switch error {
77
74
  | Ok(err) => Error(#custom(err))
78
75
  | Error(_err) =>
79
- %log.error(
80
- "errorDecoder"
81
- ("err", _err)
82
- )
76
+ Toolkit__BrowserLogger.error2("errorDecoder", _err)
77
+
83
78
  Error(#invalidErrorData)
84
79
  }
85
80
 
@@ -3,7 +3,7 @@ module type Config = {
3
3
  type response
4
4
  type error
5
5
  let exec: argument => Promise.promise<
6
- result<response, Axios2.WithResult.customError<error, Js.Json.t, 'header, 'req>>,
6
+ result<response, Axios2.WithResult.customError<error, Js.Json.t>>,
7
7
  >
8
8
  }
9
9
 
@@ -23,24 +23,24 @@ type auth = {
23
23
  }
24
24
  type proxy = {host: int, port: int, auth: auth}
25
25
 
26
- type response<'data, 'header> = {
26
+ type response<'data> = {
27
27
  data: 'data,
28
28
  status: int,
29
29
  statusText: string,
30
- headers: Js.t<'header>,
30
+ headers: Js.Dict.t<string>,
31
31
  config: config,
32
32
  }
33
33
 
34
- type error<'responseData, 'responseHeader, 'request> = {
35
- request: option<'request>,
36
- response: option<response<'responseData, 'responseHeader>>,
34
+ type error<'responseData> = {
35
+ request: option<Js.Json.t>,
36
+ response: option<response<'responseData>>,
37
37
  message: string,
38
38
  }
39
39
 
40
- type adapter<'a, 'b, 'err> = config => Promise.Js.t<response<'a, 'b>, 'err>
40
+ type adapter<'a, 'b, 'err> = config => Promise.Js.t<response<'a>, 'err>
41
41
 
42
42
  @module("axios")
43
- external isAxiosError: error<'a, 'b, 'c> => bool = "isAxiosError"
43
+ external isAxiosError: error<'a> => bool = "isAxiosError"
44
44
 
45
45
  @obj
46
46
  external makeConfig: (
@@ -72,24 +72,15 @@ external makeConfig: (
72
72
  ) => config = ""
73
73
 
74
74
  @module("axios")
75
- external get: (string, ~config: config=?, unit) => Promise.Js.t<response<'data, 'headers>, 'err> =
76
- "get"
75
+ external get: (string, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> = "get"
77
76
 
78
77
  @module("axios")
79
- external post: (
80
- string,
81
- ~data: 'a,
82
- ~config: config=?,
83
- unit,
84
- ) => Promise.Js.t<response<'data, 'headers>, 'err> = "post"
78
+ external post: (string, ~data: 'a, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> =
79
+ "post"
85
80
 
86
81
  @module("axios")
87
- external put: (
88
- string,
89
- ~data: 'a,
90
- ~config: config=?,
91
- unit,
92
- ) => Promise.Js.t<response<'data, 'headers>, 'err> = "put"
82
+ external put: (string, ~data: 'a, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> =
83
+ "put"
93
84
 
94
85
  @module("axios")
95
86
  external patch: (
@@ -97,21 +88,14 @@ external patch: (
97
88
  ~data: 'a,
98
89
  ~config: config=?,
99
90
  unit,
100
- ) => Promise.Js.t<response<'data, 'headers>, 'err> = "patch"
91
+ ) => Promise.Js.t<response<'data>, 'err> = "patch"
101
92
 
102
93
  @module("axios")
103
- external delete: (
104
- string,
105
- ~config: config=?,
106
- unit,
107
- ) => Promise.Js.t<response<'data, 'headers>, 'err> = "delete"
94
+ external delete: (string, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> = "delete"
108
95
 
109
96
  @module("axios")
110
- external options: (
111
- string,
112
- ~config: config=?,
113
- unit,
114
- ) => Promise.Js.t<response<'data, 'headers>, 'err> = "options"
97
+ external options: (string, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> =
98
+ "options"
115
99
 
116
100
  module Interceptors = {
117
101
  @module("axios") @scope(("default", "interceptors", "request"))
@@ -123,19 +107,15 @@ module Interceptors = {
123
107
  }
124
108
 
125
109
  module WithResult = {
126
- type customError<'apiError, 'response, 'headers, 'request> = [
127
- | #default(error<'response, 'headers, 'request>)
110
+ type customError<'apiError, 'response> = [
111
+ | #default(error<'response>)
128
112
  | #decodeError(Decco.decodeError)
129
113
  | #custom('apiError)
130
114
  ]
131
115
 
132
116
  type decodeData<'newData, 'err> = Js.Json.t => result<'newData, 'err>
133
117
 
134
- type mapError<'a, 'response, 'headers, 'request> = error<
135
- 'response,
136
- 'headers,
137
- 'request,
138
- > => customError<'a, 'response, 'headers, 'request>
118
+ type mapError<'a, 'response, 'headers, 'request> = error<'response> => customError<'a, 'response>
139
119
 
140
120
  let toResult = (promise, ~mapError, ~decodeData) =>
141
121
  promise
@@ -151,53 +131,47 @@ module WithResult = {
151
131
  })
152
132
 
153
133
  let get = (
154
- string,
155
134
  ~config=?,
156
135
  ~decodeData: decodeData<'newData, 'err>,
157
136
  ~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
158
- unit,
159
- ) => get(string, ~config?, unit)->toResult(~decodeData, ~mapError)
137
+ string,
138
+ ) => get(string, ~config?, ())->toResult(~decodeData, ~mapError)
160
139
 
161
140
  let post = (
162
- string,
163
141
  ~data,
164
142
  ~config=?,
165
143
  ~decodeData: decodeData<'newData, 'err>,
166
144
  ~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
167
- unit,
168
- ) => post(string, ~data, ~config?, unit)->toResult(~decodeData, ~mapError)
145
+ string,
146
+ ) => post(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
169
147
 
170
148
  let put = (
171
- string,
172
149
  ~data,
173
150
  ~config=?,
174
151
  ~decodeData: decodeData<'newData, 'err>,
175
152
  ~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
176
- unit,
177
- ) => put(string, ~data, ~config?, unit)->toResult(~decodeData, ~mapError)
153
+ string,
154
+ ) => put(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
178
155
 
179
156
  let patch = (
180
- string,
181
157
  ~data,
182
158
  ~config=?,
183
159
  ~decodeData: decodeData<'newData, 'err>,
184
160
  ~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
185
- unit,
186
- ) => patch(string, ~data, ~config?, unit)->toResult(~decodeData, ~mapError)
161
+ string,
162
+ ) => patch(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
187
163
 
188
164
  let delete = (
189
- string,
190
165
  ~config=?,
191
166
  ~decodeData: decodeData<'newData, 'err>,
192
167
  ~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
193
- unit,
194
- ) => delete(string, ~config?, unit)->toResult(~decodeData, ~mapError)
168
+ string,
169
+ ) => delete(string, ~config?, ())->toResult(~decodeData, ~mapError)
195
170
 
196
171
  let options = (
197
- string,
198
172
  ~config=?,
199
173
  ~decodeData: decodeData<'newData, 'err>,
200
174
  ~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
201
- unit,
202
- ) => options(string, ~config?, unit)->toResult(~decodeData, ~mapError)
175
+ string,
176
+ ) => options(string, ~config?, ())->toResult(~decodeData, ~mapError)
203
177
  }
@@ -53,6 +53,11 @@ external parseISO: string => Js.Date.t = "parseISO"
53
53
 
54
54
  @module("date-fns") external formatWithPattern: (Js.Date.t, string) => string = "format"
55
55
 
56
+ type formatWithPatternOptions = {locale: dateFnsLocale}
57
+ @module("date-fns")
58
+ external formatWithPatternWithOptions: (Js.Date.t, string, formatWithPatternOptions) => string =
59
+ "format"
60
+
56
61
  // set
57
62
 
58
63
  @module("date-fns")
@@ -1,114 +0,0 @@
1
- open BsSentry
2
-
3
- let error = (loc: ReScriptLogger.Location.t, event) => {
4
- open Sentry
5
- withScope(scope => {
6
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
7
- scope->Scope.setExtra("fullPath", loc.fullPath)
8
- scope->Scope.setExtra("function", loc.value)
9
- captureMessage(event)
10
- })
11
- }
12
-
13
- let error1 = (loc: ReScriptLogger.Location.t, event, (label, data)) => {
14
- open Sentry
15
- withScope(scope => {
16
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
17
- scope->Scope.setExtra("fullPath", loc.fullPath)
18
- scope->Scope.setExtra("function", loc.value)
19
- scope->Scope.setExtra(label, data)
20
- captureMessage(event)
21
- })
22
- }
23
-
24
- let error2 = (loc: ReScriptLogger.Location.t, event, (label1, data1), (label2, data2)) => {
25
- open Sentry
26
- withScope(scope => {
27
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
28
- scope->Scope.setExtra("fullPath", loc.fullPath)
29
- scope->Scope.setExtra("function", loc.value)
30
- scope->Scope.setExtra(label1, data1)
31
- scope->Scope.setExtra(label2, data2)
32
- captureMessage(event)
33
- })
34
- }
35
-
36
- let error3 = (
37
- loc: ReScriptLogger.Location.t,
38
- event,
39
- (label1, data1),
40
- (label2, data2),
41
- (label3, data3),
42
- ) => {
43
- open Sentry
44
- withScope(scope => {
45
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
46
- scope->Scope.setExtra("fullPath", loc.fullPath)
47
- scope->Scope.setExtra("function", loc.value)
48
- scope->Scope.setExtra(label1, data1)
49
- scope->Scope.setExtra(label2, data2)
50
- scope->Scope.setExtra(label3, data3)
51
- captureMessage(event)
52
- })
53
- }
54
- let error4 = (
55
- loc: ReScriptLogger.Location.t,
56
- event,
57
- (label1, data1),
58
- (label2, data2),
59
- (label3, data3),
60
- (label4, data4),
61
- ) => {
62
- open Sentry
63
- withScope(scope => {
64
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
65
- scope->Scope.setExtra("fullPath", loc.fullPath)
66
- scope->Scope.setExtra("function", loc.value)
67
- scope->Scope.setExtra(label1, data1)
68
- scope->Scope.setExtra(label2, data2)
69
- scope->Scope.setExtra(label3, data3)
70
- scope->Scope.setExtra(label4, data4)
71
- captureMessage(event)
72
- })
73
- }
74
- let error5 = (
75
- loc: ReScriptLogger.Location.t,
76
- event,
77
- (label1, data1),
78
- (label2, data2),
79
- (label3, data3),
80
- (label4, data4),
81
- (label5, data5),
82
- ) => {
83
- open Sentry
84
- withScope(scope => {
85
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
86
- scope->Scope.setExtra("fullPath", loc.fullPath)
87
- scope->Scope.setExtra("function", loc.value)
88
- scope->Scope.setExtra(label1, data1)
89
- scope->Scope.setExtra(label2, data2)
90
- scope->Scope.setExtra(label3, data3)
91
- scope->Scope.setExtra(label4, data4)
92
- scope->Scope.setExtra(label5, data5)
93
- captureMessage(event)
94
- })
95
- }
96
-
97
- let errorWithData = (loc: ReScriptLogger.Location.t, event, (label, data)) => {
98
- open Sentry
99
- withScope(scope => {
100
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
101
- scope->Scope.setExtra(label, data)
102
- captureMessage(event)
103
- })
104
- }
105
-
106
- let errorWithData2 = (loc: ReScriptLogger.Location.t, event, (label1, data1), (label2, data2)) => {
107
- open Sentry
108
- withScope(scope => {
109
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
110
- scope->Scope.setExtra(label1, data1)
111
- scope->Scope.setExtra(label2, data2)
112
- captureMessage(event)
113
- })
114
- }
@@ -1,114 +0,0 @@
1
- open BsSentryReactNative
2
-
3
- let error = (loc: ReScriptLogger.Location.t, event) => {
4
- open Sentry
5
- withScope(scope => {
6
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
7
- scope->Scope.setExtra("fullPath", loc.fullPath)
8
- scope->Scope.setExtra("function", loc.value)
9
- captureMessage(event)
10
- })
11
- }
12
-
13
- let error1 = (loc: ReScriptLogger.Location.t, event, (label, data)) => {
14
- open Sentry
15
- withScope(scope => {
16
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
17
- scope->Scope.setExtra("fullPath", loc.fullPath)
18
- scope->Scope.setExtra("function", loc.value)
19
- scope->Scope.setExtra(label, data)
20
- captureMessage(event)
21
- })
22
- }
23
-
24
- let error2 = (loc: ReScriptLogger.Location.t, event, (label1, data1), (label2, data2)) => {
25
- open Sentry
26
- withScope(scope => {
27
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
28
- scope->Scope.setExtra("fullPath", loc.fullPath)
29
- scope->Scope.setExtra("function", loc.value)
30
- scope->Scope.setExtra(label1, data1)
31
- scope->Scope.setExtra(label2, data2)
32
- captureMessage(event)
33
- })
34
- }
35
-
36
- let error3 = (
37
- loc: ReScriptLogger.Location.t,
38
- event,
39
- (label1, data1),
40
- (label2, data2),
41
- (label3, data3),
42
- ) => {
43
- open Sentry
44
- withScope(scope => {
45
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
46
- scope->Scope.setExtra("fullPath", loc.fullPath)
47
- scope->Scope.setExtra("function", loc.value)
48
- scope->Scope.setExtra(label1, data1)
49
- scope->Scope.setExtra(label2, data2)
50
- scope->Scope.setExtra(label3, data3)
51
- captureMessage(event)
52
- })
53
- }
54
- let error4 = (
55
- loc: ReScriptLogger.Location.t,
56
- event,
57
- (label1, data1),
58
- (label2, data2),
59
- (label3, data3),
60
- (label4, data4),
61
- ) => {
62
- open Sentry
63
- withScope(scope => {
64
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
65
- scope->Scope.setExtra("fullPath", loc.fullPath)
66
- scope->Scope.setExtra("function", loc.value)
67
- scope->Scope.setExtra(label1, data1)
68
- scope->Scope.setExtra(label2, data2)
69
- scope->Scope.setExtra(label3, data3)
70
- scope->Scope.setExtra(label4, data4)
71
- captureMessage(event)
72
- })
73
- }
74
- let error5 = (
75
- loc: ReScriptLogger.Location.t,
76
- event,
77
- (label1, data1),
78
- (label2, data2),
79
- (label3, data3),
80
- (label4, data4),
81
- (label5, data5),
82
- ) => {
83
- open Sentry
84
- withScope(scope => {
85
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
86
- scope->Scope.setExtra("fullPath", loc.fullPath)
87
- scope->Scope.setExtra("function", loc.value)
88
- scope->Scope.setExtra(label1, data1)
89
- scope->Scope.setExtra(label2, data2)
90
- scope->Scope.setExtra(label3, data3)
91
- scope->Scope.setExtra(label4, data4)
92
- scope->Scope.setExtra(label5, data5)
93
- captureMessage(event)
94
- })
95
- }
96
-
97
- let errorWithData = (loc: ReScriptLogger.Location.t, event, (label, data)) => {
98
- open Sentry
99
- withScope(scope => {
100
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
101
- scope->Scope.setExtra(label, data)
102
- captureMessage(event)
103
- })
104
- }
105
-
106
- let errorWithData2 = (loc: ReScriptLogger.Location.t, event, (label1, data1), (label2, data2)) => {
107
- open Sentry
108
- withScope(scope => {
109
- scope->Scope.setExtra("module", loc.subModulePath->List.toArray)
110
- scope->Scope.setExtra(label1, data1)
111
- scope->Scope.setExtra(label2, data2)
112
- captureMessage(event)
113
- })
114
- }
@@ -1,3 +0,0 @@
1
- # Sentry
2
-
3
- Bug tracker