@akc42/server-utils 4.0.10 → 4.0.12

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/debug.js +2 -3
  2. package/package.json +1 -1
package/debug.js CHANGED
@@ -141,7 +141,7 @@ export function logWriter(logtime, crash, shortdate,ipaddress, topic, message, c
141
141
 
142
142
  function logWrapper(logtime, crash, shortdate,ipaddress, topic, message, colourspec,gap, i) {
143
143
  const output = logWriter(logtime, crash, shortdate, ipaddress, topic, message, colourspec, gap);
144
- if (i) console.log(output.message);
144
+ if (i === 1) console.log(output.message);
145
145
  return output;
146
146
  }
147
147
 
@@ -165,7 +165,7 @@ export async function getDebugLog(callback, loid, no, ip) {
165
165
  const {logtime:lt } = getLogtime.get(lid)??{logtime:0}
166
166
  if (lt > 0) {
167
167
  const fetchRecords = db.prepare(`SELECT logid, logtime,crash,shortdate,ipaddress, topic,message,colourspec,gap FROM Log
168
- WHERE (unixepoch(logtime,'subsec')) * 1000 <= ? AND logid <> ? AND ipaddress = ? ORDER BY unixepoch(logtime,'subsec') DESC LIMIT ?`)
168
+ WHERE (unixepoch(logtime,'subsec')) <= ? AND logid <> ? AND ipaddress = ? ORDER BY unixepoch(logtime,'subsec') DESC LIMIT ?`)
169
169
  if (!db.inTransaction) db.exec('BEGIN TRANSACTION');
170
170
  for (const {logid,logtime,crash,shortdate,ipaddress,topic,message,colourspec,gap} of fetchRecords.iterate(lt, lid, ipadd??null, limit)) {
171
171
  const output = messageFormatter(logid,logtime,crash,shortdate,ipaddress,topic,message,colourspec,gap)
@@ -230,7 +230,6 @@ export function Logger(topic, colourspec) {
230
230
  return function(c, ip, ...args) {
231
231
  const crash = (c === 'crash');
232
232
  const output = debug(c,ip,args);
233
- console.log(output.message);
234
233
  if (crash) {
235
234
  let lt;
236
235
  getDebugLog(async(logid,message) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akc42/server-utils",
3
- "version": "4.0.10",
3
+ "version": "4.0.12",
4
4
  "type": "module",
5
5
  "description": "A Set of Utilities to use on the Server Side of a Project",
6
6
  "main": "./server-utils.js",