Fixed isDebug not work in beef.js (#2013)

* fixed isDebug not work

* fixed JQMIGRATE print extra message to console

* fix debug mode not work

* testing approval process

* Update github_actions.yml

Co-authored-by: kinovir <kinovir@gmail.com>
Co-authored-by: t3hp0rP <github@pr0ph3t.com>
Co-authored-by: wheatley <wheatand@gmail.com>
This commit is contained in:
slimwang
2022-06-23 13:49:44 +08:00
committed by GitHub
parent f68e420318
commit 73a3d17f29
3 changed files with 5 additions and 5 deletions

View File

@@ -39,7 +39,7 @@ if(typeof beef === 'undefined' && typeof window.beef === 'undefined') {
*/ */
debug: function(msg) { debug: function(msg) {
isDebug = '<%= @client_debug %>' isDebug = '<%= @client_debug %>'
if (typeof console == "object" && typeof console.log == "function" && isDebug.localeCompare("true")) { if (typeof console == "object" && typeof console.log == "function" && isDebug === 'true') {
var currentdate = new Date(); var currentdate = new Date();
var pad = function(n){return ("0" + n).slice(-2);} var pad = function(n){return ("0" + n).slice(-2);}
var datetime = currentdate.getFullYear() + "-" var datetime = currentdate.getFullYear() + "-"

View File

@@ -16,10 +16,10 @@ var warnedAbout = {};
jQuery.migrateWarnings = []; jQuery.migrateWarnings = [];
// Set to true to prevent console output; migrateWarnings still maintained // Set to true to prevent console output; migrateWarnings still maintained
// jQuery.migrateMute = false; jQuery.migrateMute = true;
// Show a message on the console so devs know we're active // Show a message on the console so devs know we're active
if ( window.console && window.console.log ) { if (window.console && window.console.log && !jQuery.migrateMute) {
window.console.log( "JQMIGRATE: Migrate is installed" + window.console.log( "JQMIGRATE: Migrate is installed" +
( jQuery.migrateMute ? "" : " with logging active" ) + ( jQuery.migrateMute ? "" : " with logging active" ) +
", version " + jQuery.migrateVersion ); ", version " + jQuery.migrateVersion );
@@ -27,7 +27,7 @@ if ( window.console && window.console.log ) {
// Set to false to disable traces that appear with warnings // Set to false to disable traces that appear with warnings
if ( jQuery.migrateTrace === undefined ) { if ( jQuery.migrateTrace === undefined ) {
jQuery.migrateTrace = true; jQuery.migrateTrace = false;
} }
// Forget any warnings we've already given; public // Forget any warnings we've already given; public

View File

@@ -67,7 +67,7 @@ if(typeof beef === 'undefined' &amp;&amp; typeof window.beef === 'undefined') {
*/ */
debug: function(msg) { debug: function(msg) {
isDebug = '&lt;%= @client_debug %>' isDebug = '&lt;%= @client_debug %>'
if (typeof console == "object" &amp;&amp; typeof console.log == "function" &amp;&amp; isDebug.localeCompare("true")) { if (typeof console == "object" &amp;&amp; typeof console.log == "function" &amp;&amp; isDebug === '-1') {
var currentdate = new Date(); var currentdate = new Date();
var pad = function(n){return ("0" + n).slice(-2);} var pad = function(n){return ("0" + n).slice(-2);}
var datetime = currentdate.getFullYear() + "-" var datetime = currentdate.getFullYear() + "-"