@akc42/server-utils 4.0.3 → 4.0.5

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.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # server-utils
2
2
  A Set of Utilities that I generally use on SPA projects for the server side of the project
3
3
 
4
- It consists of 4 separate packages 5 entry points.
4
+ It consists of 4 separate packages 6 entry points.
5
5
 
6
6
  The packages are:-
7
7
 
@@ -40,6 +40,11 @@ This `debug` instance also remembers the time between calls and this time is log
40
40
 
41
41
  **Logger** is a function that is a wrapper for *Debug* where `shortdate` and `immediate` are both true.
42
42
 
43
+ **getDebugLog** is an async function that fetches past debug log entries. It is normally called after a crash with the following parameters
44
+
45
+ - *logid* of the message we want to fetch before
46
+ - *limit* the maximum number of messages to retrieve
47
+ - *ipaddress* if not null then only fetch those messages with the same ip address
43
48
 
44
49
  ## Responder
45
50
 
package/debug.js CHANGED
@@ -153,7 +153,7 @@ function logWrapper(logtime, crash, shortdate,ipaddress, topic, message, colours
153
153
  DEBUG_CACHE_SIZE environment variable to specify this.
154
154
  */
155
155
 
156
- async function getDebugLog(callback, loid, no, ip) {
156
+ export async function getDebugLog(callback, loid, no, ip) {
157
157
  const lid = loid;
158
158
  const limit = no
159
159
  const ipadd = ip;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akc42/server-utils",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
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",
package/server-utils.js CHANGED
@@ -22,10 +22,13 @@
22
22
 
23
23
  import {getVersion}from './version.js';
24
24
  import {Responder} from './responder.js';
25
- import { Debug, Logger} from './debug.js';
25
+ import { Debug, Logger, DebugLog, close, getDebugLog} from './debug.js';
26
26
  import { nullif0len } from './utils.js';
27
27
  export {
28
+ close,
28
29
  Debug,
30
+ DebugLog,
31
+ getDebugLog,
29
32
  getVersion,
30
33
  Logger,
31
34
  nullif0len,