Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

new verbose mode - currently targets millstone 0.5.5 debug/developmen…

…t mode
  • Loading branch information...
commit 456a40f8dab89cb5b57d0fa5be4050c67cae038b 1 parent f96c09d
Dane Springmeyer springmeyer authored
1  _posts/0100-01-01-CHANGELOG.md
View
@@ -45,6 +45,7 @@ releases:
# - Added ability to upgrade plugins
# - Fixed a bug where compatible plugin versions did not show up if there were newer incompatible versions
# - TileMill now supports reading CSVs with a column named either 'WKT' or 'GEOJSON' and encoded as either Well Known Text or GeoJSON, respectively. This allows CSV files to support more geometry types than just points.
+# - New Verbose mode for getting more detailed information in the TileMill logs of project loading status
- version: 0.9.1.276
dev: true
6 commands/global.bones
View
@@ -32,5 +32,11 @@ Bones.Command.options['syncAccessToken'] = {
'default': defaults.syncAccessToken || ''
};
+Bones.Command.options['verbose'] = {
+ 'title': 'verbose=on|off',
+ 'description': 'verbose logging',
+ 'default': defaults.verbose
+};
+
// Host option is unused.
delete Bones.Command.options.host;
4 commands/start.bones
View
@@ -40,6 +40,10 @@ command.prototype.initialize = function(plugin, callback) {
// Set proxy env variable before spawning children
if (plugin.config.httpProxy) process.env.HTTP_PROXY = plugin.config.httpProxy;
+ // munge verbose setting into what bones/millstone expects
+ if (plugin.config.verbose == 'on') process.env.NODE_ENV = 'development';
+ else process.env.NODE_ENV = 'production';
+
Bones.plugin.command = this;
Bones.plugin.children = {};
process.title = 'tilemill';
3  lib/config.defaults.json
View
@@ -8,5 +8,6 @@
"listenHost": "127.0.0.1",
"syncAPI": "http://api.tiles.mapbox.com",
"syncURL": "https://tiles.mapbox.com",
- "server": false
+ "server": false,
+ "verbose": "on"
}
4 models/Config.bones
View
@@ -14,6 +14,10 @@ model.prototype.schema = {
},
'httpProxy': {
'type': 'string'
+ },
+ 'verbose': {
+ 'type': 'string',
+ 'enum': ['on', 'off'],
}
}
};
4 models/Config.server.bones
View
@@ -35,7 +35,8 @@ models.Config.prototype.sync = function(method, model, success, error) {
'updatesVersion',
'profile',
'guid',
- 'httpProxy'
+ 'httpProxy',
+ 'verbose'
];
var data = _(model.toJSON()).reduce(function(memo, val, key) {
if (key === 'files') val = val.replace(/^~/, process.env.HOME);
@@ -52,7 +53,6 @@ models.Config.prototype.sync = function(method, model, success, error) {
// Catch & blow away invalid user JSON.
try { current = JSON.parse(current); }
catch (e) { current = {}; }
-
data = _(current).extend(data);
fs.writeFile(paths.user, JSON.stringify(data, null, 2), this);
// May contain sensitive info. Set secure permissions.
7 templates/Config._
View
@@ -64,6 +64,13 @@
<% } %>
</li>
<% } %>
+ <li>
+ <label for='verbose'>Logging</label>
+ <input type='checkbox' name='verbose' <% if (get('verbose') == 'on') %>checked='checked'<% ; %> /> Use verbose logging
+ <div class='description'>
+ Check this to see more output in your logs about what TileMill processes are doing
+ </div>
+ </li>
<li class='buttons'>
<input type='submit' value='Saved' class='disabled' />
</li>
10 views/Config.bones
View
@@ -3,6 +3,7 @@ view = Backbone.View.extend();
view.prototype.events = {
'change input[name=updates]': 'updates',
'change input[name=profile]': 'profile',
+ 'change input[name=verbose]': 'verbose',
'change input[name=httpProxy]': 'proxy',
'keyup input[name=httpProxy]': 'proxy',
'keyup input[name=files]': 'files',
@@ -22,11 +23,13 @@ view.prototype.initialize = function(options) {
'disable',
'save',
'restart',
- 'proxy'
+ 'proxy',
+ 'verbose'
);
this.model.bind('change', this.changed);
this.model.bind('change:files', this.restart);
this.model.bind('change:httpProxy', this.restart);
+ this.model.bind('change:verbose', this.restart);
this.render();
};
@@ -64,6 +67,11 @@ view.prototype.profile = function(ev) {
this.model.set({profile: $(ev.currentTarget).is(':checked')});
};
+view.prototype.verbose = function(ev) {
+ var value = $(ev.currentTarget).is(':checked') ? 'on' : 'off';
+ this.model.set({verbose: value});
+};
+
view.prototype.disable = function(ev) {
this.model.set({
'syncAccount': '',
Please sign in to comment.
Something went wrong with that request. Please try again.