Development documentation (MM issue #3252)
Resolves MagicMirror issue https://github.com/MichMich/MagicMirror/issues/3252
Renames development to module-development and adds new directory core-development with some info.
@KristjanESPERANTO @rejas I'd like to add a blurb about logging but I actually haven't been able to figure it out myself! How do I enable logging, where do the log files go, etc.
there are no log files. there are two places where info is reported. In the console where npm start/npm run server is done.
this output is separated into two types. normal, (console.log()) presented on the programs stdout stream and error, (console.error()) presented on the programs stderrr stream.
if you are using pm2, these two streams are captured separately, not comingled by time
if you are not using pm2, then the output will be lost unless you use redirection to pipe the output to some file
all this output is generated by the node_helper of every module that uses one
the second place is in the browser developers window console. this output is not captured by anything. one can use a module like MMM-Logging to redirect this output to the normal output stream. but it affects performance.
this browser output is collected from Log.log()/Log.error() statements in the browser component of a module. that's the JavaScript file that has the same name as the module.
the calendar module uses console.debug() which is disabled by default. you can enable it by adding "DEBUG", to the logLevel property in config.js. and restarting MagicMirror
this output is presented on the programs stderrr stream.
only the calendar module uses this approach if you had multiple modules using it, then all their output would be generated at the same time
if you are using pm2 to launch MagicMirror, then the command
pm2 logs --lines=nnnn
will display nnnn lines from each of the stderrr and stdout streams. (not joined by time) the nnnn default is the last 15 lines..
when viewing the content collected from stdout and stderrr, there is no built in capability to identify the module that generated the output
in the browser developers window console, you can filter output by a using string found in the output, but not by module. by placing this string in the filter field of the console tab
@sdetweil thanks, I'll digest this info and then write a portion in the core development documentation about it
you can open the browser developers window with the keystroke combination ctrl-shift-i on the browser showing MM (its a toggle, turn on, turn off) the browser dev window, console tab looks like this
and then there is the elements tab where you can see and manipulate the styles on elements before adding them to custom.css
see this for discussion on how to use https://forum.magicmirror.builders/topic/14862/help-with-a-couple-css-issues?_=1704737779315
and there is the sources tab where you can see and step thru the browser side code. see and manipulate variables
@rejas I'm not really sure what needs to be redirected, or how to implement it based on the vuejs link. It seems like all of the old references in the current documentation develop branch have been updated.
@sdetweil I've added documentation around your logging info, please review (and thanks!)
@rejas I'm not really sure what needs to be redirected, or how to implement it based on the vuejs link. It seems like all of the old references in the current documentation develop branch have been updated.
I took the liberty to add the redirects and commit them to your branch (as well as some linting to your new pages). How do you think about it?
@rejas looks good! Thanks for doing that 👍
maybe another change, remove the leading
.\\
on the windows package.json change
windows doesn't support . for current directory
needs to start
"node_modules\\.bin
@sdetweil
maybe another change, remove the leading
.\\...
This works fine on Windows. Windows development with MM isn't great but I do at least some of my development there, and this works fine. You just can't have the DISPLAY=... bit in the start script in package.json
It's been a week, where are we at on this? Still waiting on @sdetweil?
sorry been swamped will do tonight
@sdetweil thanks, I'll make some tweaks today