Closed lkrocek closed 6 years ago
This is meant to be a configuration file specific to the app utilizing the library (i.e. bright_web_socket.json should be in the main application's package root). This allows the logging level to be configured without modification to the library itself.
I understand, but if I want to write ComponentLibrary I cannot use readAsciiFile("pkg:/bright_web_socket.json")
because pkg:/
is not a path of my ComponentLibrary, sadly it means I cannot use any I/O ops in brightScript of my ComponentLibrary.
I would like write libs which could be used in any application and will independent.
At least it could be working with both cases, if config given as field don't lookup for file ...
@lkrocek you should be able to s/pkg/libpkg/ and have it working, i believe.
this will not help even libpkg will be working, because the address is apart of this library and I have to still modify the address in this lib. I would like have an original library without modification inside.
I am unclear on the request. Are you asking for an exposed method of changing the settings handled by bright_web_socket.json (which only controls logging) at runtime?
_Simply my request is about to possibility to change pkg:/bright_web_socket.json
address or in best case to pass its data with same way as a programmer passing url of server, so via interface._
I can try to explain one more:
I believe to do not modify 3rd party libs as this one to keep it simple maintainable for updates etc.
So with this idea I cannot do any changes within lib including address as "pkg:/bright_web_socket.json"
, so this address must be unchanged, but in component lib it follows into package and not into lib package. So whoever will use my lib will require to own this file in his/her own app(s), but it's not required because this should be for my library usage and not final applications.
If you are not sure what I mean maybe it's simplest way to do your own Unsigned Component Library with usage of you awesome WebSocketClient component.
A new commit to the develop branch exposes the log_level
field in WebSocketClient.xml. It can be set to one of the log level strings.
perfect it works.
https://github.com/rolandoislas/BrightWebSocket/blob/37fa3ac1b037c0148021634d3e5f726eac7f3cd3/src/web_socket_client/Logger.brs#L72
In a case I want use it in ComponentLibrary, I am unable to access it-self path as
pkg:/
which is path of main application and not current component, even it is strange I am actually unable to read files of it-self in brightscript.Change it to be assocarray field with default value of this task, please.