Re: [Vala] Help with pub-sub class



I've made some progress on this if anyone wants some answers for posterity.

* Instead of using a struct I created a new class and I now pass an full
object. This let's me have default values.

The following are still eluding me:
* The signal "publish" seems unable to take two parameters. (I don't
understand this, though it's no longer an issue for me.)
* I can't figure out a way to get the method which writes to the log inside
the logging class because I keep needing access to instance members from a
static function. (https://github.com/steveno/balistica/blob/master/src/
BalisticaApplication.vala#L284)

Steven N. Oliver

On Sat, Oct 28, 2017 at 1:46 PM, Steven Oliver <oliver steven gmail com>
wrote:

With the help of other developers here on the list I managed to get my
logging class setup and working (thanks!). Now, that it's there, though, I
want to continue adding to it. The first big thing I want to do is come up
with default values for incoming messages (e.g. a default log level of
ERROR for new messages).

I've been trying to figure this out on my own and I keep hitting walls.

Here is my class:
https://github.com/steveno/balistica/blob/master/src/Logging.vala

Issues I've encountered:
* The signal "publish" seems unable to take two parameters.
* You apparently can't add a default value to a member of a struct.
* I can't figure out a way to get the method which writes to the log
inside the logging class because I keep needing access to instance members
from a static function. (https://github.com/steveno/
balistica/blob/master/src/BalisticaApplication.vala#L284)

If anyone has any help or suggestions I'm all ears!

Steven N. Oliver



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]