Skip to content

How to change Logger #151

Answered by halturin
DustOak asked this question in Q&A
Mar 28, 2023 · 3 comments · 6 replies
Discussion options

You must be logged in to vote

the next version 3.0 will get a flexible logging subsystem. you will be able to add a custom logger or use the process as a logger. you will also be able to set the logging level for the node and the process individually. here is little example how it looks like

func (a *MyActor) Init(args ...any) error {
    ...
    a.Log().Info("starting with name - %s", a.Name())
    a.Log().SetLevel(gen.LogLevelDebug)
    return nil
}
...
pid, err := node.SpawnRegister("example", fabricMyActor, gen.ProcessOptions{})
node.Log().Info("started MyActor with PID %s", pid)
node.Log().SetLevel(gen.LogLevelDebug)
...
1686217717548243545 [info] <90A29F11.0.1001>: starting with name - 'example'
1686217717548282816

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@DustOak
Comment options

@DustOak
Comment options

@DustOak
Comment options

@DustOak
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@DustOak
Comment options

@halturin
Comment options

Answer selected by DustOak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #150 on March 28, 2023 16:17.