google-cloud-utils-log
v1.0.3
Published
A module to simplify the assembly of a google cloud logging.
Downloads
1
Readme
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 – [email protected]
Github profile – messiasGeovani
Contributing
- Fork it (https://https://github.com/messiasGeovani/nodejs-google-cloud-utils-log/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -m 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request from development branch