fix: suppress LogTape context-local storage warning
Add AsyncLocalStorage to LogTape configure() to fix the repeated "Context-local storage is not configured" warning that appeared before every Fedify log entry. Also remove unused getLogger import.
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
* and inbox.js with Fedify's battle-tested implementations.
|
* and inbox.js with Fedify's battle-tested implementations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { AsyncLocalStorage } from "node:async_hooks";
|
||||||
import { Temporal } from "@js-temporal/polyfill";
|
import { Temporal } from "@js-temporal/polyfill";
|
||||||
import {
|
import {
|
||||||
Endpoints,
|
Endpoints,
|
||||||
@@ -16,7 +17,7 @@ import {
|
|||||||
createFederation,
|
createFederation,
|
||||||
importSpki,
|
importSpki,
|
||||||
} from "@fedify/fedify";
|
} from "@fedify/fedify";
|
||||||
import { configure, getConsoleSink, getLogger } from "@logtape/logtape";
|
import { configure, getConsoleSink } from "@logtape/logtape";
|
||||||
import { MongoKvStore } from "./kv-store.js";
|
import { MongoKvStore } from "./kv-store.js";
|
||||||
import { registerInboxListeners } from "./inbox-listeners.js";
|
import { registerInboxListeners } from "./inbox-listeners.js";
|
||||||
|
|
||||||
@@ -45,6 +46,7 @@ export function setupFederation(options) {
|
|||||||
if (!_logtapeConfigured) {
|
if (!_logtapeConfigured) {
|
||||||
_logtapeConfigured = true;
|
_logtapeConfigured = true;
|
||||||
configure({
|
configure({
|
||||||
|
contextLocalStorage: new AsyncLocalStorage(),
|
||||||
sinks: {
|
sinks: {
|
||||||
console: getConsoleSink(),
|
console: getConsoleSink(),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user