1.0.3 • Published 4 years ago

google-cloud-utils-log v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Google cloud utils: log

A module to simplify the assembly of a google cloud logging.

Prerequisites

Node.js

Before you can start using the google cloud log util, you need to have Node.js installed on your machine.

To download Node.js visit https://nodejs.org/en/download/.

NOTE: You can use a tool like NVM or N to install and manage multiple node versions

Package manager

In addition to Node.js we use yarn to facilitate multi package development.

To install yarn follow the instructions listed on their website: https://yarnpkg.com/en/docs/install

However, you also can install npm.

To install yarn follow the instructions listed on their website: https://docs.npmjs.com/cli/install

Firebase

This project works with firebase, so make sure you have your application configured.

Learn more about firebase: https://firebase.google.com/

Installation

Installing with yarn:

yarn add google-cloud-utils-log

Installing with npm:

npm i google-cloud-utils-log

Usage manual

// firebase module import
const firebase = require('firebase')

// log util import
const { log } = require('google-cloud-utils-log')

function logExample() {

    // firebase anonymous login
    firebase.auth()
    .signAnonymously()
    .then((credential) => {
        // getting the credential
        if (credential) {

            // To use the log method, just pass it and pass the following parameters...

            log(
                'firebase_anonymous_auth', // the logName
                'firebase_credential', // functionName
                'get_credential', // eventName
                credential // value
            )
        }
    })
    .catch((err) => {
        // logging the error
        log(
            'firebase_anonymous_auth', // the logName
            'firebase_credential', // functionName
            'get_credential_error', // eventName
            err // value
        )
    })
}

Meta

Linkedin Profile – Messias Geovani

Email – messias.geovani.lima@gmail.com

Github profile – messiasGeovani

Contributing

  1. Fork it (https://https://github.com/messiasGeovani/nodejs-google-cloud-utils-log/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -m 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request from development branch
1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago