@uoa/lambda-tracing 2.2.1 → 2.2.2
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/UoaLogger.ts +18 -16
- package/changelog.md +3 -0
- package/dist/UoaLogger.js +10 -11
- package/package.json +16 -1
package/UoaLogger.ts
CHANGED
|
@@ -64,26 +64,28 @@ export class UoaLogger {
|
|
|
64
64
|
public audit(auditInformation: AuditInformation, message?: string): void {
|
|
65
65
|
// Initialize logMessage with mandatory fields
|
|
66
66
|
let logMessage: string =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
67
|
+
`application:${
|
|
68
|
+
auditInformation.application
|
|
69
|
+
? auditInformation.application.replace(/\s/g, "")
|
|
70
|
+
: "-"
|
|
71
|
+
} ` +
|
|
72
|
+
`accessedBy:${auditInformation.accessedBy.replace(/\s/g, "")} ` +
|
|
73
|
+
`action:${auditInformation.action.toString().replace(/\s/g, "")} ` +
|
|
74
|
+
`owner:${auditInformation.ownerId.replace(/\s/g, "")} ` +
|
|
75
|
+
`resourceType:${auditInformation.resourceType.replace(/\s/g, "")} ` +
|
|
76
|
+
`resourceId:${
|
|
77
|
+
auditInformation.resourceId
|
|
78
|
+
? auditInformation.resourceId.replace(/\s/g, "")
|
|
79
|
+
: "-"
|
|
80
|
+
}`;
|
|
81
|
+
|
|
80
82
|
// Append additional message if provided
|
|
81
83
|
if (message) {
|
|
82
|
-
|
|
84
|
+
logMessage += ` ${message}`;
|
|
83
85
|
}
|
|
84
|
-
|
|
86
|
+
|
|
85
87
|
this.logger.log("audit", logMessage);
|
|
86
|
-
|
|
88
|
+
}
|
|
87
89
|
|
|
88
90
|
/**
|
|
89
91
|
* Function to log warn level messages.
|
package/changelog.md
CHANGED
package/dist/UoaLogger.js
CHANGED
|
@@ -30,17 +30,16 @@ class UoaLogger {
|
|
|
30
30
|
*/
|
|
31
31
|
audit(auditInformation, message) {
|
|
32
32
|
// Initialize logMessage with mandatory fields
|
|
33
|
-
let logMessage = `
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
33
|
+
let logMessage = `application:${auditInformation.application
|
|
34
|
+
? auditInformation.application.replace(/\s/g, "")
|
|
35
|
+
: "-"} ` +
|
|
36
|
+
`accessedBy:${auditInformation.accessedBy.replace(/\s/g, "")} ` +
|
|
37
|
+
`action:${auditInformation.action.toString().replace(/\s/g, "")} ` +
|
|
38
|
+
`owner:${auditInformation.ownerId.replace(/\s/g, "")} ` +
|
|
39
|
+
`resourceType:${auditInformation.resourceType.replace(/\s/g, "")} ` +
|
|
40
|
+
`resourceId:${auditInformation.resourceId
|
|
41
|
+
? auditInformation.resourceId.replace(/\s/g, "")
|
|
42
|
+
: "-"}`;
|
|
44
43
|
// Append additional message if provided
|
|
45
44
|
if (message) {
|
|
46
45
|
logMessage += ` ${message}`;
|
package/package.json
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uoa/lambda-tracing",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Library for logging & distributed tracing in UoA Lambda projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+ssh://git@bitbucket.org/uoa/lambda-tracing.git"
|
|
8
8
|
},
|
|
9
9
|
"author": "Mitchell Faulconbridge <mitchell.faulconbridge@auckland.ac.nz>",
|
|
10
|
+
"contributors": [
|
|
11
|
+
{
|
|
12
|
+
"name": "Mitchell Faulconbridge",
|
|
13
|
+
"email": "mitchell.faulconbridge@auckland.ac.nz"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "Wenlai Wang",
|
|
17
|
+
"email": "w.wang@auckland.ac.nz"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "Osama Kashif",
|
|
21
|
+
"email": "osama.kashif@auckland.ac.nz",
|
|
22
|
+
"url": "https://www.linkedin.com/in/osamakashif"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
10
25
|
"license": "MIT",
|
|
11
26
|
"homepage": "https://bitbucket.org/uoa/lambda-tracing#readme",
|
|
12
27
|
"keywords": [
|