Index

lognestmonster / baa180d

A general-purpose single-header C logging library and parser for event-based logs. (Incomplete)

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
2525 Dec 2018 21:204e1388aUpdate event.jsJoshua1511N

Blob @ lognestmonster / src / event.js

application/javascript570 bytesdownload raw
1const statement = require("./statement.js");
2
3class Event {
4 constructor() {
5 this.statements = [];
6 this.push(arguments);
7 return this;
8 }
9
10 push() {
11 if (arguments.length == 1) {
12 if (arguments[0].statements) this.statements.push(arguments[0].statements); // object is an Event
13 else this.statements.push(arguments[0]); // object is a Statement
14 }
15 else if (arguments.length == 3) this.statements.push(new statement(arguments[0], arguments[1], arguments[2]));
16 else throw new Error("Expected 1 or 3 arguments");
17 return this;
18 }
19}
20
21module.exports = Event;
22