Skip to content

feat(tarko-agent-server-next): support replacing server global logger#1554

Merged
ulivz merged 4 commits intomainfrom
feat/server-logger
Sep 17, 2025
Merged

feat(tarko-agent-server-next): support replacing server global logger#1554
ulivz merged 4 commits intomainfrom
feat/server-logger

Conversation

@cjraft
Copy link
Collaborator

@cjraft cjraft commented Sep 17, 2025

Summary

  1. Support replacing server global logger (tarko ConsoleLogger is used by default)
const logger = {
  name: 'custom',
  info: (...splat) => {
    const requestId = getContext<{ Variables: ContextVariables }>().var.requestId;
    console.log(`[CUSTOM LOGGER] ${requestId}`, ...splat)
  },
  warn: console.warn,
  error: console.error,
  debug: console.debug,
  setLevel: () => {  }
}

server.setLogger(logger)
  1. Add ContextStorageHook so that other middleware and methods can easily get the request id
import { getContext } from 'hono/context-storage';

const logId = getContext<{ Variables: ContextVariables }>().var.requestId;

Checklist

  • Added or updated necessary tests (Optional).
  • Updated documentation to align with changes (Optional).
  • Verified no breaking changes, or prepared solutions for any occurring breaking changes (Optional).
  • My change does not involve the above items.

@netlify
Copy link

netlify bot commented Sep 17, 2025

Deploy Preview for agent-tars-docs ready!

Name Link
🔨 Latest commit 289b6fb
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/68cab858074cc8000858d9db
😎 Deploy Preview https://deploy-preview-1554--agent-tars-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ulivz ulivz changed the title Feat/server logger feat(tarko-agent-server-next): support replacing server global logger Sep 17, 2025
@ulivz ulivz merged commit 4228662 into main Sep 17, 2025
10 checks passed
@ulivz ulivz deleted the feat/server-logger branch September 17, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments