// 测试打印任务服务日志写入
import { createServiceLogger } from './packages/shared-utils/src/utils/file-logger.js';

async function testPrintTaskLogging() {
  console.log('测试打印任务服务日志写入...');

  // 模拟在print-task.service.ts中的日志记录器创建
  const logger = createServiceLogger('feie-print-task-service', '/mnt/code/186-175-template-22/log-prd');

  // 模拟一些日志记录
  await logger.info('创建打印任务', { tenantId: 1, taskId: 'FEIE_TEST_001', printerSn: '924744594' });
  await logger.debug('调用飞鹅API', { sn: '924744594', content: '测试内容', times: 1 });
  await logger.warn('打印机响应慢', { taskId: 'FEIE_TEST_001', retryCount: 1 });
  await logger.error('打印失败', { error: '网络超时', code: -1, taskId: 'FEIE_TEST_001' });

  console.log('日志写入完成！');
  console.log('请检查文件: /mnt/code/186-175-template-22/log-prd/2025-12-12/feie-print-task-service.log');
}

testPrintTaskLogging().catch(console.error);