Commit 57786e73 authored by Marcel's avatar Marcel
Browse files

Minor fixes.

parent 122be360
......@@ -12,9 +12,10 @@ welcome_text = <center>Welcome to VISPA!</center>
forgot_text = A mail with further instructions will be sent to your mail account!
use_forgot = False
# logging on clientside
client_logging = True
client_loglevel = info
# logging on client side
client_logging_enabled = True
client_logging_level = info
client_logging_ignore = []
# use base when running in subdirectory
#base = /vispa
......
......@@ -56,8 +56,9 @@ class PlatformController(AbstractController):
secure_websockets = vispa.config('websockets', 'secure', False)
profile_id = self.get('profile_id')
preferences = Profile.get_preferences(db, profile_id, parse_json=True)
client_logging = vispa.config('web', 'client_logging', True)
client_loglevel = vispa.config('web', 'client_loglevel', 'info')
client_logging_enabled = vispa.config('web', 'client_logging_enabled', True)
client_logging_level = vispa.config('web', 'client_logging_level', 'info')
client_logging_ignore = vispa.config('web', 'client_logging_ignore', [])
data = {'username' : username,
'common_js' : self._platform.common_js,
'common_css' : self._platform.common_css,
......@@ -65,8 +66,9 @@ class PlatformController(AbstractController):
'secure_websockets': secure_websockets,
'workspace_id' : 1,#self.get('workspace_id')
'profile_id' : profile_id,
'client_logging' : client_logging,
'client_loglevel' : client_loglevel}
'logging_enabled' : client_logging_enabled,
'logging_level' : client_logging_level,
'logging_ignore' : client_logging_ignore}
data.update(preferences)
return data
......
......@@ -8,4 +8,4 @@ window.console.log.apply(window.console,z);}return p;},c=function(B){var A="["+y
}if(B){A+=" "+B.toUpperCase()+" -";}return A;},f=function(){j(null,arguments);return p;},o=function(){j("debug",arguments);return p;return p;},v=function(){j("info",arguments);
return p;},u=function(){j("warning",arguments);return p;},t=function(){j("error",arguments);return p;},e=function(){j("fatal",arguments);return p;},y=function(){var B=new Date();
var A=B.toLocaleTimeString();var z=B.getMilliseconds();if(z<10){z="00"+String(z);}else{if(z<100){z="0"+String(z);}else{z=String(z);}}return A+"."+z;};_loggers[m]=p={namespace:m,enable:k,disable:d,enabled:h,level:a,log:f,debug:o,info:v,warn:u,error:t,fatal:e};
var i=_loggerNamespaces;jQuery.each(m.split(b),function(A,z){if(!i[z]){i[z]={};}i=i[z];});var n=x();if(n&&n.enabled()){k();}}return p;};
\ No newline at end of file
var i=_loggerNamespaces;jQuery.each(m.split(b),function(A,z){if(!i[z]){i[z]={};}i=i[z];});var n=x();if(n&&n.enabled()){k();a(n.level());}}return p;};
\ No newline at end of file
......@@ -3,6 +3,9 @@ var CommandPalette = Class.extend({
init: function(vispa, config) {
this.vispa = vispa;
// register a logger
this.logger = $.Logger('CommandPalette');
// attributes
this.settings = {
shortcut: 'ctrl+shift+p',
......@@ -36,6 +39,8 @@ var CommandPalette = Class.extend({
this.setupMarkup();
this.applyConfig();
this.setupShortcuts();
this.logger.debug('Started');
return this;
},
......
......@@ -3,6 +3,9 @@ var ExtensionManager = Class.extend({
init: function(vispa, config, extensionConfig) {
this.vispa = vispa;
// register a logger
this.logger = $.Logger('ExtensionManager');
// attributes
this.settings = {
argSeparator: ':',
......@@ -20,11 +23,15 @@ var ExtensionManager = Class.extend({
this.extensionStore = {};
this.fileHandlers = {};
this.urlChannelHandlers = {};
// register the extension logger
$.Logger('Extension');
},
startup: function() {
this.applyConfig();
this.setupTopics();
this.logger.debug('Started');
return this;
},
......@@ -105,7 +112,7 @@ var ExtensionManager = Class.extend({
this.extensionStore[extension.name] = extension;
this.setupExtension(extension);
$.Logger('ExtensionManager').info($.Helpers.strFormat('Extension \'{0}\' added', extension.name));
this.logger.info($.Helpers.strFormat('Extension \'{0}\' added', extension.name));
return this;
},
......
......@@ -3,6 +3,9 @@ var VispaExtensionView = Class.extend({
init: function(vispa, config) {
this.vispa = vispa;
// register a logger
this.logger = $.Logger('ExtensionView');
// attributes
this.settings = {
badgeMargin: {
......@@ -31,6 +34,8 @@ var VispaExtensionView = Class.extend({
startup: function() {
this.setupLayout();
this.applyConfig();
this.logger.debug('Started');
return this;
},
......
var Vispa = Class.extend({
init: function(config, extensionConfig) {
// register a logger
this.logger = $.Logger('Vispa');
// attributes
this.settings = {};
this.defaultConfig = {
......@@ -15,11 +18,7 @@ var Vispa = Class.extend({
messenger: {},
preferenceHandler: {},
preferenceView: {},
bus: {
onopen: function(){$.Logger().info('Bus connected');},
onclose: function(){$.Logger().info('Bus disconnected');},
onerror: function(){$.Logger().info('Bus error');}
}
bus: {}
};
this.workflow = {
urlParametersHandled: false
......@@ -27,7 +26,7 @@ var Vispa = Class.extend({
this.config = $.extend(true, {}, this.defaultConfig, config);
// members
this.view = new VispaView(this, this.config.view);
this.view = new View(this, this.config.view);
this.extensionView = new VispaExtensionView(this, this.config.extensionView);
this.extensionManager = new ExtensionManager(this, this.config.extensionManager, extensionConfig);
this.commandPalette = new CommandPalette(this, this.config.commandPalette);
......@@ -44,6 +43,9 @@ var Vispa = Class.extend({
startup: function() {
var _this = this;
this.logger.debug('Started');
// setup all components
this.preferenceView.startup();
this.preferenceHandler.startup();
......@@ -73,6 +75,7 @@ var Vispa = Class.extend({
_this.urlHandler.workflow.wrappedCallback();
}, 0);
});
return this;
},
......
......@@ -3,6 +3,9 @@ var PreferenceHandler = Class.extend({
init: function(vispa, config) {
this.vispa = vispa;
// register a logger
this.logger = $.Logger('PreferenceHandler');
// attributes
this.settings = {
pref: {
......@@ -21,6 +24,8 @@ var PreferenceHandler = Class.extend({
startup: function() {
this.setupTopics();
this.logger.debug('Started');
return this;
},
......
......@@ -3,6 +3,9 @@ var PreferenceView = Class.extend({
init: function(vispa, config) {
this.vispa = vispa;
// register a logger
this.logger = $.Logger('PreferenceView');
// attributes
this.settings = {
shortcut: 'ctrl+p',
......@@ -44,6 +47,8 @@ var PreferenceView = Class.extend({
startup: function() {
this.setupMarkup();
this.setupShortcuts();
this.logger.debug('Started');
return this;
},
......
var VispaView = Class.extend({
var View = Class.extend({
init: function(vispa, config) {
this.vispa = vispa;
// register a logger
this.logger = $.Logger('View');
// attributes
this.settings = {
headerMinHeight: 60,
......@@ -74,6 +77,8 @@ var VispaView = Class.extend({
this.applyConfig();
this.setupTopics();
this.hideOverlay();
this.logger.debug('Started');
return this;
},
......
......@@ -3,6 +3,9 @@ var WorkspaceManager = Class.extend({
init: function(vispa, config) {
this.vispa = vispa;
// register a logger
this.logger = $.Logger('WorkspaceManager');
// attributes
this.settings = {
pref: {
......@@ -28,6 +31,8 @@ var WorkspaceManager = Class.extend({
startup: function() {
this.setupTopics();
this.connect();
this.logger.debug('Started');
return this;
},
......
......@@ -119,8 +119,11 @@
<%block name="js_inline_post">
$(function() {
% if client_logging:
$.Logger().enable().level('${client_loglevel}');
% if logging_enabled:
$.Logger().enable().level('${logging_level}');
% for elem in logging_ignore:
$.Logger('${elem}').disable();
% endfor
% endif
// show the inner startup overlay (css transition)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment