# tencent/bqlog architecture

> Architecture diagram of the GitHub repository tencent/bqlog, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tencent/bqlog
- Repository: https://github.com/tencent/bqlog

## Overview

BqLog is a cross-language asynchronous logging system. Applications configure a named log through a language wrapper, submit formatted/category-tagged entries, and the core processes them through workers and appenders to console or files. Compressed log decoding is a separate user workflow; category-log generation and game-engine integrations are additional product branches. The README documents broader platform and encryption support; source excerpts only confirm selected internals, so uncertain implementation links are omitted.

Main entry points: [`src/bq_log/api/bq_log_api.cpp`](https://github.com/tencent/bqlog/blob/main/src/bq_log/api/bq_log_api.cpp) (Native API), [`src/bq_log/log/log_imp.cpp`](https://github.com/tencent/bqlog/blob/main/src/bq_log/log/log_imp.cpp) (Log Instance), [`src/bq_log/log/log_manager.cpp`](https://github.com/tencent/bqlog/blob/main/src/bq_log/log/log_manager.cpp) (Log Manager), [`src/bq_log/log/appender/appender_base.cpp`](https://github.com/tencent/bqlog/blob/main/src/bq_log/log/appender/appender_base.cpp) (Appender System)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Language Interfaces"]
  node_cppapi["C++ API<br/>[bq_log.h]"]
  node_java["Java Wrapper<br/>[log.java]"]
  node_csharp["C&#35; Wrapper<br/>[log.cs]"]
  node_ts["TypeScript Wrapper<br/>[log.ts]"]
  node_python["Python Wrapper<br/>[log.py]"]
  node_go["Go Wrapper<br/>[log.go]"]
end

subgraph group_engine["Logging Engine"]
  node_native["Native API<br/>[bq_log_api.cpp]"]
  node_manager["Log Manager<br/>[log_manager.cpp]"]
  node_log["Log Instance<br/>[log_imp.cpp]"]
  node_worker["Log Worker<br/>[log_worker.cpp]"]
  node_layout["Log Layout<br/>[layout.cpp]"]
  node_buffers["Log Buffers<br/>[log_buffer.cpp]"]
end

subgraph group_outputs["Output and Decode"]
  node_appenders["Appender System<br/>[appender_base.cpp]"]
  node_console["Console Appender"]
  node_files["File Appenders"]
  node_decoderapi["Decoder API<br/>[bq_log.h]"]
  node_decoder["Decoder Manager"]
  node_decodercli["Decoder CLI<br/>[main.cpp]"]
end

subgraph group_extensions["Product Extensions"]
  node_categorygen["Category Generator"]
  node_unity["Unity Integration"]
  node_unreal["Unreal Integration<br/>[BqLog.cpp]"]
end

subgraph group_foundation["Platform Foundation"]
  node_filemanager["File Manager<br/>[file_manager.cpp]"]
  node_crypto["Encryption Primitives<br/>[aes.cpp]"]
end

node_app(("Application"))
node_consoleout(("Console"))
node_filesystem[("File System")]

node_app -->|"logs through"| node_cppapi
node_app -->|"logs through"| node_java
node_app -->|"logs through"| node_csharp
node_app -->|"logs through"| node_ts
node_app -->|"logs through"| node_python
node_app -->|"logs through"| node_go
node_cppapi -->|"invokes"| node_native
node_java -->|"bridges to"| node_native
node_csharp -->|"bridges to"| node_native
node_ts -->|"bridges to"| node_native
node_python -->|"bridges to"| node_native
node_go -->|"bridges to"| node_native
node_native -->|"dispatches"| node_manager
node_manager -->|"creates"| node_log
node_manager -->|"processes with"| node_worker
node_worker -->|"processes"| node_log
node_log -->|"buffers entries"| node_buffers
node_log -->|"formats entries"| node_layout
node_log -->|"dispatches entries"| node_appenders
node_appenders -->|"writes to"| node_console
node_appenders -->|"writes to"| node_files
node_console -->|"outputs"| node_consoleout
node_files -->|"writes via"| node_filemanager
node_filemanager -->|"operates on"| node_filesystem
node_app -->|"requests decode"| node_decoderapi
node_decoderapi -->|"dispatches"| node_decoder
node_decodercli -->|"uses"| node_decoder
node_decoder -->|"reads via"| node_filemanager
node_app -->|"generates category code"| node_categorygen
node_app -.->|"integrates with"| node_unity
node_app -.->|"integrates with"| node_unreal
node_files -.->|"optional encryption"| node_crypto

click node_cppapi "https://github.com/tencent/bqlog/blob/main/include/bq_log/bq_log.h"
click node_java "https://github.com/tencent/bqlog/blob/main/wrapper/java/src/bq/log.java"
click node_csharp "https://github.com/tencent/bqlog/blob/main/wrapper/csharp/src/bq/log.cs"
click node_ts "https://github.com/tencent/bqlog/blob/main/wrapper/typescript/src/bq/log.ts"
click node_python "https://github.com/tencent/bqlog/blob/main/wrapper/python/src/bq/log.py"
click node_go "https://github.com/tencent/bqlog/blob/main/wrapper/go/src/bq/log.go"
click node_native "https://github.com/tencent/bqlog/blob/main/src/bq_log/api/bq_log_api.cpp"
click node_manager "https://github.com/tencent/bqlog/blob/main/src/bq_log/log/log_manager.cpp"
click node_log "https://github.com/tencent/bqlog/blob/main/src/bq_log/log/log_imp.cpp"
click node_worker "https://github.com/tencent/bqlog/blob/main/src/bq_log/log/log_worker.cpp"
click node_layout "https://github.com/tencent/bqlog/blob/main/src/bq_log/log/layout.cpp"
click node_buffers "https://github.com/tencent/bqlog/blob/main/src/bq_log/types/buffer/log_buffer.cpp"
click node_appenders "https://github.com/tencent/bqlog/blob/main/src/bq_log/log/appender/appender_base.cpp"
click node_console "https://github.com/tencent/bqlog/blob/main/src/bq_log/log/appender/appender_console.cpp"
click node_files "https://github.com/tencent/bqlog/blob/main/src/bq_log/log/appender/appender_file_base.cpp"
click node_filemanager "https://github.com/tencent/bqlog/blob/main/src/bq_common/utils/file_manager.cpp"
click node_decoderapi "https://github.com/tencent/bqlog/blob/main/include/bq_log/bq_log.h"
click node_decoder "https://github.com/tencent/bqlog/blob/main/src/bq_log/log/decoder/appender_decoder_manager.cpp"
click node_decodercli "https://github.com/tencent/bqlog/blob/main/tools/log_decoder/main.cpp"
click node_categorygen "https://github.com/tencent/bqlog/blob/main/tools/category_log_generator/category_generator.cpp"
click node_unity "https://github.com/tencent/bqlog/blob/main/plugin/unity/Editor/src/bq_log_editor_bootstrap.cs"
click node_unreal "https://github.com/tencent/bqlog/blob/main/plugin/unreal/BqLog/Source/BqLog/Private/BqLog.cpp"
click node_crypto "https://github.com/tencent/bqlog/blob/main/src/bq_common/encryption/aes.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cppapi,node_java,node_csharp,node_ts,node_python,node_go toneBlue
class node_native,node_manager,node_log,node_worker,node_layout,node_buffers,node_filesystem toneAmber
class node_appenders,node_console,node_files,node_decoderapi,node_decoder,node_decodercli toneMint
class node_categorygen,node_unity,node_unreal toneRose
class node_filemanager,node_crypto,node_app,node_consoleout toneIndigo
```

## Components

### Language Interfaces

- [C++ API](https://github.com/tencent/bqlog/blob/main/include/bq_log/bq_log.h): `include/bq_log/bq_log.h`
- [Java Wrapper](https://github.com/tencent/bqlog/blob/main/wrapper/java/src/bq/log.java): `wrapper/java/src/bq/log.java`
- [C# Wrapper](https://github.com/tencent/bqlog/blob/main/wrapper/csharp/src/bq/log.cs): `wrapper/csharp/src/bq/log.cs`
- [TypeScript Wrapper](https://github.com/tencent/bqlog/blob/main/wrapper/typescript/src/bq/log.ts): `wrapper/typescript/src/bq/log.ts`
- [Python Wrapper](https://github.com/tencent/bqlog/blob/main/wrapper/python/src/bq/log.py): `wrapper/python/src/bq/log.py`
- [Go Wrapper](https://github.com/tencent/bqlog/blob/main/wrapper/go/src/bq/log.go): `wrapper/go/src/bq/log.go`

### Logging Engine

- [Native API](https://github.com/tencent/bqlog/blob/main/src/bq_log/api/bq_log_api.cpp): `src/bq_log/api/bq_log_api.cpp`
- [Log Manager](https://github.com/tencent/bqlog/blob/main/src/bq_log/log/log_manager.cpp): `src/bq_log/log/log_manager.cpp`
- [Log Instance](https://github.com/tencent/bqlog/blob/main/src/bq_log/log/log_imp.cpp): `src/bq_log/log/log_imp.cpp`
- [Log Worker](https://github.com/tencent/bqlog/blob/main/src/bq_log/log/log_worker.cpp): `src/bq_log/log/log_worker.cpp`
- [Log Layout](https://github.com/tencent/bqlog/blob/main/src/bq_log/log/layout.cpp): `src/bq_log/log/layout.cpp`
- [Log Buffers](https://github.com/tencent/bqlog/blob/main/src/bq_log/types/buffer/log_buffer.cpp): `src/bq_log/types/buffer/log_buffer.cpp`

### Output and Decode

- [Appender System](https://github.com/tencent/bqlog/blob/main/src/bq_log/log/appender/appender_base.cpp): `src/bq_log/log/appender/appender_base.cpp`
- [Console Appender](https://github.com/tencent/bqlog/blob/main/src/bq_log/log/appender/appender_console.cpp): `src/bq_log/log/appender/appender_console.cpp`
- [File Appenders](https://github.com/tencent/bqlog/blob/main/src/bq_log/log/appender/appender_file_base.cpp): `src/bq_log/log/appender/appender_file_base.cpp`
- [Decoder API](https://github.com/tencent/bqlog/blob/main/include/bq_log/bq_log.h): `include/bq_log/bq_log.h`
- [Decoder Manager](https://github.com/tencent/bqlog/blob/main/src/bq_log/log/decoder/appender_decoder_manager.cpp): `src/bq_log/log/decoder/appender_decoder_manager.cpp`
- [Decoder CLI](https://github.com/tencent/bqlog/blob/main/tools/log_decoder/main.cpp): `tools/log_decoder/main.cpp`

### Product Extensions

- [Category Generator](https://github.com/tencent/bqlog/blob/main/tools/category_log_generator/category_generator.cpp): `tools/category_log_generator/category_generator.cpp`
- [Unity Integration](https://github.com/tencent/bqlog/blob/main/plugin/unity/Editor/src/bq_log_editor_bootstrap.cs): `plugin/unity/Editor/src/bq_log_editor_bootstrap.cs`
- [Unreal Integration](https://github.com/tencent/bqlog/blob/main/plugin/unreal/BqLog/Source/BqLog/Private/BqLog.cpp): `plugin/unreal/BqLog/Source/BqLog/Private/BqLog.cpp`

### Platform Foundation

- [File Manager](https://github.com/tencent/bqlog/blob/main/src/bq_common/utils/file_manager.cpp): `src/bq_common/utils/file_manager.cpp`
- [Encryption Primitives](https://github.com/tencent/bqlog/blob/main/src/bq_common/encryption/aes.cpp): `src/bq_common/encryption/aes.cpp`

### Other components

- **Application**
- **Console**
- **File System**

## Connections

- Application → C++ API: logs through
- Application → Java Wrapper: logs through
- Application → C# Wrapper: logs through
- Application → TypeScript Wrapper: logs through
- Application → Python Wrapper: logs through
- Application → Go Wrapper: logs through
- C++ API → Native API: invokes
- Java Wrapper → Native API: bridges to
- C# Wrapper → Native API: bridges to
- TypeScript Wrapper → Native API: bridges to
- Python Wrapper → Native API: bridges to
- Go Wrapper → Native API: bridges to
- Native API → Log Manager: dispatches
- Log Manager → Log Instance: creates
- Log Manager → Log Worker: processes with
- Log Worker → Log Instance: processes
- Log Instance → Log Buffers: buffers entries
- Log Instance → Log Layout: formats entries
- Log Instance → Appender System: dispatches entries
- Appender System → Console Appender: writes to
- Appender System → File Appenders: writes to
- Console Appender → Console: outputs
- File Appenders → File Manager: writes via
- File Manager → File System: operates on
- Application → Decoder API: requests decode
- Decoder API → Decoder Manager: dispatches
- Decoder CLI → Decoder Manager: uses
- Decoder Manager → File Manager: reads via
- Application → Category Generator: generates category code
- Application → Unity Integration: integrates with
- Application → Unreal Integration: integrates with
- File Appenders → Encryption Primitives: optional encryption
