UNPKG

@warp-drive/build-config

Version:

Provides Build Configuration for projects using WarpDrive or EmberData

182 lines (176 loc) 4.64 kB
/** @module @warp-drive/build-config */ /** * ## Debug Logging * * Many portions of the internals are helpfully instrumented with logging. * This instrumentation is always removed from production builds. * * Log instrumentation is "regionalized" to specific concepts and concerns * to enable you to enable/disable just the areas you are interested in. * * To activate a particular group of logs set the appropriate flag to `true` * either in your build config or via the runtime helper. * * * ### Activation Via Runtime Helper * * A runtime helper is attached to `globalThis` to enable activation of the logs * from anywhere in your application including from the devtools panel. * * The runtime helper overrides any build config settings for the given flag * for the current browser tab. It stores the configuration you give it in * `sessionStorage` so that it persists across page reloads of the current tab, * but not across browser tabs or windows. Thus if you need to deactivate the * logging, you can call the helper again with the same flag set to `false` or * just open a new tab/window. * * Example Usage: * * ```ts * setWarpDriveLogging({ * LOG_CACHE: true, * LOG_REQUESTS: true, * }) * ``` * * ### Activation Via Build Config * * ```ts * setConfig(__dirname, app, { * debug: { * LOG_CACHE: false, // data store received to update cache with * LOG_NOTIFICATIONS: false, * LOG_REQUESTS: false, * LOG_REQUEST_STATUS: false, * LOG_IDENTIFIERS: false, * LOG_GRAPH: false, * LOG_INSTANCE_CACHE: false, * LOG_METRIC_COUNTS: false, * DEBUG_RELATIONSHIP_NOTIFICATIONS: false, * } * }); * ``` * * @class DebugLogging * @public */ /** * log cache updates for both local * and remote state. Note in some older versions * this was called `LOG_PAYLOADS` and was one * of three flags that controlled logging of * cache updates. This is now the only flag. * * The others were `LOG_OPERATIONS` and `LOG_MUTATIONS`. * * @property LOG_CACHE * @type {Boolean} * @public */ const LOG_CACHE = false; /** * Log decisions made by the Basic CachePolicy * * @property LOG_CACHE_POLICY * @type {Boolean} * @public */ const LOG_CACHE_POLICY = false; /** * log notifications received by the NotificationManager * * @property LOG_NOTIFICATIONS * @type {Boolean} * @public */ const LOG_NOTIFICATIONS = false; /** * log requests issued by the RequestManager * * @property LOG_REQUESTS * @type {Boolean} * @public */ const LOG_REQUESTS = false; /** * log updates to requests the store has issued to * the network (adapter) to fulfill. * * @property LOG_REQUEST_STATUS * @type {Boolean} * @public */ const LOG_REQUEST_STATUS = false; /** * log peek, generation and updates to * Record Identifiers. * * @property LOG_IDENTIFIERS * @type {Boolean} * @public */ const LOG_IDENTIFIERS = false; /** * log updates received by the graph (relationship pointer storage) * * @property LOG_GRAPH * @type {Boolean} * @public */ const LOG_GRAPH = false; /** * log creation/removal of RecordData and Record * instances. * * @property LOG_INSTANCE_CACHE * @type {Boolean} * @public */ const LOG_INSTANCE_CACHE = false; /** * Log key count metrics, useful for performance * debugging. * * @property LOG_METRIC_COUNTS * @type {Boolean} * @public */ const LOG_METRIC_COUNTS = false; /** * Helps when debugging causes of a change notification * when processing an update to a hasMany relationship. * * @property DEBUG_RELATIONSHIP_NOTIFICATIONS * @type {Boolean} * @public */ const DEBUG_RELATIONSHIP_NOTIFICATIONS = false; /** * A private flag to enable logging of the native Map/Set * constructor and method calls. * * EXTREMELY MALPERFORMANT * * LOG_METRIC_COUNTS must also be enabled. * * @typedoc */ const __INTERNAL_LOG_NATIVE_MAP_SET_COUNTS = false; const LOGGING = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, DEBUG_RELATIONSHIP_NOTIFICATIONS, LOG_CACHE, LOG_CACHE_POLICY, LOG_GRAPH, LOG_IDENTIFIERS, LOG_INSTANCE_CACHE, LOG_METRIC_COUNTS, LOG_NOTIFICATIONS, LOG_REQUESTS, LOG_REQUEST_STATUS, __INTERNAL_LOG_NATIVE_MAP_SET_COUNTS }, Symbol.toStringTag, { value: 'Module' })); export { DEBUG_RELATIONSHIP_NOTIFICATIONS as D, LOGGING as L, __INTERNAL_LOG_NATIVE_MAP_SET_COUNTS as _, LOG_CACHE as a, LOG_CACHE_POLICY as b, LOG_NOTIFICATIONS as c, LOG_REQUESTS as d, LOG_REQUEST_STATUS as e, LOG_IDENTIFIERS as f, LOG_GRAPH as g, LOG_INSTANCE_CACHE as h, LOG_METRIC_COUNTS as i }; //# sourceMappingURL=debugging-BtpYr1v0.js.map