How to use the @f5devcentral/f5-cloud-libs.logger function in @f5devcentral/f5-cloud-libs

To help you get started, we’ve selected a few @f5devcentral/f5-cloud-libs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github F5Networks / f5-cloud-libs-gce / scripts / failover.js View on Github external
#!/usr/bin/env node

'use strict';

const parser = require('commander');
const fs = require('fs');
const q = require('q');
const ipaddr = require('ipaddr.js');

const Compute = require('@google-cloud/compute');
const f5CloudLibs = require('@f5devcentral/f5-cloud-libs');

const util = f5CloudLibs.util;
const httpUtil = f5CloudLibs.httpUtil;
const Logger = f5CloudLibs.logger;
const compute = new Compute();

// Parse command line arguments

parser
    .version('1.0.0')

    .option('--log-level [type]', 'Specify the log level', 'info')
    .option('--log-file [type]', 'Specify the log file location', '/var/log/cloud/google/failover.log')
    .option('--config-file [type]', 'Specify the log level', '/config/cloud/.deployment')
    .parse(process.argv);

const loggerOptions = { logLevel: parser.logLevel, fileName: parser.logFile, console: true };
const logger = Logger.getLogger(loggerOptions);
const BigIp = f5CloudLibs.bigIp;
const bigip = new BigIp({ logger });
github F5Networks / f5-cloud-libs-gce / lib / gceCloudProvider.js View on Github external
'use strict';

const fs = require('fs');
const util = require('util');
const path = require('path');
const stream = require('stream');

const q = require('q');

const Compute = require('@google-cloud/compute');
const Storage = require('@google-cloud/storage');

const CloudProvider = require('@f5devcentral/f5-cloud-libs').cloudProvider;
const AutoscaleInstance = require('@f5devcentral/f5-cloud-libs').autoscaleInstance;
const BigIp = require('@f5devcentral/f5-cloud-libs').bigIp;
const Logger = require('@f5devcentral/f5-cloud-libs').logger;
const cloudUtil = require('@f5devcentral/f5-cloud-libs').util;
const cryptoUtil = require('@f5devcentral/f5-cloud-libs').cryptoUtil;
const PubSub = require('../src/gcClients/pubSub');
const KEYS = require('@f5devcentral/f5-cloud-libs').sharedConstants.KEYS;

const CREDENTIALS_FILE = 'credentials/master';
const INSTANCES_FOLDER = 'instances/';
const PUBLIC_KEYS_FOLDER = 'public_keys/';
const BACKUP_FOLDER = 'backup/';

const JOIN_PREFIX = 'JOIN_';
const SYNC_COMPLETE_PREFIX = 'SYNC_COMPLETE_';

let bigIp;
let logger;