Skip to content

Commit 5decded

Browse files
Merge pull request #107174 from rodrigoaatmicrosoft/patch-9
Add console dot info, warn and error documentation
2 parents 22cb215 + 196ad14 commit 5decded

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

articles/stream-analytics/stream-analytics-javascript-user-defined-functions.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,27 @@ Samstag, 28. Dezember 2019
211211
```
212212

213213
## User Logging
214-
The logging mechanism allows you to capture custom information while a job is running. You can use log data to debug or assess the correctness of the custom code in real time. This mechanism is available through the Console.Log() method.
214+
The logging mechanism allows users to capture custom information while a job is running. Log data can be used to debug or assess the correctness of the custom code in real time. This mechanism is available through three different methods.
215+
216+
### Console.Info()
217+
Console.Info method is used to log general information during code execution. This method will log data without interrupting computation. The message logged will be marked as Event Level Informational.
218+
219+
```javascript
220+
console.info('my info message');
221+
```
222+
223+
### Console.Warn()
224+
Console.Warn method is used to log data that might not be correct or expected but is still accepted for computation. This method will not interrupt computation and will resume running after the method is returned. The message logged will be marked as Event Level Warning.
225+
226+
```javascript
227+
console.warn('my warning message');
228+
```
229+
230+
### Console.Error() and Console.Log()
231+
Console.Error method is only used to log error cases where code cannot continue to run. This method will throw an exception with the error information provided as the input parameter and job will stop running. The error message logged will be marked as Event Level Error.
215232

216233
```javascript
217-
console.log('my error message');
234+
console.error('my error message');
218235
```
219236

220237
You can access log messages through the [diagnostic logs](data-errors.md).

0 commit comments

Comments
 (0)