Skip to content

feat: add structured logger - #96

Merged
Yuan325 merged 5 commits into
mainfrom
structured-log
Nov 26, 2024
Merged

Yuan325 merged 5 commits into
mainfrom
structured-log

Conversation

@Yuan325

@Yuan325 Yuan325 commented Nov 26, 2024 •

Copy link
Copy Markdown
Contributor

Logging support 4 different types of logging (debug, info, warn, error).

Example of structured logger:

{
  "timestamp":"2024-11-04T16:45:11.987299-08:00",
  "severity":"ERROR",
  "logging.googleapis.com/sourceLocation":{
    "function":"github.com/googleapis/genai-toolbox/internal/log.(*StructuredLogger).Errorf",
    "file":"/Users/yuanteoh/github/genai-toolbox/internal/log/log.go","line":157
  },
  "message":"unable to parse tool file at \"tools.yaml\": \"cloud-sql-postgres1\" is not a valid kind of data source"
}
{
  "timestamp":"2024-11-04T16:45:11.987562-08:00",
  "severity":"INFO",
  "logging.googleapis.com/sourceLocation":{
    "function":"github.com/googleapis/genai-toolbox/internal/log.(*StructuredLogger).Infof",
    "file":"/Users/yuanteoh/github/genai-toolbox/internal/log/log.go","line":147
  },
  "message":"Initalized 0 sources.\n"
}

Base automatically changed from log-support to main November 26, 2024 20:51
@Yuan325
Yuan325 merged commit 5e20417 into main Nov 26, 2024
@Yuan325
Yuan325 deleted the structured-log branch November 26, 2024 21:57
duwenxin99 pushed a commit that referenced this pull request Dec 10, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.0.3](v0.0.2...v0.0.3)
(2024-12-10)


### Features

* Add --log-level and --logging-format flags
([#97](#97))
([9a0f618](9a0f618))
* Add options for command
([#110](#110))
([5c690c5](5c690c5))
* Add Spanner source and tool
([#90](#90))
([890914a](890914a))
* Add std logger
([#95](#95))
([6a8feb5](6a8feb5))
* Add structured logger
([#96](#96))
([5e20417](5e20417))
* **source/alloydb-pg:** Add configuration for public and private IP
([#103](#103))
([e88ec40](e88ec40))
* **source/cloudsql-pg:** Add configuration for public and private IP
([#114](#114))
([6479c1d](6479c1d))


### Bug Fixes

* Fix go test workflow
([#84](#84))
([8c2c373](8c2c373))
* Fix issue causing client session to not close properly while closing
SDK. ([#81](#81))
([9d360e1](9d360e1))
* Fix test cases for ip_type
([#115](#115))
([5528bec](5528bec))
* Fix the errors showing up after setting up mypy type checker.
([#74](#74))
([522bbef](522bbef))
* **llamaindex-sdk:** Fix issue causing client session to not close
properly while closing SDK.
([#82](#82))
([fa03376](fa03376))


### Miscellaneous Chores

* Release 0.0.3
([#122](#122))
([626e12f](626e12f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
jeffreyrubi pushed a commit to jeffreyrubi/genai-toolbox that referenced this pull request Jun 7, 2025
Logging support 4 different types of logging (debug, info, warn, error).

Example of structured logger:

```
{
  "timestamp":"2024-11-04T16:45:11.987299-08:00",
  "severity":"ERROR",
  "logging.googleapis.com/sourceLocation":{
    "function":"github.com/googleapis/genai-toolbox/internal/log.(*StructuredLogger).Errorf",
    "file":"/Users/yuanteoh/github/genai-toolbox/internal/log/log.go","line":157
  },
  "message":"unable to parse tool file at \"tools.yaml\": \"cloud-sql-postgres1\" is not a valid kind of data source"
}
```

```
{
  "timestamp":"2024-11-04T16:45:11.987562-08:00",
  "severity":"INFO",
  "logging.googleapis.com/sourceLocation":{
    "function":"github.com/googleapis/genai-toolbox/internal/log.(*StructuredLogger).Infof",
    "file":"/Users/yuanteoh/github/genai-toolbox/internal/log/log.go","line":147
  },
  "message":"Initalized 0 sources.\n"
}
```
jeffreyrubi pushed a commit to jeffreyrubi/genai-toolbox that referenced this pull request Jun 7, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.0.3](googleapis/mcp-toolbox@v0.0.2...v0.0.3)
(2024-12-10)


### Features

* Add --log-level and --logging-format flags
([googleapis#97](googleapis#97))
([9a0f618](googleapis@9a0f618))
* Add options for command
([googleapis#110](googleapis#110))
([5c690c5](googleapis@5c690c5))
* Add Spanner source and tool
([googleapis#90](googleapis#90))
([890914a](googleapis@890914a))
* Add std logger
([googleapis#95](googleapis#95))
([6a8feb5](googleapis@6a8feb5))
* Add structured logger
([googleapis#96](googleapis#96))
([5e20417](googleapis@5e20417))
* **source/alloydb-pg:** Add configuration for public and private IP
([googleapis#103](googleapis#103))
([e88ec40](googleapis@e88ec40))
* **source/cloudsql-pg:** Add configuration for public and private IP
([googleapis#114](googleapis#114))
([6479c1d](googleapis@6479c1d))


### Bug Fixes

* Fix go test workflow
([googleapis#84](googleapis#84))
([8c2c373](googleapis@8c2c373))
* Fix issue causing client session to not close properly while closing
SDK. ([googleapis#81](googleapis#81))
([9d360e1](googleapis@9d360e1))
* Fix test cases for ip_type
([googleapis#115](googleapis#115))
([5528bec](googleapis@5528bec))
* Fix the errors showing up after setting up mypy type checker.
([googleapis#74](googleapis#74))
([522bbef](googleapis@522bbef))
* **llamaindex-sdk:** Fix issue causing client session to not close
properly while closing SDK.
([googleapis#82](googleapis#82))
([fa03376](googleapis@fa03376))


### Miscellaneous Chores

* Release 0.0.3
([googleapis#122](googleapis#122))
([626e12f](googleapis@626e12f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
NightStack15 added a commit to NightStack15/googleapis-_-genai-toolbox that referenced this pull request Mar 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.0.3](googleapis/mcp-toolbox@v0.0.2...v0.0.3)
(2024-12-10)


### Features

* Add --log-level and --logging-format flags
([#97](googleapis/mcp-toolbox#97))
([9a0f618](googleapis/mcp-toolbox@9a0f618))
* Add options for command
([#110](googleapis/mcp-toolbox#110))
([5c690c5](googleapis/mcp-toolbox@5c690c5))
* Add Spanner source and tool
([#90](googleapis/mcp-toolbox#90))
([890914a](googleapis/mcp-toolbox@890914a))
* Add std logger
([#95](googleapis/mcp-toolbox#95))
([6a8feb5](googleapis/mcp-toolbox@6a8feb5))
* Add structured logger
([#96](googleapis/mcp-toolbox#96))
([5e20417](googleapis/mcp-toolbox@5e20417))
* **source/alloydb-pg:** Add configuration for public and private IP
([#103](googleapis/mcp-toolbox#103))
([e88ec40](googleapis/mcp-toolbox@e88ec40))
* **source/cloudsql-pg:** Add configuration for public and private IP
([#114](googleapis/mcp-toolbox#114))
([6479c1d](googleapis/mcp-toolbox@6479c1d))


### Bug Fixes

* Fix go test workflow
([#84](googleapis/mcp-toolbox#84))
([8c2c373](googleapis/mcp-toolbox@8c2c373))
* Fix issue causing client session to not close properly while closing
SDK. ([#81](googleapis/mcp-toolbox#81))
([9d360e1](googleapis/mcp-toolbox@9d360e1))
* Fix test cases for ip_type
([#115](googleapis/mcp-toolbox#115))
([5528bec](googleapis/mcp-toolbox@5528bec))
* Fix the errors showing up after setting up mypy type checker.
([#74](googleapis/mcp-toolbox#74))
([522bbef](googleapis/mcp-toolbox@522bbef))
* **llamaindex-sdk:** Fix issue causing client session to not close
properly while closing SDK.
([#82](googleapis/mcp-toolbox#82))
([fa03376](googleapis/mcp-toolbox@fa03376))


### Miscellaneous Chores

* Release 0.0.3
([#122](googleapis/mcp-toolbox#122))
([626e12f](googleapis/mcp-toolbox@626e12f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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