Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapping all syslog priorities #1

Open
dbyron0 opened this issue Oct 17, 2012 · 0 comments
Open

mapping all syslog priorities #1

dbyron0 opened this issue Oct 17, 2012 · 0 comments

Comments

@dbyron0
Copy link

dbyron0 commented Oct 17, 2012

It's useful for me for SEVERITY_MAP to provide a valid mapping for all syslog priorities. That way I can implement a --debug=[priority] command line argument and then call:

  @logger.level=(Lumberjack::SyslogDevice::SEVERITY_MAP.key(priority))

such that @logger.level ends up as a valid (i.e. not unknown) level.

Trouble is, there are 7 syslog priorities and 5 Logger levels. SyslogDevice.write needs a one-to-one mapping from Logger level to syslog priority, so I think I need a new data structure to map in the other direction.

I can define this mapping in my own code but it seems to fit well here...I'm a ruby noob so I'm not sure the best way to do this.

Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant