README fixes, new RoundedLocal time format, more local source options

* i wanted to make sure `undefined` was handled properly. seems like it is.
* tested with Bun, works. Deno runs faster though, by about 1.8µs/message construction!
* Removed skeletons from closet (bug fixes)
* Sources can now optionally specify their own time format and/or log timing
* Requests and Responses now can be converted and displayed (no bodies)
This commit is contained in:
2025-07-19 05:00:07 -04:00
parent b6f3ccb73c
commit 44784130f9
10 changed files with 706 additions and 117 deletions

109
benchmark/deno.ts Normal file
View File

@@ -0,0 +1,109 @@
import Logging, { LogTiming, MessageType } from "@proxnet/undead-logging";
import chalk from "chalk";
// SYNC
Deno.bench({
name: "1 Log",
group: "timing-sync",
fn: () => {
const log = new Logging("Bench");
log.bench(MessageType.Info, chalk.black, 'a');
}
});
Deno.bench({
name: "100 Logs",
group: "timing-sync",
fn: () => {
const log = new Logging("Bench");
for (let i = 0; i < 100; i++)
log.bench(MessageType.Info, chalk.black, 'a');
}
});
Deno.bench({
name: "1k Logs",
group: "timing-sync",
fn: () => {
const log = new Logging("Bench");
for (let i = 0; i < 1_000; i++)
log.bench(MessageType.Info, chalk.black, 'a');
}
});
Deno.bench({
name: "10k Logs",
group: "timing-sync",
fn: () => {
const log = new Logging("Bench");
for (let i = 0; i < 10_000; i++)
log.bench(MessageType.Info, chalk.black, 'a');
}
});
Deno.bench({
name: "100k Logs",
group: "timing-sync",
fn: () => {
const log = new Logging("Bench");
log.logTiming = LogTiming.Deferred;
for (let i = 0; i < 100_000; i++)
log.bench(MessageType.Info, chalk.black, 'a');
}
});
// DEFERRED
Deno.bench({
name: "1 Log",
group: "timing-deferred",
fn: () => {
const log = new Logging("Bench");
log.logTiming = LogTiming.Deferred;
log.bench(MessageType.Info, chalk.black, 'a');
}
});
Deno.bench({
name: "100 Logs",
group: "timing-deferred",
fn: () => {
const log = new Logging("Bench");
log.logTiming = LogTiming.Deferred;
for (let i = 0; i < 100; i++)
log.bench(MessageType.Info, chalk.black, 'a');
}
});
Deno.bench({
name: "1k Logs",
group: "timing-deferred",
fn: () => {
const log = new Logging("Bench");
log.logTiming = LogTiming.Deferred;
for (let i = 0; i < 1_000; i++)
log.bench(MessageType.Info, chalk.black, 'a');
}
});
Deno.bench({
name: "10k Logs",
group: "timing-deferred",
fn: () => {
const log = new Logging("Bench");
log.logTiming = LogTiming.Deferred;
for (let i = 0; i < 10_000; i++)
log.bench(MessageType.Info, chalk.black, 'a');
}
});
Deno.bench({
name: "100k Logs",
group: "timing-deferred",
fn: () => {
const log = new Logging("Bench");
for (let i = 0; i < 100_000; i++)
log.bench(MessageType.Info, chalk.black, 'a');
}
});