Class: Logger
Constructors
constructor
• new Logger(lazyLogin
, lazyProject
, logOptions?
)
Parameters
Name | Type |
---|---|
lazyLogin | () => Promise <void > |
lazyProject | Project |
logOptions | LogOptions |
Methods
flush
▸ flush(): Promise
<void
>
Returns
Promise
<void
>
log
▸ log(event
): Promise
<string
>
Log a single event. The event will be batched and uploaded behind the scenes if logOptions.asyncFlush
is true.
Parameters
Name | Type | Description |
---|---|---|
event | Readonly <StartSpanEventArgs > | The event to log. |
Returns
Promise
<string
>
startSpan
▸ startSpan(args?
): Promise
<Span
>
Create a new toplevel span. The name parameter is optional and defaults to "root".
See Span.startSpan
for full details.
Parameters
Name | Type |
---|---|
args? | StartSpanOptionalNameArgs |
Returns
Promise
<Span
>
traced
▸ traced<R
>(callback
, args?
): Promise
<R
>
Wrapper over Logger.startSpan
, which passes the initialized Span
it to the given callback and ends it afterwards. See Span.traced
for full details.
Type parameters
Name |
---|
R |
Parameters
Name | Type |
---|---|
callback | (span : Span ) => R |
args? | StartSpanArgs & { name? : string } & SetCurrentArg |
Returns
Promise
<R
>
Properties
kind
• kind: "logger"