feat: Add stack trace utility and enhance logging across various modules

This commit is contained in:
2024-12-31 15:14:30 +08:00
parent 5131515770
commit 730b673954
15 changed files with 311 additions and 54 deletions

View File

@@ -1,6 +1,9 @@
import { ThumbnailFormat } from "../config.ts";
import { ThumbnailAlign } from "./base.ts";
import { type ThumbnailConfig, ThumbnailGenMethod } from "./base.ts";
import { base_logger } from "../utils/logger.ts";
const logger = base_logger.get_logger("thumbnail-ffmpeg-binary");
export async function check_ffmpeg_binary(p: string) {
const cmd = new Deno.Command(p, {
@@ -114,9 +117,9 @@ export async function fb_generate_thumbnail(
if (s.code !== 0) {
try {
const d = (new TextDecoder()).decode(s.stderr);
console.log(d);
logger.warn(d);
} catch (_) {
console.log(s.stderr);
logger.warn(s.stderr);
}
}
return s.code === 0;