@itwin/core-bentley
Advanced tools
Comparing version 5.0.0-dev.28 to 5.0.0-dev.32
@@ -1,4 +0,3 @@ | ||
export { staticLoggerMetadata } from "./staticLoggerMetadata"; | ||
export { RepositoryStatus } from "./RepositoryStatus"; | ||
export { DbChangeStage, DbConflictCause, DbConflictResolution, DbValueType } from "./BeSQLiteInternal"; | ||
//# sourceMappingURL=cross-package.d.ts.map |
@@ -7,5 +7,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DbValueType = exports.DbConflictResolution = exports.DbConflictCause = exports.DbChangeStage = exports.RepositoryStatus = exports.staticLoggerMetadata = void 0; | ||
var staticLoggerMetadata_1 = require("./staticLoggerMetadata"); | ||
Object.defineProperty(exports, "staticLoggerMetadata", { enumerable: true, get: function () { return staticLoggerMetadata_1.staticLoggerMetadata; } }); | ||
exports.DbValueType = exports.DbConflictResolution = exports.DbConflictCause = exports.DbChangeStage = exports.RepositoryStatus = void 0; | ||
var RepositoryStatus_1 = require("./RepositoryStatus"); | ||
@@ -12,0 +10,0 @@ Object.defineProperty(exports, "RepositoryStatus", { enumerable: true, get: function () { return RepositoryStatus_1.RepositoryStatus; } }); |
@@ -40,2 +40,18 @@ /** @packageDocumentation | ||
} | ||
/** A global set of metadata that should be included with every log message. | ||
* You can provide an object representing the metadata, or a function to be invoked to obtain the metadata object each | ||
* time a message is logged. | ||
* Each key-value pair of the object will be stringified and combined with the log message's per-call metadata. | ||
* The keys you provide to each method is used solely to identify your entries so that you can later update or delete them - these keys | ||
* are **not** included in log messages. Don't modify or remove metadata associated with keys that belong to someone else. | ||
* @note Each extra bit of metadata adds cost and overhead to the logging system. Avoid adding unnecessary or unnecessarily verbose metadata. | ||
* @see [[Logger.staticMetaData]] to access the global metadata. | ||
* @beta | ||
*/ | ||
export interface StaticLoggerMetaData { | ||
/** Add or update some metadata to be included with every logged message. */ | ||
set(key: string, metadata: LoggingMetaData): void; | ||
/** Remove metadata previously [[set]] using the specified `key`, so it will no longer be included with every logged message. */ | ||
delete(key: string): void; | ||
} | ||
/** Logger allows libraries and apps to report potentially useful information about operations, and it allows apps and users to control | ||
@@ -51,2 +67,3 @@ * how or if the logged information is displayed or collected. See [Learning about Logging]($docs/learning/common/Logging.md). | ||
private static _onLogLevelChanged; | ||
private static _staticMetaData; | ||
/** An event raised whenever [[setLevel]] or [[setLevelDefault]] is called. */ | ||
@@ -70,2 +87,6 @@ static get onLogLevelChanged(): BeEvent<() => void>; | ||
static logExceptionCallstacks: boolean; | ||
/** Contains metadata that should be included with every logged message. | ||
* @beta | ||
*/ | ||
static get staticMetaData(): StaticLoggerMetaData; | ||
/** Initialize the logger streams. Should be called at application initialization time. */ | ||
@@ -72,0 +93,0 @@ static initialize(logError?: LogFunction, logWarning?: LogFunction, logInfo?: LogFunction, logTrace?: LogFunction): void; |
@@ -14,3 +14,2 @@ "use strict"; | ||
const BentleyLoggerCategory_1 = require("./BentleyLoggerCategory"); | ||
const staticLoggerMetadata_1 = require("./internal/staticLoggerMetadata"); | ||
/** Use to categorize logging messages by severity. | ||
@@ -61,2 +60,8 @@ * @public | ||
} | ||
/** Contains metadata that should be included with every logged message. | ||
* @beta | ||
*/ | ||
static get staticMetaData() { | ||
return this._staticMetaData; | ||
} | ||
/** Initialize the logger streams. Should be called at application initialization time. */ | ||
@@ -79,3 +84,3 @@ static initialize(logError, logWarning, logInfo, logTrace) { | ||
const metaObj = {}; | ||
for (const meta of staticLoggerMetadata_1.staticLoggerMetadata) { | ||
for (const meta of this._staticMetaData) { | ||
const val = BentleyError_1.BentleyError.getMetaData(meta[1]); | ||
@@ -243,2 +248,3 @@ if (val) | ||
exports.Logger = Logger; | ||
Logger._staticMetaData = new Map(); | ||
Logger._categoryFilter = {}; | ||
@@ -245,0 +251,0 @@ /** Should the call stack be included when an exception is logged? */ |
@@ -1,4 +0,3 @@ | ||
export { staticLoggerMetadata } from "./staticLoggerMetadata"; | ||
export { RepositoryStatus } from "./RepositoryStatus"; | ||
export { DbChangeStage, DbConflictCause, DbConflictResolution, DbValueType } from "./BeSQLiteInternal"; | ||
//# sourceMappingURL=cross-package.d.ts.map |
@@ -5,5 +5,4 @@ /*--------------------------------------------------------------------------------------------- | ||
*--------------------------------------------------------------------------------------------*/ | ||
export { staticLoggerMetadata } from "./staticLoggerMetadata"; | ||
export { RepositoryStatus } from "./RepositoryStatus"; | ||
export { DbChangeStage, DbConflictCause, DbConflictResolution, DbValueType } from "./BeSQLiteInternal"; | ||
//# sourceMappingURL=cross-package.js.map |
@@ -40,2 +40,18 @@ /** @packageDocumentation | ||
} | ||
/** A global set of metadata that should be included with every log message. | ||
* You can provide an object representing the metadata, or a function to be invoked to obtain the metadata object each | ||
* time a message is logged. | ||
* Each key-value pair of the object will be stringified and combined with the log message's per-call metadata. | ||
* The keys you provide to each method is used solely to identify your entries so that you can later update or delete them - these keys | ||
* are **not** included in log messages. Don't modify or remove metadata associated with keys that belong to someone else. | ||
* @note Each extra bit of metadata adds cost and overhead to the logging system. Avoid adding unnecessary or unnecessarily verbose metadata. | ||
* @see [[Logger.staticMetaData]] to access the global metadata. | ||
* @beta | ||
*/ | ||
export interface StaticLoggerMetaData { | ||
/** Add or update some metadata to be included with every logged message. */ | ||
set(key: string, metadata: LoggingMetaData): void; | ||
/** Remove metadata previously [[set]] using the specified `key`, so it will no longer be included with every logged message. */ | ||
delete(key: string): void; | ||
} | ||
/** Logger allows libraries and apps to report potentially useful information about operations, and it allows apps and users to control | ||
@@ -51,2 +67,3 @@ * how or if the logged information is displayed or collected. See [Learning about Logging]($docs/learning/common/Logging.md). | ||
private static _onLogLevelChanged; | ||
private static _staticMetaData; | ||
/** An event raised whenever [[setLevel]] or [[setLevelDefault]] is called. */ | ||
@@ -70,2 +87,6 @@ static get onLogLevelChanged(): BeEvent<() => void>; | ||
static logExceptionCallstacks: boolean; | ||
/** Contains metadata that should be included with every logged message. | ||
* @beta | ||
*/ | ||
static get staticMetaData(): StaticLoggerMetaData; | ||
/** Initialize the logger streams. Should be called at application initialization time. */ | ||
@@ -72,0 +93,0 @@ static initialize(logError?: LogFunction, logWarning?: LogFunction, logInfo?: LogFunction, logTrace?: LogFunction): void; |
@@ -11,3 +11,2 @@ /*--------------------------------------------------------------------------------------------- | ||
import { BentleyLoggerCategory } from "./BentleyLoggerCategory"; | ||
import { staticLoggerMetadata } from "./internal/staticLoggerMetadata"; | ||
/** Use to categorize logging messages by severity. | ||
@@ -58,2 +57,8 @@ * @public | ||
} | ||
/** Contains metadata that should be included with every logged message. | ||
* @beta | ||
*/ | ||
static get staticMetaData() { | ||
return this._staticMetaData; | ||
} | ||
/** Initialize the logger streams. Should be called at application initialization time. */ | ||
@@ -76,3 +81,3 @@ static initialize(logError, logWarning, logInfo, logTrace) { | ||
const metaObj = {}; | ||
for (const meta of staticLoggerMetadata) { | ||
for (const meta of this._staticMetaData) { | ||
const val = BentleyError.getMetaData(meta[1]); | ||
@@ -239,2 +244,3 @@ if (val) | ||
} | ||
Logger._staticMetaData = new Map(); | ||
Logger._categoryFilter = {}; | ||
@@ -241,0 +247,0 @@ /** Should the call stack be included when an exception is logged? */ |
{ | ||
"name": "@itwin/core-bentley", | ||
"version": "5.0.0-dev.28", | ||
"version": "5.0.0-dev.32", | ||
"description": "Bentley JavaScript core components", | ||
@@ -33,3 +33,3 @@ "main": "lib/cjs/core-bentley.js", | ||
"vitest": "^2.1.0", | ||
"@itwin/build-tools": "5.0.0-dev.28" | ||
"@itwin/build-tools": "5.0.0-dev.32" | ||
}, | ||
@@ -36,0 +36,0 @@ "nyc": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2025040
317