slack-logs 1.1.1 → 1.1.2

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.
Files changed (2) hide show
  1. package/README.md +70 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -88,6 +88,76 @@ slack.logBlockMessage("Validation Message!", payload, LogLevel.WARN);
88
88
 
89
89
  ```
90
90
 
91
+ ## Sample code with output:
92
+
93
+ #### Sample 1:
94
+
95
+ ```
96
+ import { slack } from "slack-logs";.
97
+
98
+ slack.log("Data Log with bold", "Here is *BOLD* message");
99
+ slack.log("Highlight Log", "`Message`");
100
+ slack.log("Emoji :rocket: Log", "Yeah :female-technologist::skin-tone-2:");
101
+ slack.log("Object Log", {id:"123", value:"Lorem Impulse"});
102
+ ```
103
+
104
+ ![Sample Image](https://i.imgur.com/ucAnAiJ.png)
105
+
106
+ #### Sample 2:
107
+
108
+ ```
109
+ import { LogLevel, slack } from "slack-logs";.
110
+
111
+ const payload = [
112
+ { title: "Title 1", value: "1234" },
113
+ { title: "Title 2", value: 123 },
114
+ { title: "Title 3", value: { id: 12 } },
115
+ { title: "Title 4", value: [{ id: 12 }] },
116
+ ];
117
+
118
+ slack.logBlockMessage("Custom Logs!", payload);
119
+ slack.logBlockMessage("Some Information Logs!", payload, LogLevel.INFO);
120
+ slack.logBlockMessage("Critical Alert!", payload, LogLevel.ERROR);
121
+ ```
122
+
123
+ ![Sample Image](https://i.imgur.com/Ohlktzr.png)
124
+
125
+ #### Sample 3:
126
+
127
+ ```
128
+ import { LogLevel, slack } from "slack-logs";.
129
+
130
+ const payload = [
131
+ { title: "Event Name", value: "directMessage" },
132
+ {
133
+ title: "`to_user` Validation",
134
+ value: "Message 'to_user' is required! Current value is null",
135
+ },
136
+ ];
137
+
138
+ slack.logBlockMessage(`Validation failure on "development" server`, payload, LogLevel.WARN);
139
+ ```
140
+
141
+ ![Sample Image](https://i.imgur.com/yncdwGJ.png)
142
+
143
+ #### Sample 3:
144
+
145
+ ```
146
+ import { LogLevel, slack } from "slack-logs";.
147
+
148
+ const title =
149
+ ":rotating_light: Error processing message failure on 'local' server :rotating_light:";
150
+
151
+ const payload = [
152
+ { title: "Event Name", value: "directMessage" },
153
+ { title: "`error`", value: {} },
154
+ ];
155
+
156
+ slack.logBlockMessage(title, payload, LogLevel.ERROR);
157
+ ```
158
+
159
+ ![Sample Image](https://i.imgur.com/XszvEEw.png)
160
+
91
161
  ### Contributing
92
162
 
93
163
  Contributions are welcome! If you have a feature request, bug report, or a pull request, please open an issue or submit a PR on the GitHub repository
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slack-logs",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "slack-logs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.ts",