LogEntry

Represents a single log entry from the template build process.

Extended by

  • LogEntryStart
  • LogEntryEnd

Constructors

new LogEntry(
   timestamp: Date, 
   level: LogEntryLevel, 
   message: string): LogEntry
Parameters
ParameterType
timestampDate
levelLogEntryLevel
messagestring
Returns

LogEntry

Properties

PropertyModifierType
levelreadonlyLogEntryLevel
messagereadonlystring
timestampreadonlyDate

Methods

toString()

toString(): string
Returns

string


LogEntryEnd

Special log entry indicating the end of a build process.

Constructors

new LogEntryEnd(timestamp: Date, message: string): LogEntryEnd
Parameters
ParameterType
timestampDate
messagestring
Returns

LogEntryEnd

Properties

PropertyModifierTypeInherited from
levelreadonlyLogEntryLevelLogEntry.level
messagereadonlystringLogEntry.message
timestampreadonlyDateLogEntry.timestamp

Methods

toString()

toString(): string
Returns

string


LogEntryStart

Special log entry indicating the start of a build process.

Constructors

new LogEntryStart(timestamp: Date, message: string): LogEntryStart
Parameters
ParameterType
timestampDate
messagestring
Returns

LogEntryStart

Properties

PropertyModifierTypeInherited from
levelreadonlyLogEntryLevelLogEntry.level
messagereadonlystringLogEntry.message
timestampreadonlyDateLogEntry.timestamp

Methods

toString()

toString(): string
Returns

string

Type Aliases

LogEntryLevel

type LogEntryLevel: "debug" | "info" | "warn" | "error";

Log entry severity levels.

Functions

defaultBuildLogger()

function defaultBuildLogger(options?: object): (logEntry: LogEntry) => void

Create a default build logger with animated timer display.

Parameters

ParameterTypeDescription
options?objectLogger configuration options
options.minLevel?LogEntryLevelMinimum log level to display (default: 'info')

Returns

Function

Logger function that accepts LogEntry instances

Parameters

ParameterType
logEntryLogEntry

Returns

void

Example

import { Template, defaultBuildLogger } from 'e2b'

const template = Template().fromPythonImage()

await Template.build(template, {
  alias: 'my-template',
  onBuildLogs: defaultBuildLogger({ minLevel: 'debug' })
})