mount

jethroksy 2016-04-20T01:33:46.000033Z

quick question: can mount :start and :stop operations contain side effects?

jethroksy 2016-04-20T01:33:54.000034Z

eg. logging

tolitius 2016-04-20T02:03:38.000035Z

@jethroksy: you mean a side effect within a start function?

jethroksy 2016-04-20T02:03:47.000036Z

yup

tolitius 2016-04-20T02:04:46.000037Z

i.e.

(defn start-foo []
  (info "side effect")
  (do-real-work-to-start-foo))

(defstate foo :start (start-foo))
?

jethroksy 2016-04-20T02:04:59.000038Z

yeah exactly that

tolitius 2016-04-20T02:05:11.000039Z

yep, that'll work

jethroksy 2016-04-20T02:05:23.000041Z

alright thanks!

jethroksy 2016-04-20T02:05:38.000042Z

trying to be careful by limiting where side effects should be

tolitius 2016-04-20T02:05:57.000043Z

sure. it just calls the function and binds to the return value, so anything you have inside the function will be done

tolitius 2016-04-20T02:06:24.000044Z

right. usually logging is a good side effect to have :simple_smile:

tolitius 2016-04-20T02:06:41.000045Z

if we talking pragmatic vs. dogmatic

tolitius 2016-04-20T02:07:14.000046Z

unless of course the piece you are working on is a logging lib

jethroksy 2016-04-20T02:07:25.000047Z

haha nah it's not it's just a simple web app

tolitius 2016-04-20T02:07:37.000048Z

yea, I love my logging

tolitius 2016-04-20T02:07:40.000049Z

keeps me in check

jethroksy 2016-04-20T02:07:59.000050Z

yeah i was getting a little annoyed at how little beanstalk logs told me

tolitius 2016-04-20T02:08:34.000051Z

can you set its classes to trace, or it just does not have logging?

tolitius 2016-04-20T02:08:48.000052Z

(I have not used beanstalk)

jethroksy 2016-04-20T02:09:13.000053Z

it didn't have much logging

jethroksy 2016-04-20T02:09:26.000054Z

the other thing is I couldn't tell which docker container was the current one from the logs

jethroksy 2016-04-20T02:09:40.000055Z

so I had tons of logs, but not sure which was from the current app...

jethroksy 2016-04-20T02:09:54.000056Z

it used to show docker ps, not sure why that stopped

tolitius 2016-04-20T02:13:42.000057Z

hm.. just read a bit about beanstalk. interesting, probably a good idea to get to know it :simple_smile: