Sha256: 2583fd65d68e1fdb103c6bdc69ac68b6ede5c563916201e59b6541238e8990ce

Contents?: true

Size: 1.3 KB

Versions: 11

Compression:

Stored size: 1.3 KB

Contents

/*
	  YMDP LOGGER

		Send logging messages to OIB. 
		
		Messages are saved in log/ymdp.log


  // DO NOT USE the @view instance variable in any files in /app/javascripts/base.
  // The way they are cached makes it not safe to do so.

*/


/* set asset version */

var LOGGER, Logger;

LOGGER = {
  VERSION: "<%= @hash %>",
  MESSAGE: "<%= @message %>",
  DEPLOYED: <%= Time.now.to_i %>,
  DEPLOYED_STRING: "<%= Time.now.to_s %>"
};

	YAHOO.namespace("logger");

	YAHOO.logger.write = function(level, message) {
		if (YAHOO.oib.login) {
			message = "[login: " + YAHOO.oib.login + "] " + message;
		}
		if (YAHOO.oib.guid) {
			message = "[guid: " + YAHOO.oib.guid + "] " + message;
		}
	  OIB.post("ymdp/log",
	    {
	      level: level,
	      message: message
	    },
	    function(response) {
	      // log message written successfully
	  });
	};
	
	YAHOO.logger.debug = function(message) {
	  YAHOO.logger.write("debug", message);
	};
	YAHOO.logger.info = function(message) {
	  YAHOO.logger.write("info", message);
	};
	YAHOO.logger.warn = function(message) {
	  YAHOO.logger.write("warn", message);
	};
	YAHOO.logger.error = function(message) {
	  YAHOO.logger.write("warn", message);
	};
	YAHOO.logger.fatal = function(message) {
	  YAHOO.logger.write("fatal", message);
	};
	

Logger = YAHOO.logger;	

// END YMDP LOGGER

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ymdp-0.5.1 lib/ymdp/javascripts/logger.js
ymdp-0.5.0 lib/ymdp/javascripts/logger.js
ymdp-0.4.9 lib/ymdp/javascripts/logger.js
ymdp-0.4.8 lib/ymdp/javascripts/logger.js
ymdp-0.4.6 lib/ymdp/javascripts/logger.js
ymdp-0.4.5 lib/ymdp/javascripts/logger.js
ymdp-0.4.4 lib/ymdp/javascripts/logger.js
ymdp-0.4.3 lib/ymdp/javascripts/logger.js
ymdp-0.4.2 lib/ymdp/javascripts/logger.js
ymdp-0.4.1 lib/ymdp/javascripts/logger.js
ymdp-0.4.0 lib/ymdp/javascripts/logger.js