Skip to content

Commit

Permalink
[WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
jongpie committed Sep 20, 2024
1 parent bf2a3ab commit 8a6a54d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
21 changes: 0 additions & 21 deletions nebula-logger/core/main/logger-engine/lwc/logger/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,6 @@ import { createLoggerService as createLogger, getLoggerService as getLogger } fr
export default class Logger extends LightningElement {
#loggerService;

constructor() {
super();
Object.getOwnPropertyNames(Object.getPrototypeOf(this)).forEach(methodName => {
const originalMethod = this[methodName];

// Skip constructor and non-function properties
if (methodName !== 'constructor' && methodName !== 'connectedCallback' && typeof originalMethod === 'function') {
this[methodName] = (...args) => {
console.log(`Calling ${methodName} with arguments:`, args);

// Call the original method
const result = originalMethod.apply(this, args);

console.log(`${methodName} returned:`, result);

return result;
};
}
});
}

async connectedCallback() {
this.#loggerService = await createLogger();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import { api, LightningElement, wire } from 'lwc';
import returnSomeString from '@salesforce/apex/LoggerLWCDemoController.returnSomeString';
import throwSomeError from '@salesforce/apex/LoggerLWCDemoController.throwSomeError';
import Logger, { getLogger } from 'c/logger';
import { getLogger } from 'c/logger';

export default class LoggerLWCImportDemo extends Logger {
export default class LoggerLWCImportDemo extends LightningElement {
someBoolean = false;

message = 'Hello, world!';
Expand Down

0 comments on commit 8a6a54d

Please sign in to comment.