Commits

Ada Young committed 3f88c12

New we do amblogs too!

Comments (0)

Files changed (1)

    enabled="y"
    group="LogDB"
    keep_evaluating="y"
-   match="^General log for (.+)\:$"
+   match="^(General|Ambassadorial) log for (.+)\:$"
    name="ReadLogPreamble"
    regexp="y"
    send_to="12"
   <send>
 world.EnableTrigger("PromptCaptureLogDB", True)
 world.EnableTrigger("LogCapture", True)
-orgname = "%1"
+logtype = "%1"
+orgname = "%2"
 lognotes = []
 orgid = ProcessOrg(orgname)
   </send>
   <send>
 world.EnableTrigger("LogCapture", False)
 world.EnableTrigger("PromptCaptureLogDB", False)
-ProcessLogs(orgname, lognotes, orgid)
+ProcessLogs(orgname, lognotes, orgid, logtype)
   </send>
   </trigger>
 </triggers>
         id INTEGER PRIMARY KEY AUTOINCREMENT,
         timestamp TEXT,
         message TEXT,
+        log_type TEXT,
         orgid INTEGER REFERENCES orgs(id) ON DELETE CASCADE
     )""")
     cursor.execute("""
     else:
         return results[0][0]
 
-def ProcessLogs(orgname, lognotes, orgid):
+def ProcessLogs(orgname, lognotes, orgid, log_type):
     import_map = []
     for i in lognotes:
         splitlog = i.split('-')
         timestamp = "-".join(splitlog[:3])
         message = " ".join(splitlog[3:])[1:]
-        cursor.execute("SELECT * FROM org_logs l join orgs o on l.orgid=o.id WHERE o.orgname=? AND l.timestamp=datetime(?) AND l.message=?", (orgname, timestamp, message))
+        cursor.execute("SELECT * FROM org_logs l join orgs o on l.orgid=o.id WHERE o.orgname=? AND l.timestamp=datetime(?) AND l.message=? AND l.log_type=?", (orgname, timestamp, message, log_type))
         results = cursor.fetchall()
         if not len(results) > 0:
-            import_map.append((orgid, timestamp, message))
-    cursor.executemany("INSERT INTO org_logs (orgid, timestamp, message) VALUES (?, datetime(?), ?)", import_map)
+            import_map.append((orgid, timestamp, message, log_type))
+    cursor.executemany("INSERT INTO org_logs (orgid, timestamp, message, log_type) VALUES (?, datetime(?), ?, ?)", import_map)
     db.commit()
 
 def ValidateOrgname(orgname):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.