med-log
Version:
Logging package intended for gxp/samd regulated environments hosted in the cloud
23 lines (20 loc) • 794 B
text/typescript
import { IAzure } from "./IAzure";
import { LogLevel } from '../logLevel';
import { createSharedKeyService, log } from "../azure/service";
export class AzureSharedKey implements IAzure {
origin: string;
keyToken: string;
container: string;
storageName: string;
constructor(storageName: string, keyToken: string, origin: string, container: string = "log") {
this.origin = origin;
this.container = container;
this.storageName = storageName;
this.keyToken = keyToken;
}
async log(logLevel: LogLevel, ...text: string[]): Promise<boolean> {
let service = createSharedKeyService(this);
let response = await log(service, this, logLevel, ...text)
return `${response}`.startsWith("2");
}
};