Skip to content

Commit a3c1f16

Browse files
committed
feat: add log shortcut method as an alias for info to match the console pattern
1 parent 7317bf5 commit a3c1f16

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/LambdaLog.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,16 @@ export default class LambdaLog extends EventEmitter {
193193
*/
194194
info<T extends Message>(msg: T, meta?: GenericRecord, tags?: Tag[]) {
195195
return this.log('info', msg, meta, tags);
196+
/**
197+
* Alias for `info`.
198+
* @template T The type of the message to log.
199+
* @param {T} msg Message to log. Can be any type, but string or `Error` is reccommended.
200+
* @param {Metadata} [meta] Optional meta data to attach to the log.
201+
* @param {Tag[]} [tags] Additional tags to append to this log.
202+
* @returns {LogMessage} Returns instance of LogMessage.
203+
*/
204+
log<T extends Message = Message>(msg: T, meta?: Metadata, tags?: Tag[]): LogMessage {
205+
return this._log<T>('info', msg, meta, tags);
196206
}
197207

198208
/**

0 commit comments

Comments
 (0)