Skip to content

Commit

Permalink
fix(logs): show addon logs when addonId is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
miton18 committed Feb 13, 2024
1 parent efeeb48 commit 6fb99d5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/commands/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@ const LogV2 = require('../models/log.js');
const Log = require('../models/log-v4.js');
const Logger = require('../logger.js');
const { Deferred } = require('../models/utils.js');
const colors = require('colors/safe');

async function appLogs (params) {
const { alias, after: since, before: until, search, 'deployment-id': deploymentId } = params.options;
const { alias, addon, after: since, before: until, search, 'deployment-id': deploymentId } = params.options;

// ignore --search ""
const filter = (search !== '') ? search : null;

const { appId, ownerId } = await AppConfig.getAppDetails({ alias });

Logger.println('Waiting for application logs…');

// TODO: drop when addons are migrated to the v4 API
if (params.addon) {
if (addon) {

Logger.println(colors.blue('Waiting for addon logs…'));

Check failure on line 21 in src/commands/logs.js

View workflow job for this annotation

GitHub Actions / Build

Expected indentation of 4 spaces but found 2
const { addon: addonId } = params.options;
const appAddonId = addonId || await AppConfig.getAppDetails({ alias }).then(({ appId }) => appId);
return LogV2.displayLogs({ appAddonId, since, until, filter, deploymentId });
}

Logger.println(colors.blue('Waiting for application logs…'));

const deferred = new Deferred();
await Log.displayLogs({ ownerId, appId, since, until, filter, deploymentId, deferred });
return deferred.promise;
Expand Down

0 comments on commit 6fb99d5

Please sign in to comment.