mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
Add a2a-server package to gemini-cli (#6597)
This commit is contained in:
28
packages/a2a-server/src/logger.ts
Normal file
28
packages/a2a-server/src/logger.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import winston from 'winston';
|
||||
|
||||
const logger = winston.createLogger({
|
||||
level: 'info',
|
||||
format: winston.format.combine(
|
||||
// First, add a timestamp to the log info object
|
||||
winston.format.timestamp({
|
||||
format: 'YYYY-MM-DD HH:mm:ss.SSS A', // Custom timestamp format
|
||||
}),
|
||||
// Here we define the custom output format
|
||||
winston.format.printf((info) => {
|
||||
const { level, timestamp, message, ...rest } = info;
|
||||
return (
|
||||
`[${level.toUpperCase()}] ${timestamp} -- ${message}` +
|
||||
`${Object.keys(rest).length > 0 ? `\n${JSON.stringify(rest, null, 2)}` : ''}`
|
||||
); // Only print ...rest if present
|
||||
}),
|
||||
),
|
||||
transports: [new winston.transports.Console()],
|
||||
});
|
||||
|
||||
export { logger };
|
||||
Reference in New Issue
Block a user