Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions __tests__/ut/commands/logs_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ describe('Logs', () => {
);

expect(result).toBe(
'__topic__:"FCLogs:test-function" and baseQuery and searchTerm and qualifier: "LATEST" and instanceID: "inst-456" and requestId: "req-123"',
'__topic__:"FCLogs:test-function" and baseQuery and searchTerm and "LATEST" and "inst-456" and "req-123"',
);
});

Expand All @@ -592,7 +592,7 @@ describe('Logs', () => {
);

expect(result).toBe(
'(__topic__:"FCLogs:test-function" or __topic__:"FCInstanceEvents:/test-function") and instanceID: "inst-456"',
'(__topic__:"FCLogs:test-function" or __topic__:"FCInstanceEvents:/test-function") and "inst-456"',
);
});

Expand All @@ -609,7 +609,7 @@ describe('Logs', () => {
expect(result).toBe('__topic__:"FCLogs:test-function"');
});

it('should use field-specific syntax for qualifier', () => {
it('should use quoted full-text search for qualifier', () => {
const result = (logs as any).getSlsQuery(
null,
null,
Expand All @@ -619,7 +619,7 @@ describe('Logs', () => {
'__topic__:"FCLogs:test-function"',
);

expect(result).toBe('__topic__:"FCLogs:test-function" and qualifier: "LATEST"');
expect(result).toBe('__topic__:"FCLogs:test-function" and "LATEST"');
});
});

Expand Down
2 changes: 1 addition & 1 deletion publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Type: Component
Name: fc3
Provider:
- 阿里云
Version: 0.1.19
Version: 0.1.20
Description: 阿里云函数计算全生命周期管理
HomePage: https://github.com/devsapp/fc3
Organization: 阿里云函数计算(FC)
Expand Down
8 changes: 4 additions & 4 deletions src/subCommands/logs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export default class Logs {
// }

if (match) {
l = replaceAll(l, match, `\x1B[43m${match}\x1B[0m`);
l = replaceAll(l, match, `\x1B[7m${match}\x1B[0m`);
}

console.log(l);
Expand Down Expand Up @@ -477,17 +477,17 @@ export default class Logs {
}

if (!_.isNil(qualifier)) {
q = hasValue ? `${q} and qualifier: "${qualifier}"` : `qualifier: "${qualifier}"`;
q = hasValue ? `${q} and "${qualifier}"` : `"${qualifier}"`;
hasValue = true;
}

if (!_.isNil(instanceId)) {
q = hasValue ? `${q} and instanceID: "${instanceId}"` : `instanceID: "${instanceId}"`;
q = hasValue ? `${q} and "${instanceId}"` : `"${instanceId}"`;
hasValue = true;
}

if (!_.isNil(requestId)) {
q = hasValue ? `${q} and requestId: "${requestId}"` : `requestId: "${requestId}"`;
q = hasValue ? `${q} and "${requestId}"` : `"${requestId}"`;
}

return q;
Expand Down
Loading