New documentation for developers

Hi,

I have put some info together to help people when they start developing for EmonCMS (like us :-)

I have forked the documentation in GitHub and want to ask for some feedback before i request it to be pulled to the original repository.

There are 2 new documents there:

In these documents there are three things missing:

  • In "Global variables": there is nothing in the $redis section
  • In "Developing a new module": there is nothing either about redis in the section Using the database
  • Where does EmonLogger store the log file? With the Apache logs?

Comments are very welcome (and answers to the three bullets above even more)

Cheers,

    Carlos

XaroRSA's picture

Re: New documentation for developers

Thank you very much Carlos, your work is appreciated, I am sure many of us think so, don't know why they are so shy to say thanks :D.

Looking forward to continued work on the documentation!

TrystanLea's picture

Re: New documentation for developers

Hello Carlos, this looks great and very useful.

For redis is would be good to explain that redis is useful for caching any regularly accessed meta data in memory such as feed or input last values, reducing the number of hard disk writes and reads needed, if the disk is a spinning disk and there are many users and devices posting to this system it can provide a very significant performance improvement. The posts originally wrote on this can be found here: https://github.com/openenergymonitor/documentation/blob/master/BuildingB...

I think the current way EmonLogger is used is a bit unclear using log4php. I had a few problems with it recently when the log file did not exist or was not writable. I've been thinking it wouldnt be too hard to implement a native logger and have done this in the low-write-v8.5 development branch of emoncms (soon to replace the bufferedwrite branch) here's the code for the native logger: https://github.com/emoncms/emoncms/blob/low-write-v8.5/Modules/log/EmonL.... It doesnt have all the features of log4php but I like its simplicity.

Thanks again

Trystan

cagabi's picture

Re: New documentation for developers

Hi there,

Thanks for the "thanks" XarRSA :-)

And thanks Trystan for your input, i will have a look at the links and add on Monday the info about Redis.

​About the logger, do you think future versions of EmonCMS will be using the native one you have written?. If this is the case i would change the whole EmonLogger section to describe how to use this new one.

Cheers,

   Carlos

cagabi's picture

Re: New documentation for developers

Hi again,

I have changed the section Using the database  in the file Developing a new module. Including info about REDIS, I think it is pretty clear in the document but also in my head.

The only thing missing is to put the methods of the global variable $redis in the other document, but i will do it when i know them. I am writing a Rules module and will only use MySQL but when things are ready i would like to take advantage of using REDIS. At that moment i will able to document the methods in $redis.

I have done a pull request so i guess in the following days this documentation will be availbale in the main repository.

I am loving it :-)

   Carlos

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.