Skip to content

Commit

Permalink
First step of functioning refactored code
Browse files Browse the repository at this point in the history
  • Loading branch information
ppt000 committed Jun 18, 2022
1 parent 7d1d53b commit e4f5f4b
Show file tree
Hide file tree
Showing 10 changed files with 343 additions and 483 deletions.
46 changes: 46 additions & 0 deletions LOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# LOG of MQTTGATEWAY

## [17 June 2022]

Start Version 2.0 of this library.

### Objectives
- simplify the startup process: loading of configuration, logging setup, etc...
- adapt logging to simultaneous multiple sessions.
- change multi threading to async.

### Inputs

The library has to facilitate the retrieval of the 2 files needed for any application using
this library:
- the configuration file,
- the mapping file.

These are stored in files with possibly different names, possibly in different folders.

To start with and make it simple, assume the location of those files is
in a sub-directory of the home directory called `.mqttgtw` (for example).
Assume as well that those 2 files have the same name of the application,
with respectively the suffixes `cfg` and `json`.
Add the possibility of defining another configuration file on the command line
with the option `-c`, which has to be located in the same directory though.

### Logs

The library has to facilitate the logging of several concurrent application
all using the same library but obviously running other applications.

Propose only 3 different handlers:
- the console, mostly for development,
- rotating file on local system,
- journalmd compatible logging (if available).

For the rotating files, use a pre-defined main folder in the home directory,
for example `mqttgtw_logs`, and create a sub-folder there for each application running.




Also to make it simple, start by locating


8 changes: 4 additions & 4 deletions mqttgateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
'''

import sys
PY2 = sys.version_info[0]==2
#import sys
#PY2 = sys.version_info[0]==2

ENCODING = 'utf-8'
LIBRARY_NAME = 'mqttgateway'

__version_info__ = (1, 1, 5)
__version__ = '.'.join(str(c) for c in __version_info__)
__version__ = '2.0.0'

0 comments on commit e4f5f4b

Please sign in to comment.