Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/api-client/base-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@ export const GENERIC_ERROR_MESSAGE =
'This error has been automatically tracked. Please try again.';

export class BaseClient {
protected apiUrl: string = '';
private _apiUrl: string = '';
protected token: string = '';
protected client: Client<paths> | undefined = undefined;

protected get apiUrl(): string {
return this._apiUrl;
}
protected set apiUrl(url: string) {
this._apiUrl = url.replace(/\/$/, '');
}

/**
* Make an HTTP request to the Galileo API and return the raw Axios response.
*/
Expand Down
18 changes: 2 additions & 16 deletions src/wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,25 +245,11 @@ export function log<T extends unknown[], R>(
// set via experimentContext.run() or init(). If no context exists, use getClient() to
// retrieve the last logger configured during the ongoing workflow.
const exp = experimentContext.getStore();
const logStore = loggerContext.getStore();

// Priority: logStore (loggerContext) > exp (experimentContext) > getClient()
const hasLogStoreData =
logStore &&
(logStore.logStreamName ||
logStore.sessionId ||
(logStore.parentStack && logStore.parentStack.length > 0));

const hasExpData =
exp && (exp.projectName || exp.experimentId || exp.logStreamName);

if (hasLogStoreData) {
// Use loggerContext data if available
logger = GalileoSingleton.getInstance().getLogger({
projectName: exp?.projectName,
experimentId: exp?.experimentId,
logstream: logStore?.logStreamName ?? exp?.logStreamName
});
} else if (hasExpData) {
if (hasExpData) {
// Use experimentContext data if available
logger = GalileoSingleton.getInstance().getLogger({
projectName: exp?.projectName,
Expand Down
Loading