Skip to content

Commit 6e6775a

Browse files
committed
fix: add generic support to LogMessage class for specifying the message type
1 parent fd873e3 commit 6e6775a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/LogMessage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface ILogMessage {
3030
* Having a seperate class and instance for each log allows chaining and the ability to further customize this module in the future without major breaking changes. The documentation
3131
* provided here is what is available to you for each log message.
3232
*/
33-
export default class LogMessage implements ILogMessage {
33+
export default class LogMessage<MT extends Message = Message> implements ILogMessage {
3434
readonly __opts: LambdaLogOptions = {};
3535
__level: string;
3636
__msg = '';
@@ -45,7 +45,7 @@ export default class LogMessage implements ILogMessage {
4545
* @param {LambdaLogOptions} opts The options for LambdaLog.
4646
* @class
4747
*/
48-
constructor(log: LogObject, opts: LambdaLogOptions) {
48+
constructor(log: LogObject<MT>, opts: LambdaLogOptions) {
4949
// LambdaLog options
5050
this.__opts = opts;
5151
// Log level

0 commit comments

Comments
 (0)