Kiera Smart

Kiera Smart

1619403664

Console Is More Than Just Log!

We’re going to cover console.count, assert, table, time, group and trace.

---------- Links

Console - https://developer.mozilla.org/en-US/docs/Web/API/Console

---------- Timeline

  • 00:00 - Count
  • 00:30 - Table
  • 01:05 - Assert
  • 01:30 - Time
  • 03:50 - Group
  • 05:30 - Trace

#developer

What is GEEK

Buddha Community

Console Is More Than Just Log!

brayden diego

1606115929

Just Eat Clone, Just Eat Clone Script, White-label Food Delivery App Solution

Any business solution that caters to customers’ convenience is deemed to sustain a spectacular success, and on-demand food delivery is one such silo that channelizes terrific returns and tremendous profitability. Customers no longer need to trail through tedious queues and jam-packed restaurants as they can savor their favorite food items at their home’s comfort.

At Turnkeytown, we confer you with a comprehensive food ordering app development- the Just Eat clone. Infused with world-class features and encircled around a superlative user interface. Capitalize on the flourishing sector by initiating your Just Eat Like App Development today. Connect with us to know more!

#just eat app like development #just eat clone #just eat clone app #just eat like app development #just eat clone script

brayden diego

1604559970

Just Eat Clone, Just Eat Clone Script, White-label Food Delivery App Solution

Food delivery apps are becoming inevitable with each passing day. The sheer convenience of enjoying favorite cuisines from desired restaurants in the comfort of our homes is steering a revolution in the sector. The market for food delivery services is growing, and new players are emerging with distinctive ideas. The emergence of clone apps has made it easier for budding startups to develop and launch the app within a restricted budget and limited time.

Are you an entrepreneur who wishes to launch a JustEat clone app? If so, you need to be wary of the crucial elements that can enable you to gain instant traction. This blog discusses such factors and their impact on your business’s success.

Work diligently on USPs: USPs are Unique Selling Propositions that can differentiate your platform from the rest. Unless and until you establish something unique, there’s no point for users to switch from existing apps to your app.

Have a user-friendly design: Complexity in app design can be the last thing you can expect during JustEat app like development. Hence, ensure that the design is simple, informative, and user-friendly, thereby engaging more audience.

Take care of your supply chain: Encompassing a wide range of restaurants with different cuisines is crucial to satisfy customers from different demographics. Moreover, ensure that you have an efficient delivery team by your side.

Cater to the glocal (global + local) audience: Having a multilingual and multi-currency support option enables you to gain a strong local base and establish a global presence concurrently.

Summing up,
Incorporate these aspects in your white-label JustEat clone, and witness a massive spike in customer engagement and profits in no time.

#just eat app like development #just eat clone #just eat clone app #just eat like app development #just eat clone script

Nat  Grady

Nat Grady

1658618040

Electron-log: Just A Simple Logging Module for Your Electron App

electron-log

Just a simple logging module for your Electron or NW.js application. No dependencies. No complicated configuration. Just require and use. Also, it can be used without Electron in any node.js application.

By default, it writes logs to the following locations:

  • on Linux: ~/.config/{app name}/logs/{process type}.log
  • on macOS: ~/Library/Logs/{app name}/{process type}.log
  • on Windows: %USERPROFILE%\AppData\Roaming\{app name}\logs\{process type}.log

Installation

Install with npm:

npm install electron-log

Usage

const log = require('electron-log');

log.info('Hello, log');
log.warn('Some problem appears');

electron-log v2.x, v3.x

If you would like to upgrade to the latest version, read the migration guide and the changelog.

Log levels

electron-log supports the following log levels:

error, warn, info, verbose, debug, silly

nodeIntegration

If you've got an error like require is not defined in a renderer process, read the nodeIntegration section.

Transport

Transport is a simple function which does some work with log message. By default, two transports are active: console and file.

If you change some transport options, make sure you apply the changes both in main and renderer processes.

You can set transport options or use methods using:

log.transports.console.format = '{h}:{i}:{s} {text}';

log.transports.file.getFile();

Console transport

Just prints a log message to application console (main process) or to DevTools console (renderer process).

Options

  • format, default '%c{h}:{i}:{s}.{ms}%c › {text}' (main), '{h}:{i}:{s}.{ms} › {text}' (renderer)
  • level, default 'silly'
  • useStyles, use styles in the main process even if TTY isn't attached, default null

File transport

The file transport writes log messages to a file.

Options

  • format, default '[{y}-{m}-{d} {h}:{i}:{s}.{ms}] [{level}] {text}'
  • level, default 'silly'
  • resolvePath function sets the log path, for example
log.transports.file.resolvePath = () => path.join(APP_DATA, 'logs/main.log');

Read more about file transport.

IPC transport

When logging inside renderer process, it also shows log in application console and vice versa. This transport can impact on performance, so it's disabled by default for packaged application.

If you don't use electron-log in the main process but want to show renderer logs in the console, add require('electron-log') somewhere in the main code.

Options

  • level, default 'silly'

Remote transport

Sends a JSON POST request with LogMessage in the body to the specified url.

Options

  • level, default false
  • url, remote endpoint

Read more about remote transport.

Disable a transport

Just set level property to false, for example:

log.transports.file.level = false;
log.transports.console.level = false;

Override/add a custom transport

Transport is just a function (msg: LogMessage) => void, so you can easily override/add your own transport. More info.

Overriding console.log

Sometimes it's helpful to use electron-log instead of default console. It's pretty easy:

console.log = log.log;

If you would like to override other functions like error, warn and so on:

Object.assign(console, log.functions);

Colors

Colors can be used for both main and DevTools console.

log.info('%cRed text. %cGreen text', 'color: red', 'color: green')

Available colors:

  • unset (reset to default color)
  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white

For DevTools console you can use other CSS properties.

Catch errors

electron-log can catch and log unhandled errors/rejected promises:

log.catchErrors(options?);

More info.

Hooks

In some situations, you may want to get more control over logging. Hook is a function which is called on each transport call.

(message: LogMessage, transport: Transport) => LogMessage

More info.

Multiple logger instances

You can create multiple logger instances with different settings:

const electronLog = require('electron-log');

const log = electronLog.create('anotherInstance');

Logging scopes

const log = require('electron-log');
const userLog = log.scope('user');

userLog.info('message with user scope');
// Prints 12:12:21.962 (user) › message with user scope

Web Worker

It's possible to use the module with Web Worker. However, ipc transport is not active, so log messages from worker are not displayed in the main app console.

Related

Author: Megahertz
Source Code: https://github.com/megahertz/electron-log 
License: MIT license

#electron #logging #console 

Using Azure Log Analytics Workspaces to collect Custom Logs from your VM

Motivation:

We all have seen the Monitoring Tab Key Metrics on the VM Page. Yes, it is useful to see whether the CPU has been running or not through the **CPU **metrics, to check when the VM is getting the data from the outside world through Network In metrics and if the VM is doing any kind of write operation using **Disk Operations/Sec **metrics but it’s not effective for the custom services that we build on VM. So, in this blog, I will be giving you an example of how to create your own log based on customer service, bring it to Azure Log Analytics Workspace using its default agent, and query it according to our needs, even better create an alert on it.

Prerequisites:

  1. An Azure Account
  2. Azure Virtual Machine Service
  3. Azure Log Analytics Workspace Service
  4. Azure Alert Service

Azure Virtual Machine:

Let’s start with the VM itself. You already have the service running on the VM but don’t know how to get those logs into the portal or even create a log for your services. So, let’s assume that you have not created the logs for your services. So for this blog, I will be taking a simple flask app as my example for the service. To get it up and running we must download the flask library from pip and then create a flask app similar to this below:

#logs #log-analytics #azure #azure log analytics

To Log, or Not to Log, That is The Question.

Logging is one of the those things are universally present in software projects with their different unique forms, requirements, and flavors.

Logging is everywhere, from small 1-person-startups to large enterprises. Even a simple algorithmic programming question involves some logging along the way.

We rely so much on logging to develop, maintain, and keep our programs up and running. However, not much attention has been paid to how to design logging within our systems.

Often times, logging is treated as a second thought – it’s only sprinkled into source code upon implementation like some magic powder that helps lighten the day-to-day operational abyss in our systems.

#to log #not to log,