MCPcopy Index your code
hub / github.com/datalust/seq-logging / sayHello

Function sayHello

example/example_async.js:13–32  ·  view source on GitHub ↗
(times)

Source from the content-addressed store, hash-verified

11 .then(() => seq.close());
12
13async function sayHello(times) {
14 for(let n = 0; n <= times; n++){
15 await new Promise((accept) => setTimeout(accept, 1 * 1000)); // Waits 1 second before each round
16
17 console.log('Round ', n);
18 seq.emit({
19 timestamp: new Date(),
20 level: 'Information',
21 messageTemplate: 'Hello for the {n}th time, {user}!',
22 properties: {
23 user: process.env.USERNAME,
24 n: n
25 }
26 });
27
28 if (n % 5 == 0) { // Flush every 5 events
29 seq.flush();
30 }
31 }
32}

Callers 1

example_async.jsFile · 0.70

Calls 2

emitMethod · 0.80
flushMethod · 0.80

Tested by

no test coverage detected