35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
// simple_test.js
|
|
const { SatLocLogParser, RECORD_TYPES } = require('./helpers/satloc_log_parser');
|
|
const path = require('path');
|
|
|
|
async function test() {
|
|
const logFile = './test-logs/Liqud_IF2_G4.log';
|
|
console.log(`Testing parser with: ${logFile}`);
|
|
|
|
// Disable checksum validation to see more records
|
|
const parser = new SatLocLogParser({
|
|
debug: true,
|
|
debugRecordTypes: [
|
|
RECORD_TYPES.TARGET_APPLICATION_RATES_32, RECORD_TYPES.DUAL_FLOW_TARGET_RATES_33, RECORD_TYPES.APPLIED_RATES_36,
|
|
|
|
],
|
|
validateChecksums: true
|
|
});
|
|
|
|
try {
|
|
console.log('Starting parse...');
|
|
const result = await parser.parseFile(logFile, { fileId: 'test.log' });
|
|
console.log('Parse completed:', result.success);
|
|
console.log('Statistics:', parser.getStatistics());
|
|
|
|
if (result.applicationDetails && result.applicationDetails.length > 0) {
|
|
console.log('Sample application details:');
|
|
console.log(result.applicationDetails.slice(0, 3));
|
|
}
|
|
} catch (error) {
|
|
console.error('Parse error:', error);
|
|
}
|
|
}
|
|
|
|
test();
|