Skip to content

Commit 0628e52

Browse files
Various enhancements
* Mainly logging
1 parent 6f373b1 commit 0628e52

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/logging.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import TelemetryClient from "applicationinsights/out/Library/TelemetryClient";
55

66
interface ILogger {
77
Log(s:string):void
8-
LogError(ex: Error):void
8+
LogError(ex: string):void
99
}
1010

1111
class AiLogger implements ILogger {
@@ -20,10 +20,10 @@ class AiLogger implements ILogger {
2020
message: s
2121
});
2222
}
23-
LogError(ex: Error): void {
23+
LogError(ex: string): void {
2424
console.log(ex);
2525
this.client.trackTrace({
26-
message: JSON.stringify(ex),
26+
message: ex,
2727
severity: SeverityLevel.Error
2828
});
2929
}
@@ -33,7 +33,7 @@ class StdLogger implements ILogger {
3333
Log(s: string): void {
3434
console.log(s);
3535
}
36-
LogError(ex: Error): void {
36+
LogError(ex: string): void {
3737
console.log(ex);
3838
}
3939
}
@@ -44,7 +44,7 @@ export function Log(s:string) {
4444
logger.Log(s);
4545
}
4646

47-
export function LogError(ex: Error) {
47+
export function LogError(ex: string) {
4848
logger.LogError(ex);
4949
}
5050

src/services/ldapClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ function SearchAsync(groupName: string): Promise<any> {
4444
return new Promise((resolve, reject) => {
4545
client.search(config.LDAP.GroupBaseDN, opts, (err, res) => {
4646
if (err) {
47+
LogError(`Error searching for ${component}: ${JSON.stringify(err)}`)
4748
return reject(err);
4849
}
4950

0 commit comments

Comments
 (0)