screenlog.js

Bring console.log on the screen

Github stars Tracking Chart

screenlog.js npm version

Bring console.log, on the screen


Ever faced a situation where you said "Why doesn't this bug show up when developer console is open!!"? And since the bug doesn't show when you have console open, you cannot do debug logging using console.log.

Enter screenlog.js. screenlog.js brings the developer console right on your screen so that you can do logging without having the developer console open always.

Example

Screenshot

Usage

Do npm install screenlog or bower install screenlog or download the project.

Drop dist/screenlog.min.js into your web application and initialize it with:

screenLog.init();

And you are done!
By default, every next console.log (or info, warn and error) in your app now starts logging on the screen as well as the console. Or you can use screenLog.log() instead to just log on the screen.

Public API

screenLog.init([options])

Initializes the screen logger. It creates a customizable panel on the screen.

  • options - A map of additional options.
  • logColor - Text color. Default is lightgreen.
  • fontSize - Font size of logs. Default is 1em(Your browser's default).
  • bgColor - Background color of the log panel. Default is black.
  • releaseConsole - By default console.log is overridden to log on screen. You can avoid this behaviour by setting releaseConsole to true and instead use screenLog.log() API. Default is false.

screenLog.[log, warn, error, info](obj1 [, obj2, ..., objN])

Logs a message on the screen. Eg. screenLog.info('Info here').

  • obj1 ... objN - A list of JavaScript objects or strings to output. Just like console.log.

screenLog.clear()

Clears messages on the screen.

screenLog.destroy()

Removes the logger from the UI and reverts to original console functionality.

Browser Support

screenlog.js works best on latest versions of Google Chrome, Firefox and Safari.

Contributing

Interested in contributing features and fixes?

Read more on contributing.

Changelog

See the Changelog

License

Copyright (c) 2015-2017 Kushagra Gour, http://kushagragour.in
Licensed under the MIT license.

Main metrics

Overview
Name With Ownerchinchang/screenlog.js
Primary LanguageJavaScript
Program languageHTML (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2015-11-15 20:58:14
Pushed At2023-06-11 10:33:33
Last Commit At2021-03-20 11:54:41
Release Count7
Last Release Namev0.2.2 (Posted on )
First Release Namev0.1.0 (Posted on )
用户参与
Stargazers Count856
Watchers Count11
Fork Count71
Commits Count53
Has Issues Enabled
Issues Count15
Issue Open Count8
Pull Requests Count8
Pull Requests Open Count2
Pull Requests Close Count9
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private