Skip to content

Commit eed781b

Browse files
authored
Merge pull request #10628 from everpcpc/fix-log
chore(query): do not write duplicate query log
2 parents b22e956 + 6aa1eeb commit eed781b

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

.github/actions/artifact_download/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ runs:
4646
fi
4747
echo "src=${src}" >> $GITHUB_OUTPUT
4848
49-
- uses: actions/download-artifact@v2
49+
- uses: actions/download-artifact@v3
5050
if: steps.info.outputs.src == 'github'
5151
with:
5252
name: ${{ inputs.profile }}-${{ inputs.sha }}-${{ inputs.target }}-${{ inputs.category }}

.github/workflows/backport.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
dockerhub_user: ${{ secrets.DOCKERHUB_USERNAME }}
7878
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
7979
- name: Download binaries
80-
uses: actions/download-artifact@v2
80+
uses: actions/download-artifact@v3
8181
with:
8282
name: databend
8383
path: distro

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ jobs:
496496
prerelease: true
497497
latest: true
498498
- name: download sha256sums
499-
uses: actions/download-artifact@v2
499+
uses: actions/download-artifact@v3
500500
with:
501501
name: sha256sums
502502
- shell: bash

src/query/service/src/interpreters/interpreter_query_log.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,14 @@ fn error_fields(log_type: LogType, err: Option<ErrorCode>) -> (LogType, i32, Str
6060

6161
impl InterpreterQueryLog {
6262
fn write_log(event: QueryLogElement) -> Result<()> {
63-
info!("{}", serde_json::to_string(&event)?);
64-
63+
let event_str = serde_json::to_string(&event)?;
6564
if let Some(logger) = QueryLogger::instance().get_subscriber() {
66-
let event_str = serde_json::to_string(&event)?;
6765
subscriber::with_default(logger, || {
6866
info!("{}", event_str);
6967
});
68+
} else {
69+
info!("{}", event_str);
7070
};
71-
7271
QueryLogQueue::instance()?.append_data(event)
7372
}
7473

0 commit comments

Comments
 (0)