Skip to content

Commit

Permalink
Merge pull request #492 from lukecotter/fix-retrieve-log-cmd
Browse files Browse the repository at this point in the history
fix: retrieve log cmd
  • Loading branch information
lcottercertinia authored Mar 1, 2024
2 parents 6a82a8f + f72524a commit d628d80
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.14.1] - 2024-03-01

### Fixed

- `Log: Retrieve Apex Log And Show Analysis` not working ([#490][#490])

## [1.14.0] - 2024-02-12

### Added
Expand Down Expand Up @@ -326,7 +332,11 @@ Skipped due to adopting odd numbering for pre releases and even number for relea
- Add explorer menu item
- Provide more information when selecting log to download

<!-- Unreleased -->
<!-- v1.14.1 -->

[#490]: https://github.com/certinia/debug-log-analyzer/issues/490

<!-- v1.14.0 -->

[#475]: https://github.com/certinia/debug-log-analyzer/issues/475
[#299]: https://github.com/certinia/debug-log-analyzer/issues/299
Expand Down
2 changes: 1 addition & 1 deletion lana/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lana",
"displayName": "Apex Log Analyzer",
"version": "1.14.0",
"version": "1.14.1",
"description": "Analyzer for Salesforce debug logs - Visualize code execution via a Flame graph and identify performance and SOQL/DML problems via Method and Database analysis",
"keywords": [
"apex",
Expand Down
7 changes: 3 additions & 4 deletions lana/src/salesforce/logs/GetLogFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
* Copyright (c) 2020 Certinia Inc. All rights reserved.
*/

import { AuthHelper } from '@apexdevtools/sfdx-auth-helper';
import { LogService } from '@salesforce/apex-node';

export class GetLogFile {
static async apply(wsPath: string, logDir: string, logId: string): Promise<void> {
// eslint-disable-next-line @typescript-eslint/naming-convention
const { AuthHelper } = await import('@apexdevtools/sfdx-auth-helper');
const ah = await AuthHelper.instance(wsPath);
const connection = await ah.connect(await ah.getDefaultUsername());

if (connection) {
// eslint-disable-next-line @typescript-eslint/naming-convention
const { LogService } = await import('@salesforce/apex-node');
await new LogService(connection).getLogs({ logId: logId, outputDir: logDir });
}
return new Promise((resolve) => resolve());
Expand Down
7 changes: 2 additions & 5 deletions lana/src/salesforce/logs/GetLogFiles.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
/*
* Copyright (c) 2020 Certinia Inc. All rights reserved.
*/
import { type LogRecord } from '@salesforce/apex-node';
import { AuthHelper } from '@apexdevtools/sfdx-auth-helper';
import { LogService, type LogRecord } from '@salesforce/apex-node';

export class GetLogFiles {
static async apply(wsPath: string): Promise<LogRecord[]> {
// eslint-disable-next-line @typescript-eslint/naming-convention
const { AuthHelper } = await import('@apexdevtools/sfdx-auth-helper');
const ah = await AuthHelper.instance(wsPath);
const connection = await ah.connect(await ah.getDefaultUsername());

if (connection) {
// eslint-disable-next-line @typescript-eslint/naming-convention
const { LogService } = await import('@salesforce/apex-node');
return new LogService(connection).getLogRecords();
}
return [];
Expand Down
3 changes: 1 addition & 2 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export default [
input: './lana/src/Main.ts',
output: {
format: 'cjs',
dir: './lana/out',
chunkFileNames: '[name].js',
file: './lana/out/Main.js',
sourcemap: false,
},
external: ['vscode'],
Expand Down

0 comments on commit d628d80

Please sign in to comment.