Skip to content

Commit

Permalink
Merge pull request shakacode#15 from anler/master
Browse files Browse the repository at this point in the history
Let logging event be polymorphic
  • Loading branch information
Alex Fedoseev authored Jun 4, 2020
2 parents 6cdb081 + ac6a6c0 commit e36f3e0
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- template: release/pipeline.yml
parameters:
name: "bs_log_macOS"
vmImage: "macOS-10.13"
vmImage: "macOS-10.14"
platform: "macOS"

- template: release/pipeline.yml
Expand Down
64 changes: 32 additions & 32 deletions src/BrowserLogger.re
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ external debugGroupCollapsed:
unit =
"groupCollapsed";

let debug = (__module__: string, event: string) => {
let debug = (__module__: string, event: 'a) => {
__module__->Module.format->debugGroupCollapsed(event);
groupEnd();
};

let debugWithData =
(__module__: string, event: string, (label1, data1): (string, 'data1)) => {
(__module__: string, event: 'a, (label1, data1): (string, 'data1)) => {
__module__->Module.format->debugGroup(event);
log2(label1 ++ ":", data1);
groupEnd();
Expand All @@ -44,7 +44,7 @@ let debugWithData =
let debugWithData2 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
) => {
Expand All @@ -57,7 +57,7 @@ let debugWithData2 =
let debugWithData3 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -72,7 +72,7 @@ let debugWithData3 =
let debugWithData4 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -89,7 +89,7 @@ let debugWithData4 =
let debugWithData5 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -108,7 +108,7 @@ let debugWithData5 =
let debugWithData6 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -129,7 +129,7 @@ let debugWithData6 =
let debugWithData7 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand Down Expand Up @@ -172,13 +172,13 @@ external infoGroupCollapsed:
unit =
"groupCollapsed";

let info = (__module__: string, event: string) => {
let info = (__module__: string, event: 'a) => {
__module__->Module.format->infoGroupCollapsed(event);
groupEnd();
};

let infoWithData =
(__module__: string, event: string, (label1, data1): (string, 'data1)) => {
(__module__: string, event: 'a, (label1, data1): (string, 'data1)) => {
__module__->Module.format->infoGroup(event);
log2(label1 ++ ":", data1);
groupEnd();
Expand All @@ -187,7 +187,7 @@ let infoWithData =
let infoWithData2 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
) => {
Expand All @@ -200,7 +200,7 @@ let infoWithData2 =
let infoWithData3 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -215,7 +215,7 @@ let infoWithData3 =
let infoWithData4 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -232,7 +232,7 @@ let infoWithData4 =
let infoWithData5 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -251,7 +251,7 @@ let infoWithData5 =
let infoWithData6 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -272,7 +272,7 @@ let infoWithData6 =
let infoWithData7 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand Down Expand Up @@ -315,13 +315,13 @@ external warnGroupCollapsed:
unit =
"groupCollapsed";

let warn = (__module__: string, event: string) => {
let warn = (__module__: string, event: 'a) => {
__module__->Module.format->warnGroupCollapsed(event);
groupEnd();
};

let warnWithData =
(__module__: string, event: string, (label1, data1): (string, 'data1)) => {
(__module__: string, event: 'a, (label1, data1): (string, 'data1)) => {
__module__->Module.format->warnGroup(event);
log2(label1 ++ ":", data1);
groupEnd();
Expand All @@ -330,7 +330,7 @@ let warnWithData =
let warnWithData2 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
) => {
Expand All @@ -343,7 +343,7 @@ let warnWithData2 =
let warnWithData3 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -358,7 +358,7 @@ let warnWithData3 =
let warnWithData4 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -375,7 +375,7 @@ let warnWithData4 =
let warnWithData5 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -394,7 +394,7 @@ let warnWithData5 =
let warnWithData6 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -415,7 +415,7 @@ let warnWithData6 =
let warnWithData7 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand Down Expand Up @@ -458,13 +458,13 @@ external errorGroupCollapsed:
unit =
"groupCollapsed";

let error = (__module__: string, event: string) => {
let error = (__module__: string, event: 'a) => {
__module__->Module.format->errorGroupCollapsed(event);
groupEnd();
};

let errorWithData =
(__module__: string, event: string, (label1, data1): (string, 'data1)) => {
(__module__: string, event: 'a, (label1, data1): (string, 'data1)) => {
__module__->Module.format->errorGroup(event);
log2(label1 ++ ":", data1);
groupEnd();
Expand All @@ -473,7 +473,7 @@ let errorWithData =
let errorWithData2 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
) => {
Expand All @@ -486,7 +486,7 @@ let errorWithData2 =
let errorWithData3 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -501,7 +501,7 @@ let errorWithData3 =
let errorWithData4 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -518,7 +518,7 @@ let errorWithData4 =
let errorWithData5 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -537,7 +537,7 @@ let errorWithData5 =
let errorWithData6 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand All @@ -558,7 +558,7 @@ let errorWithData6 =
let errorWithData7 =
(
__module__: string,
event: string,
event: 'a,
(label1, data1): (string, 'data1),
(label2, data2): (string, 'data2),
(label3, data3): (string, 'data3),
Expand Down
Loading

0 comments on commit e36f3e0

Please sign in to comment.