debug: streaming, simplify other logs

This commit is contained in:
Alex Gleason
2023-12-27 20:39:38 -06:00
parent 4e01e8e626
commit 7b9baef165
3 changed files with 6 additions and 3 deletions

View File

@@ -1,11 +1,13 @@
import { type AppController } from '@/app.ts';
import { z } from '@/deps.ts';
import { Debug, z } from '@/deps.ts';
import { type DittoFilter } from '@/filter.ts';
import { getAuthor, getFeedPubkeys } from '@/queries.ts';
import { Sub } from '@/subs.ts';
import { bech32ToPubkey } from '@/utils.ts';
import { renderStatus } from '@/views/mastodon/statuses.ts';
const debug = Debug('ditto:streaming');
/**
* Streaming timelines/categories.
* https://docs.joinmastodon.org/methods/streaming/#streams
@@ -49,6 +51,7 @@ const streamingController: AppController = (c) => {
function send(name: string, payload: object) {
if (socket.readyState === WebSocket.OPEN) {
debug('send', name, JSON.stringify(payload));
socket.send(JSON.stringify({
event: name,
payload: JSON.stringify(payload),