Skip to content

Commit 69e4067

Browse files
committed
refactor: hide verbose matrix logs inside production
1 parent 98a773d commit 69e4067

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/app/pages/matrix/matrix.component.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { MatIconModule } from '@angular/material/icon';
1414
import { MatDividerModule } from '@angular/material/divider';
1515
import { KeyValuePipe } from '@angular/common';
1616
import { TopHeaderComponent } from '../../component/top-header/top-header.component';
17+
import { environment } from 'src/environments/environment';
1718

1819
export interface MatrixRow {
1920
Category: string;
@@ -192,7 +193,9 @@ export class MatrixComponent implements OnInit {
192193

193194
toggleTagFilters(event: MatChipListboxChange) {
194195
const selectedValues: string[] = event.value || [];
195-
console.log(`${perfNow()}: Matrix: Tag filter changed: [${selectedValues.join(', ')}]`);
196+
if (!environment.production) {
197+
console.log(`${perfNow()}: Matrix: Tag filter changed: [${selectedValues.join(', ')}]`);
198+
}
196199
const newFilter: Record<string, boolean> = {};
197200
Object.keys(this.filtersTag()).forEach(key => {
198201
newFilter[key] = selectedValues.includes(key);
@@ -202,7 +205,9 @@ export class MatrixComponent implements OnInit {
202205

203206
toggleDimensionFilters(event: MatChipListboxChange) {
204207
const selectedValues: string[] = event.value || [];
205-
console.log(`${perfNow()}: Matrix: Dim filter changed: [${selectedValues.join(', ')}]`);
208+
if (!environment.production) {
209+
console.log(`${perfNow()}: Matrix: Dim filter changed: [${selectedValues.join(', ')}]`);
210+
}
206211
const newFilter: Record<string, boolean> = {};
207212
Object.keys(this.filtersDim()).forEach(key => {
208213
newFilter[key] = selectedValues.includes(key);

0 commit comments

Comments
 (0)