-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fwd to juju-dev. Having --level is a good suggestion, I like it.

- -------- Original Message --------
Subject: Re: Debug-Log CLI / API Changes
Date: Wed, 19 Feb 2014 15:41:42 +0700
From: Stuart Bishop <stuart.bis...@canonical.com>
To: Dimiter Naydenov <dimiter.nayde...@canonical.com>

On 18 February 2014 23:01, Dimiter Naydenov
<dimiter.nayde...@canonical.com> wrote:

> The API for debug-log will support internally a list of pairs 
> name-regexp and an exclude flag. Only the name part is required.
> In CLI terms, we're proposing to express this as:
> 
> juju debug-log name1[=regexp1] name2[=regexp2] ... --exclude 
> name3[=regexp3] --exclude name4[=regexp4] ...
> 
> Which is equivalent to the more explicit:
> 
> juju debug-log --include name1[=regexp1] --include name2[=regexp2]
> ... - --exclude name3[=regexp3] --exclude name4[=regexp4] ...
> 
> The full syntax for --include and --exclude is
> --include=name=regexp, where both the first "=" and the "=regexp"
> parts are optional. If no - --include arguments are specified, they
> are assumed.
> 
> Examples: juju debug-log --include
> wordpress/0='.*config-changed.*'

Filtering by regexp can be done easily enough with grep. I'm more
interested it the juju debug-log filters being able to decode the
stream and separate out messages from services, units, hooks, juju
internals from the firehose. So 'juju debug-log --include foo/0' would
reliably spit out the messages from foo/0. The scope would be unit,
service or whole-environment.

If I want to filter this, I'd be wanting to separate out:
  - All hook output (juju-log'd & stdout/stderr).
  - Hook output and LOGLEVEL or above (hook output without a log level
would be equivalent to DEBUG, or something like that).
  - Hooks fired, Hooks queued to run, Hook result (I'd have all of
these or none of these, rather than 3 separate toggles)
  - relation-set details


> juju debug-log --exclude 0=started (show all except any lines from
> machine 0 containing "started")
> 
> juju debug-log environment=hook --exclude
> environment='.*committed.*hook' (show all lines containing "hook"
> but not ".*committed.*hook")

Using regexps for filtering ends up with false positives and
negatives, as well as not being user friendly.

Umm... maybe something like the following bikeshed:

juju debug-log --level=ERROR  # Everything ERROR and above in the
whole environment
juju debug-log --level=DEBUG --unit=foo/0  # Everything DEBUG and
above on the foo/0 unit
juju debug-log --service=foo --messages=hooks,output   # Hook
lifecycle and hook output, all units in the foo service.
juju debug-log --unit=foo/0 --messages=hooks,relation-set  # Hook
lifecycle and relation-sets issued, foo/0 unit

- -- 
Stuart Bishop <stuart.bis...@canonical.com>


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTBHA/AAoJENzxV2TbLzHwmDkIAMliumhLr+2utx6IBs9mKvKa
qrFE0RqNm74sOP6tCqp/OARoFZTjU1OEXAPbf7tmd9EBsj3LjHtKN9Fb3LEZHKkF
6TtG0JadFUr1V2IiA/nlDgglMRvfqr8xdSb/Y1dhb+n6eiBrdsv+Lm5uyieeXONx
3YE8S+lqrKVHSYzSXFY5HbEsuFSB0qM3CqGWfTsyG3uRVusjUWzLMhx1AXfv2RBj
HMXoZusW3om7As3NdaVR/cRuPevAd+iJWs1nIjtM5qytOauin3PKUiDokxFouxdq
7pPWOSiXclQcu2W0sqA8cHp0+of72CHCFsbKEnVamPJ2Hkrpofomu95OO6LNA9g=
=MJU/
-----END PGP SIGNATURE-----

-- 
Juju-dev mailing list
Juju-dev@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju-dev

Reply via email to