Docs
SDK reference
classes
Logger

Class: Logger

Constructors

constructor

new Logger(lazyLogin, lazyProject, logOptions?)

Parameters

NameType
lazyLogin() => Promise<void>
lazyProjectProject
logOptionsLogOptions

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

NameTypeDescription
eventReadonly<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

NameType
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

NameType
callback(span: Span) => R
args?StartSpanArgs & { name?: string } & SetCurrentArg

Returns

Promise<R>

Properties

kind

kind: "logger"